mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
ringct: compare keys with bitwise equality, not crypto ops
Ported from Shen's RingCT repo
This commit is contained in:
parent
98f4c6f7eb
commit
63733b1785
1 changed files with 6 additions and 7 deletions
|
@ -305,14 +305,13 @@ namespace rct {
|
|||
//checks if A, B are equal as curve points
|
||||
//without doing curve operations
|
||||
bool equalKeys(const key & a, const key & b) {
|
||||
key eqk;
|
||||
sc_sub(eqk.bytes, cn_fast_hash(a).bytes, cn_fast_hash(b).bytes);
|
||||
if (sc_isnonzero(eqk.bytes) ) {
|
||||
//DP("eq bytes");
|
||||
//DP(eqk);
|
||||
return false;
|
||||
bool rv = true;
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
if (a.bytes[i] != b.bytes[i]) {
|
||||
rv = false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return rv;
|
||||
}
|
||||
|
||||
//Hashing - cn_fast_hash
|
||||
|
|
Loading…
Reference in a new issue