Change the byte order from big endian to little endian

This commit is contained in:
Marek 2021-06-01 18:11:39 +02:00
parent f052e8f37f
commit 8eb3937f24
1 changed files with 2 additions and 2 deletions

View File

@ -247,11 +247,11 @@ fn generate_id(secret: &Secret, index: u8) -> u64 {
hasher
.update("FROST_id".as_bytes())
.update(jubjub::AffinePoint::from(SpendAuth::basepoint() * secret.0).to_bytes())
.update(index.to_be_bytes());
.update(index.to_le_bytes());
let id_bytes = hasher.finalize().to_bytes();
u64::from_be_bytes(id_bytes[0..8].try_into().expect("slice of incorrect size"))
u64::from_le_bytes(id_bytes[0..8].try_into().expect("slice of incorrect size"))
}
/// Creates secret shares for a given secret.
///