diff --git a/lib/libcrypto/include/crypto/aes.h b/lib/libcrypto/include/crypto/aes.h index bd77797..eb78ade 100644 --- a/lib/libcrypto/include/crypto/aes.h +++ b/lib/libcrypto/include/crypto/aes.h @@ -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)