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

fix: add pub modifier to grumpkin functions #3036

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
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
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)
}