add and use constant time 32 byte equality function
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/* ===================================================================== */
|
||||
|
||||
Reference in New Issue
Block a user