OnlineAccountData no longer uses signature in equals() or hashCode() because newer aggregate signatures use random nonces and OAD class doesn't care about / verify sigs

This commit is contained in:
catbref 2022-05-17 21:59:55 +01:00
parent c032b92d0d
commit d9b330b46a

View File

@ -66,13 +66,11 @@ public class OnlineAccountData {
if (otherOnlineAccountData.timestamp != this.timestamp) if (otherOnlineAccountData.timestamp != this.timestamp)
return false; return false;
// Signature more likely to be unique than public key
if (!Arrays.equals(otherOnlineAccountData.signature, this.signature))
return false;
if (!Arrays.equals(otherOnlineAccountData.publicKey, this.publicKey)) if (!Arrays.equals(otherOnlineAccountData.publicKey, this.publicKey))
return false; return false;
// We don't compare signature because it's not our remit to verify and newer aggregate signatures use random nonces
return true; return true;
} }
@ -81,8 +79,8 @@ public class OnlineAccountData {
int h = this.hash; int h = this.hash;
if (h == 0) { if (h == 0) {
this.hash = h = Long.hashCode(this.timestamp) this.hash = h = Long.hashCode(this.timestamp)
^ Arrays.hashCode(this.publicKey) ^ Arrays.hashCode(this.publicKey);
^ Arrays.hashCode(this.signature); // We don't use signature because newer aggregate signatures use random nonces
} }
return h; return h;
} }