Skip to content

Commit

Permalink
constantine - remove usage of blst in from_bytes_unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxcs committed Jan 11, 2024
1 parent d08d3f9 commit e631953
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions constantine/src/types/fr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e631953

Please sign in to comment.