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

[crypto] Bulletproofs/PedCom: nothing up my sleeve number for group generation #4808

Merged
merged 1 commit into from
Sep 27, 2022
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
10 changes: 6 additions & 4 deletions crates/sui-framework/src/natives/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ pub const INVALID_RISTRETTO_SCALAR: u64 = 4;
pub const BULLETPROOFS_VERIFICATION_FAILED: u64 = 5;
pub const INVALID_PUBKEY: u64 = 6;

pub const BP_DOMAIN: &[u8] = b"mizu";
/// Using the word "sui" for nothing-up-my-sleeve number guarantees.
pub const BP_DOMAIN: &[u8] = b"sui";

/// Native implemention of ecrecover in public Move API, see crypto.move for specifications.
/// Native implementation of ecrecover in public Move API, see crypto.move for specifications.
pub fn ecrecover(
_context: &mut NativeContext,
ty_args: Vec<Type>,
Expand Down Expand Up @@ -146,7 +147,7 @@ pub fn secp256k1_verify(
}
}

/// Native implemention of bls12381_verify in public Move API, see crypto.move for specifications.
/// Native implementation of bls12381_verify in public Move API, see crypto.move for specifications.
/// Note that this function only works for signatures in G1 and public keys in G2.
pub fn bls12381_verify_g1_sig(
_context: &mut NativeContext,
Expand Down Expand Up @@ -179,7 +180,8 @@ pub fn bls12381_verify_g1_sig(
}
}

/// Native implemention of Bulletproofs range proof in public Move API, see crypto.move for specifications.
/// Native implementation of Bulletproofs range proof in public Move API, see crypto.move for
/// specifications.
pub fn verify_range_proof(
_context: &mut NativeContext,
ty_args: Vec<Type>,
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-framework/src/natives/test_scenario_wip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ fn is_expected_ty(specified_ty: &TypeTag, expected_ty: &StructTag) -> bool {
}

fn get_specified_ty(context: &mut NativeContext, ty_args: Vec<Type>) -> StructTag {
assert!(ty_args.len() == 1);
assert_eq!(ty_args.len(), 1);
match context.type_to_type_tag(&ty_args[0]).unwrap() {
TypeTag::Struct(s) => s,
_ => panic!("impossible, must be a struct since it has key"),
Expand Down