Skip to content

Commit

Permalink
crypto: Update BLS default to infinity (MystenLabs#8035)
Browse files Browse the repository at this point in the history
remove option from all BLS aggregate signature. infinity point is used
for Signature::default()
  • Loading branch information
joyqvq authored Feb 9, 2023
1 parent 077f619 commit 8d1b923
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 116 deletions.
188 changes: 94 additions & 94 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ move-prover-boogie-backend = { git = "https://github.com/move-language/move", re
move-stackless-bytecode = { git = "https://github.com/move-language/move", rev = "9b2bbcc14958f37c9adeab933f1e1d6b0db81691" }
move-symbol-pool = { git = "https://github.com/move-language/move", rev = "9b2bbcc14958f37c9adeab933f1e1d6b0db81691" }

fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "235211dc8195590f5353d38135f5ee51a267521e" }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "235211dc8195590f5353d38135f5ee51a267521e", package = "fastcrypto-zkp" }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "235211dc8195590f5353d38135f5ee51a267521e", package = "fastcrypto-tbls" }
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "b2c77ad4aff173462a1270b4ce0be63ef37db06b" }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "b2c77ad4aff173462a1270b4ce0be63ef37db06b", package = "fastcrypto-zkp" }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "b2c77ad4aff173462a1270b4ce0be63ef37db06b", package = "fastcrypto-tbls" }

# anemo dependencies
anemo = { git = "https://github.com/mystenlabs/anemo.git", rev = "0e0ef7054082a6f5a8921688e3d568761bc3be21" }
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-framework/src/natives/crypto/ecdsa_k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn recover_pubkey(
hashed_msg: &[u8],
) -> Result<Secp256k1RecoverablePublicKey, SuiError> {
match <Secp256k1RecoverableSignature as ToFromBytes>::from_bytes(signature) {
Ok(signature) => match signature.recover(hashed_msg) {
Ok(signature) => match signature.recover_hashed(hashed_msg) {
Ok(pubkey) => Ok(pubkey),
Err(e) => Err(SuiError::KeyConversionError(e.to_string())),
},
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-framework/src/natives/crypto/ecvrf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn ecvrf_verify(
Err(_) => return Ok(NativeResult::err(cost, INVALID_ECVRF_PROOF)),
};

let result = proof.verify_output(alpha_string.as_bytes_ref().as_slice(), &public_key, hash);
let result = proof.verify_output(alpha_string.as_bytes_ref().as_slice(), &public_key, &hash);
Ok(NativeResult::ok(
cost,
smallvec![Value::bool(result.is_ok())],
Expand Down
4 changes: 0 additions & 4 deletions crates/sui-json-rpc-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1813,10 +1813,6 @@ impl TryFrom<CertifiedTransaction> for SuiCertifiedTransaction {
fn try_from(cert: CertifiedTransaction) -> Result<Self, Self::Error> {
let digest = *cert.digest();
let (data, sig) = cert.into_data_and_sig();
// We should always have a signature here.
if sig.signature.sig.is_none() {
return Err(anyhow::anyhow!("Certified transaction is not signed"));
}
Ok(Self {
transaction_digest: digest,
data: data.intent_message.value.try_into()?,
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-open-rpc/spec/openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
"txSignature": "APTKkXWW1T8Vmz5xofVuEEo336IFluv69ByMuPwfvwTrU749/fOtpBw4Kffd0809C+EP/7+GNLWNIbZHH5eRnwUgZe9Z6CbTODIzbq3ZFq53AzRXBmnyBDiKgDwkZI8sdA==",
"authSignInfo": {
"epoch": 0,
"signature": "AaCQESRLSxMntCxHAXuRk66nmlID2DZn3gU64vkZ7iHSjE2Nbhfr21Ovri7AMdAl4Q==",
"signature": "wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"signers_map": [
58,
48,
Expand Down Expand Up @@ -1526,7 +1526,7 @@
"txSignature": "ABR/DtRSEtwJxHYihyjRE8ukXGkkPHcusVx+EECSiHTuGUaIKZOtaYl172/e7+ejKmGeKEwD48in3TAlGF+90wS6hmV5ZkKODtgnokS0vmNHVDWXWuuoOmN18GDl2YAdDg==",
"authSignInfo": {
"epoch": 0,
"signature": "AaCQESRLSxMntCxHAXuRk66nmlID2DZn3gU64vkZ7iHSjE2Nbhfr21Ovri7AMdAl4Q==",
"signature": "wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"signers_map": [
58,
48,
Expand Down
14 changes: 7 additions & 7 deletions crates/workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ expect-test = { version = "1", default-features = false }
eyre = { version = "0.6" }
fail-9fbad63c4bcf4a8f = { package = "fail", version = "0.4", default-features = false }
fail-d8f496e17d97b5cb = { package = "fail", version = "0.5", default-features = false }
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "235211dc8195590f5353d38135f5ee51a267521e", features = ["copy_key"] }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "235211dc8195590f5353d38135f5ee51a267521e", default-features = false }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "235211dc8195590f5353d38135f5ee51a267521e", default-features = false }
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "b2c77ad4aff173462a1270b4ce0be63ef37db06b", features = ["copy_key"] }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "b2c77ad4aff173462a1270b4ce0be63ef37db06b", default-features = false }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "b2c77ad4aff173462a1270b4ce0be63ef37db06b", default-features = false }
fastrand = { version = "1", default-features = false }
fd-lock = { version = "3", default-features = false }
fdlimit = { version = "0.2", default-features = false }
Expand Down Expand Up @@ -867,10 +867,10 @@ expect-test = { version = "1", default-features = false }
eyre = { version = "0.6" }
fail-9fbad63c4bcf4a8f = { package = "fail", version = "0.4", default-features = false }
fail-d8f496e17d97b5cb = { package = "fail", version = "0.5", default-features = false }
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "235211dc8195590f5353d38135f5ee51a267521e", features = ["copy_key"] }
fastcrypto-derive = { git = "https://github.com/MystenLabs/fastcrypto", rev = "235211dc8195590f5353d38135f5ee51a267521e", default-features = false }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "235211dc8195590f5353d38135f5ee51a267521e", default-features = false }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "235211dc8195590f5353d38135f5ee51a267521e", default-features = false }
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "b2c77ad4aff173462a1270b4ce0be63ef37db06b", features = ["copy_key"] }
fastcrypto-derive = { git = "https://github.com/MystenLabs/fastcrypto", rev = "b2c77ad4aff173462a1270b4ce0be63ef37db06b", default-features = false }
fastcrypto-tbls = { git = "https://github.com/MystenLabs/fastcrypto", rev = "b2c77ad4aff173462a1270b4ce0be63ef37db06b", default-features = false }
fastcrypto-zkp = { git = "https://github.com/MystenLabs/fastcrypto", rev = "b2c77ad4aff173462a1270b4ce0be63ef37db06b", default-features = false }
fastrand = { version = "1", default-features = false }
fd-lock = { version = "3", default-features = false }
fdlimit = { version = "0.2", default-features = false }
Expand Down
7 changes: 3 additions & 4 deletions narwhal/node/tests/staged/narwhal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
BLS12381AggregateSignature:
STRUCT:
- sig:
OPTION:
TUPLEARRAY:
CONTENT: U8
SIZE: 48
TUPLEARRAY:
CONTENT: U8
SIZE: 48
BLS12381Signature:
STRUCT:
- sig:
Expand Down

0 comments on commit 8d1b923

Please sign in to comment.