From e6319538e299a2570634b6d2cbc2be4de8b36981 Mon Sep 17 00:00:00 2001 From: Domas Kalinauskas Date: Thu, 11 Jan 2024 19:34:06 +0200 Subject: [PATCH] constantine - remove usage of blst in from_bytes_unchecked --- constantine/src/types/fr.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/constantine/src/types/fr.rs b/constantine/src/types/fr.rs index 5880938c..2d429def 100644 --- a/constantine/src/types/fr.rs +++ b/constantine/src/types/fr.rs @@ -125,8 +125,11 @@ impl Fr for CtFr { let mut ret = Self::default(); let mut scalar = constantine::big255::default(); unsafe { - // FIXME: Seems like no 'non-validating' variant exists in constantine - blst::blst_scalar_from_bendian(ptr_transmute_mut(&mut scalar), bytes.as_ptr()); + let _ = constantine::ctt_big255_unmarshalBE( + &mut scalar, + bytes.as_ptr(), + BYTES_PER_FIELD_ELEMENT as isize, + ); constantine::ctt_bls12_381_fr_from_big255(&mut ret.0, &scalar); } ret