mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 10:32:29 +00:00
feat(big): add SBigXor
This commit is contained in:
parent
6a88f93619
commit
da8a663fd7
5 changed files with 63 additions and 0 deletions
|
|
@ -482,3 +482,12 @@ void ToStream(TSGrowableArray<uint8_t>& output, const BigBuffer& buffer) {
|
|||
EncodeDataBytes(output, output.Count());
|
||||
ToBinaryAppend(output, buffer);
|
||||
}
|
||||
|
||||
void Xor(BigBuffer& a, const BigBuffer& b, const BigBuffer& c) {
|
||||
uint32_t i = 0;
|
||||
for (; b.IsUsed(i) || c.IsUsed(i); i++) {
|
||||
a[i] = c[i] ^ b[i];
|
||||
}
|
||||
|
||||
a.SetCount(i);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,4 +75,6 @@ void ToBinary(TSGrowableArray<uint8_t>& output, const BigBuffer& buffer);
|
|||
|
||||
void ToStream(TSGrowableArray<uint8_t>& output, const BigBuffer& buffer);
|
||||
|
||||
void Xor(BigBuffer& a, const BigBuffer& b, const BigBuffer& c);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue