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

Limit input for _to_biguint56_ in _primefield_ #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/primefield/src/lib.nr
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ impl PrimeField {

/// Converts the prime field element to a BigUint56 value.
fn to_biguint56(self: Self) -> BigUint56 {
assert(self.val.lt(Self::modulus()));

// Turn into canonical form by computing
// (a.R) / R = a
let tmp = PrimeField::montgomery_reduce(self.val, BigUint56::zero());
Expand Down
Loading