From 8eb3937f2484c5361623315cae51db1bbcf08e5a Mon Sep 17 00:00:00 2001 From: Marek Date: Tue, 1 Jun 2021 18:11:39 +0200 Subject: [PATCH] Change the byte order from big endian to little endian --- src/frost.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frost.rs b/src/frost.rs index 2c49186..001d936 100644 --- a/src/frost.rs +++ b/src/frost.rs @@ -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. ///