diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-06-13 18:23:06 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-08-23 07:56:51 +0000 |
commit | d2e26c23f3caa7928c46c3a6bded85fdc1a68cb3 (patch) | |
tree | 78381c86a73e46cc265d58dd9ff770fd56a1ec99 /src/device | |
parent | Merge pull request #4249 (diff) | |
download | monero-d2e26c23f3caa7928c46c3a6bded85fdc1a68cb3.tar.xz |
add and use constant time 32 byte equality function
Diffstat (limited to 'src/device')
-rw-r--r-- | src/device/device_ledger.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp index 7a34dad5e..c4e9e40b7 100644 --- a/src/device/device_ledger.cpp +++ b/src/device/device_ledger.cpp @@ -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); } /* ===================================================================== */ |