mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-08 08:43:06 +00:00
addressed comments
This commit is contained in:
parent
695a56c4ca
commit
d2c589e281
@ -38,7 +38,11 @@ fn biguint_from_array(arr: [u64; 4]) -> BigUint {
|
|||||||
|
|
||||||
impl Secp256K1Base {
|
impl Secp256K1Base {
|
||||||
fn to_canonical_biguint(&self) -> BigUint {
|
fn to_canonical_biguint(&self) -> BigUint {
|
||||||
biguint_from_array(self.0).mod_floor(&Self::order())
|
let mut result = biguint_from_array(self.0);
|
||||||
|
if result > Self::order() {
|
||||||
|
result -= Self::order();
|
||||||
|
}
|
||||||
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
fn from_biguint(val: BigUint) -> Self {
|
fn from_biguint(val: BigUint) -> Self {
|
||||||
@ -162,7 +166,6 @@ impl Add for Secp256K1Base {
|
|||||||
type Output = Self;
|
type Output = Self;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
||||||
fn add(self, rhs: Self) -> Self {
|
fn add(self, rhs: Self) -> Self {
|
||||||
let mut result = self.to_canonical_biguint() + rhs.to_canonical_biguint();
|
let mut result = self.to_canonical_biguint() + rhs.to_canonical_biguint();
|
||||||
if result >= Self::order() {
|
if result >= Self::order() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user