Skip to content

Commit b26f055

Browse files
committed
Fixed hashing
Signed-off-by: Michael Lodder <redmike7@gmail.com>
1 parent f1f259c commit b26f055

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/field_elem.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ impl FieldElement {
141141

142142
/// Hash an arbitrary sized message using SHAKE and return output as a field element
143143
pub fn from_msg_hash(msg: &[u8]) -> Self {
144-
let mut value = BigNum::new();
144+
let mut value = hash_mod_order(msg);
145145
while value.iszilch() {
146-
value = hash_mod_order(msg);
146+
value.inc(1);
147147
}
148148
FieldElement { value }
149149
}

0 commit comments

Comments
 (0)