mirror of
https://github.com/monero-project/monero.git
synced 2025-08-03 06:46:13 -04:00
add and use constant time 32 byte equality function
This commit is contained in:
parent
510dbf3329
commit
d2e26c23f3
9 changed files with 130 additions and 14 deletions
|
@ -136,7 +136,8 @@ namespace hw {
|
|||
}
|
||||
|
||||
bool operator==(const crypto::key_derivation &d0, const crypto::key_derivation &d1) {
|
||||
return !memcmp(&d0, &d1, sizeof(d0));
|
||||
static_assert(sizeof(crypto::key_derivation) == 32, "key_derivation must be 32 bytes");
|
||||
return !crypto_verify_32((const unsigned char*)&d0, (const unsigned char*)&d1);
|
||||
}
|
||||
|
||||
/* ===================================================================== */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue