Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove unnecessary usage of slices #104

Merged
merged 3 commits into from
Jan 21, 2025
Merged
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
10 changes: 5 additions & 5 deletions src/bignum.nr
Original file line number Diff line number Diff line change
Expand Up @@ -179,27 +179,27 @@ where

unconstrained fn __neg(self) -> Self {
let params = Params::get_params();
Self::from_slice(__neg(params, self.limbs))
Self { limbs: __neg(params, self.limbs) }
}

unconstrained fn __add(self, other: Self) -> Self {
let params = Params::get_params();
Self::from_slice(__add(params, self.limbs, other.limbs))
Self { limbs: __add(params, self.limbs, other.limbs) }
}

unconstrained fn __sub(self, other: Self) -> Self {
let params = Params::get_params();
Self::from_slice(__sub(params, self.limbs, other.limbs))
Self { limbs: __sub(params, self.limbs, other.limbs) }
}

unconstrained fn __mul(self, other: Self) -> Self {
let params = Params::get_params();
Self::from_slice(__mul::<_, MOD_BITS>(params, self.limbs, other.limbs))
Self { limbs: __mul::<_, MOD_BITS>(params, self.limbs, other.limbs) }
}

unconstrained fn __div(self, divisor: Self) -> Self {
let params = Params::get_params();
Self::from_slice(__div::<_, MOD_BITS>(params, self.limbs, divisor.limbs))
Self { limbs: __div::<_, MOD_BITS>(params, self.limbs, divisor.limbs) }
}

unconstrained fn __udiv_mod(self, divisor: Self) -> (Self, Self) {
Expand Down
Loading