mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-06-29 10:29:32 +00:00
feat!: obfuscate note and cipher order by byte-sort
BREAKING: Before: Commitments, nullifiers, and ciphers of an account ID I were all bound to the same possition in their respective vectors. After: Before writing to journal, the PPC sorts the commitments and nullifiers by bytes and encrypted account data by ciphertext comparissons. Mitigation: Do not rely on the plaintext order to be preserved for private accounts after proving
This commit is contained in:
parent
ed4329103e
commit
78e5b1d1ae
@ -252,6 +252,16 @@ pub fn compute_circuit_output(
|
||||
}
|
||||
}
|
||||
|
||||
output
|
||||
.new_commitments
|
||||
.sort_unstable_by_key(Commitment::to_byte_array);
|
||||
output
|
||||
.new_nullifiers
|
||||
.sort_unstable_by_key(|(nullifier, _)| nullifier.to_byte_array());
|
||||
output
|
||||
.encrypted_private_post_states
|
||||
.sort_unstable_by(|a, b| a.ciphertext.as_bytes().cmp(b.ciphertext.as_bytes()));
|
||||
|
||||
output
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user