Skip to content

Commit

Permalink
fix: add pub modifier to grumpkin functions (#3036)
Browse files Browse the repository at this point in the history
Co-authored-by: kevaundray <[email protected]>
  • Loading branch information
alexghr and kevaundray authored Oct 9, 2023
1 parent 082a6d0 commit f8990d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions noir_stdlib/src/grumpkin_scalar.nr
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ struct GrumpkinScalar {
}

impl GrumpkinScalar {
fn new(low: Field, high: Field) -> Self {
pub fn new(low: Field, high: Field) -> Self {
// TODO: check that the low and high value fit within the grumpkin modulus
GrumpkinScalar { low, high }
}
}

global GRUMPKIN_SCALAR_SERIALIZED_LEN: Field = 2;

fn deserialize_grumpkin_scalar(fields: [Field; GRUMPKIN_SCALAR_SERIALIZED_LEN]) -> GrumpkinScalar {
pub fn deserialize_grumpkin_scalar(fields: [Field; GRUMPKIN_SCALAR_SERIALIZED_LEN]) -> GrumpkinScalar {
GrumpkinScalar { low: fields[0], high: fields[1] }
}

fn serialize_grumpkin_scalar(scalar: GrumpkinScalar) -> [Field; GRUMPKIN_SCALAR_SERIALIZED_LEN] {
pub fn serialize_grumpkin_scalar(scalar: GrumpkinScalar) -> [Field; GRUMPKIN_SCALAR_SERIALIZED_LEN] {
[scalar.low, scalar.high]
}
2 changes: 1 addition & 1 deletion noir_stdlib/src/grumpkin_scalar_mul.nr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::grumpkin_scalar::GrumpkinScalar;
use crate::scalar_mul::fixed_base_embedded_curve;

fn grumpkin_fixed_base(scalar: GrumpkinScalar) -> [Field; 2] {
pub fn grumpkin_fixed_base(scalar: GrumpkinScalar) -> [Field; 2] {
// TODO: this should use both the low and high limbs to do the scalar multiplication
fixed_base_embedded_curve(scalar.low, scalar.high)
}

0 comments on commit f8990d7

Please sign in to comment.