Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Oct 1, 2024
1 parent 0139b29 commit b4ca778
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 0 additions & 3 deletions apple.rust.deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ CC="$CLANG" CFLAGS="$CFLAGS" CPPFLAGS="$CFLAGS" LDFLAGS="$CFLAGS" \
--host=${HOST} --prefix="${CURRENT_DIR}/gmplib-${PFX}" \
--disable-shared --enable-static --disable-assembly -v
EOF
echo CC="$CLANG" CFLAGS="$CFLAGS" CPPFLAGS="$CFLAGS" LDFLAGS="$CFLAGS" \
--host=${HOST} --prefix="${CURRENT_DIR}/gmplib-${PFX}" \
--disable-shared --enable-static --disable-assembly -v

chmod a+x "$CONFIGURESCRIPT"
sh "$CONFIGURESCRIPT"
Expand Down
16 changes: 11 additions & 5 deletions rust-bindings/bls-signatures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,23 @@ mod tests {

#[test]
fn test_bls_public_key() {
println!("ody");

let seed = b"seedweedseedweedseedweedseedweed";
let scheme = LegacySchemeMPL::new();

let private_key = PrivateKey::key_gen(&scheme, seed).expect("unable to generate private key");
let public_key = private_key.g1_element().expect("unable to get public key");

println!("private_key:{:?}", private_key.to_bytes().as_slice());
println!("public_key:{:?}", public_key.to_bytes().as_slice());
let expected_priv_key = vec![92, 116, 13, 32, 66, 150, 74, 240, 121, 255, 94, 222, 127, 180, 19, 10, 244, 212, 173, 51, 91, 198, 162, 132, 230, 105, 134, 255, 125, 191, 198, 223];
let expected_pub_key = vec![129, 171, 183, 152, 50, 52, 28, 18, 241, 75, 118, 255, 58, 136, 184, 52, 247, 229, 14, 221, 40, 117, 194, 142, 2, 208, 193, 215, 131, 17, 234, 195, 229, 23, 249, 239, 139, 176, 18, 187, 102, 55, 162, 76, 48, 88, 228, 150];

assert_eq!(
private_key.to_bytes().as_slice(),
expected_priv_key
);

println!("ody done");
assert_eq!(
public_key.to_bytes().as_slice(),
expected_pub_key
);
}
}

0 comments on commit b4ca778

Please sign in to comment.