mirror of
https://github.com/jakcron/nstool
synced 2024-12-24 13:41:12 +00:00
[crypto] Add operators to sAesIvCtr
This commit is contained in:
parent
cdd11d58c6
commit
f542b54154
1 changed files with 13 additions and 0 deletions
|
@ -78,10 +78,23 @@ namespace aes
|
|||
memcpy(this->iv, iv, kAes128KeySize);
|
||||
}
|
||||
|
||||
bool compare(const sAesIvCtr& other) const
|
||||
{
|
||||
return memcmp(this->iv, other.iv, kAesBlockSize) == 0;
|
||||
}
|
||||
|
||||
void operator=(const sAesIvCtr& other)
|
||||
{
|
||||
set(other.iv);
|
||||
}
|
||||
bool operator==(const sAesIvCtr& other) const
|
||||
{
|
||||
return compare(other);
|
||||
}
|
||||
bool operator!=(const sAesIvCtr& other) const
|
||||
{
|
||||
return !compare(other);
|
||||
}
|
||||
};
|
||||
#pragma pack (pop)
|
||||
|
||||
|
|
Loading…
Reference in a new issue