Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
feat: create a new from_raw_limbs fn
Browse files Browse the repository at this point in the history
  • Loading branch information
shuklaayush committed Aug 3, 2023
1 parent 00918ae commit c05a5b9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/prime_field.nr
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@ impl PrimeField {
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////

// TODO: Emphasize that there's no montgomery mul here.
fn from_limbs(limbs: [u56; NUM_LIMBS]) -> Self {
// No montgomery mul here.
fn from_raw_limbs(limbs: [u56; NUM_LIMBS]) -> Self {
Self { val: BigUint56{ limbs } }
}

fn from_limbs(limbs: [u56; NUM_LIMBS]) -> Self {
let tmp = Self { val: BigUint56{ limbs } };

tmp.mul(PrimeField::R2())
}

fn from_u56(val: u56) -> Self {
let tmp = Self { val: BigUint56::from_u56(val) };

Expand Down

0 comments on commit c05a5b9

Please sign in to comment.