Skip to content

Commit

Permalink
chore: run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Oct 9, 2024
1 parent fc53098 commit af25c71
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/utils/msb.nr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ global MUL_DE_BRUIJN_BIT: [u32; 128] = [
35, 12, n1, n1, n1, 59, 42, n1, n1, 61, 3, 26, 38, 44, n1, 56
];

unconstrained pub fn get_msb64(x: u64) -> u32 {
pub unconstrained fn get_msb64(x: u64) -> u32 {
let mut v = x;
v |= v >> 1;
v |= v >> 2;
Expand Down
9 changes: 3 additions & 6 deletions src/utils/split_bits.nr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Decomposes a single field into two 120 bit fields and a carry
unconstrained pub fn split_120_bits(x: Field) -> (Field, Field) {
pub unconstrained fn split_120_bits(x: Field) -> (Field, Field) {
let x_bytes: [u8; 32] = x.to_le_bytes();

let mut low: Field = 0;
Expand All @@ -26,7 +26,7 @@ unconstrained pub fn split_120_bits(x: Field) -> (Field, Field) {
*
* @description Expects the input limb to be in the range [0, ..., 2^{120 - 1}]
**/
unconstrained pub fn split_60_bits(x: Field) -> (u64, u64) {
pub unconstrained fn split_60_bits(x: Field) -> (u64, u64) {
let x_bytes: [u8; 32] = x.to_le_bytes();

let mut low: u64 = 0;
Expand All @@ -44,10 +44,7 @@ unconstrained pub fn split_60_bits(x: Field) -> (u64, u64) {
(low, high)
}

unconstrained pub(crate) fn __normalize_limbs<let N: u32>(
input: [Field; N],
range: u32
) -> [Field; N] {
pub(crate) unconstrained fn __normalize_limbs<let N: u32>(input: [Field; N], range: u32) -> [Field; N] {
let mut normalized: [Field; N] = [0; N];
let mut inp: _ = input;
for i in 0..(range - 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/u60_representation.nr
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl<let N: u32, let NumSegments: u32> U60Repr<N, NumSegments> {
}
}

unconstrained fn get_msb(val: Self) -> u32 {
unconstrained fn get_msb(val: Self) -> u32 {
let mut count = 0;
for i in 0..N * NumSegments {
let v = val.limbs[((N * NumSegments) - 1 - i)];
Expand Down

0 comments on commit af25c71

Please sign in to comment.