Skip to content

Commit

Permalink
bls & multi-bls signing verification + tests
Browse files Browse the repository at this point in the history
Co-authored-by: Mihai Blacioti <[email protected]>
  • Loading branch information
andreivasilescu24 and JustEatAnApple committed Aug 30, 2024
1 parent ddc233b commit d143418
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 17 deletions.
52 changes: 52 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ colored = "2.1.0"
rand = { version= "0.8.5", optional = true }
rand_seeder = "0.3.0"
ed25519-dalek = "2.1.0"
blst = "0.3.13"

[dependencies.multiversx-chain-vm-executor]
version = "0.2.0"
87 changes: 71 additions & 16 deletions vm/src/crypto_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use sha3::{Digest, Keccak256};

pub const SHA256_RESULT_LEN: usize = 32;
pub const KECCAK256_RESULT_LEN: usize = 32;
pub const BLS_DST_VALUE: &[u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_";

pub fn sha256(data: &[u8]) -> [u8; SHA256_RESULT_LEN] {
let mut hasher = Sha256::new();
Expand All @@ -16,29 +17,83 @@ pub fn keccak256(data: &[u8]) -> [u8; KECCAK256_RESULT_LEN] {
hasher.finalize().into()
}

#[cfg(feature = "wasm-incopatible")]

Check failure on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts / Test Coverage

unexpected `cfg` condition value: `wasm-incopatible`

Check warning on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] vm/src/crypto_functions.rs#L20

warning: unexpected `cfg` condition value: `wasm-incopatible` --> vm/src/crypto_functions.rs:20:7 | 20 | #[cfg(feature = "wasm-incopatible")] | ^^^^^^^^^^------------------ | | | help: there is a expected value with a similar name: `"wasm-incompatible"` | = note: expected values for `feature` are: `rand` and `wasm-incompatible` = help: consider adding `wasm-incopatible` as a feature in `Cargo.toml` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default
Raw output
vm/src/crypto_functions.rs:20:7:w:warning: unexpected `cfg` condition value: `wasm-incopatible`
  --> vm/src/crypto_functions.rs:20:7
   |
20 | #[cfg(feature = "wasm-incopatible")]
   |       ^^^^^^^^^^------------------
   |                 |
   |                 help: there is a expected value with a similar name: `"wasm-incompatible"`
   |
   = note: expected values for `feature` are: `rand` and `wasm-incompatible`
   = help: consider adding `wasm-incopatible` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default


__END__

Check warning on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] vm/src/crypto_functions.rs#L20

warning: unexpected `cfg` condition value: `wasm-incopatible` --> vm/src/crypto_functions.rs:20:7 | 20 | #[cfg(feature = "wasm-incopatible")] | ^^^^^^^^^^------------------ | | | help: there is a expected value with a similar name: `"wasm-incompatible"` | = note: expected values for `feature` are: `rand` and `wasm-incompatible` = help: consider adding `wasm-incopatible` as a feature in `Cargo.toml` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration = note: `#[warn(unexpected_cfgs)]` on by default
Raw output
vm/src/crypto_functions.rs:20:7:w:warning: unexpected `cfg` condition value: `wasm-incopatible`
  --> vm/src/crypto_functions.rs:20:7
   |
20 | #[cfg(feature = "wasm-incopatible")]
   |       ^^^^^^^^^^------------------
   |                 |
   |                 help: there is a expected value with a similar name: `"wasm-incompatible"`
   |
   = note: expected values for `feature` are: `rand` and `wasm-incompatible`
   = help: consider adding `wasm-incopatible` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default


__END__

Check failure on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Proxy compare - newly generated vs present in file tree

unexpected `cfg` condition value: `wasm-incopatible`

Check failure on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts (nightly) / Test Coverage

unexpected `cfg` condition value: `wasm-incopatible`

Check warning on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts (nightly) / Rust tests

unexpected `cfg` condition value: `wasm-incopatible`

Check warning on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

unexpected `cfg` condition value: `wasm-incopatible`

Check failure on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Template tool test - released templates

unexpected `cfg` condition value: `wasm-incopatible`

Check failure on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Template tool test - current (unreleased) templates

unexpected `cfg` condition value: `wasm-incopatible`

Check failure on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unexpected `cfg` condition value: `wasm-incopatible`

Check failure on line 20 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts (nightly) / Wasm tests

unexpected `cfg` condition value: `wasm-incopatible`
pub fn verify_ed25519(key: &[u8], message: &[u8], signature: &[u8]) -> bool {
use ed25519_dalek::{Signature, Verifier, VerifyingKey};
use ed25519_dalek::*;

let key_32: [u8; 32] = if let Ok(key_32) = key.try_into() {
key_32
} else {
let public = PublicKey::from_bytes(key);
if public.is_err() {
return false;
};
let signature_64: [u8; 64] = if let Ok(signature_64) = signature.try_into() {
signature_64
} else {
}

let sig = Signature::from_bytes(signature);
if sig.is_err() {
return false;
}

public.unwrap().verify(message, &sig.unwrap()).is_ok()
}

#[cfg(not(feature = "wasm-incopatible"))]

Check failure on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts / Test Coverage

unexpected `cfg` condition value: `wasm-incopatible`

Check warning on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] vm/src/crypto_functions.rs#L37

warning: unexpected `cfg` condition value: `wasm-incopatible` --> vm/src/crypto_functions.rs:37:11 | 37 | #[cfg(not(feature = "wasm-incopatible"))] | ^^^^^^^^^^------------------ | | | help: there is a expected value with a similar name: `"wasm-incompatible"` | = note: expected values for `feature` are: `rand` and `wasm-incompatible` = help: consider adding `wasm-incopatible` as a feature in `Cargo.toml` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
Raw output
vm/src/crypto_functions.rs:37:11:w:warning: unexpected `cfg` condition value: `wasm-incopatible`
  --> vm/src/crypto_functions.rs:37:11
   |
37 | #[cfg(not(feature = "wasm-incopatible"))]
   |           ^^^^^^^^^^------------------
   |                     |
   |                     help: there is a expected value with a similar name: `"wasm-incompatible"`
   |
   = note: expected values for `feature` are: `rand` and `wasm-incompatible`
   = help: consider adding `wasm-incopatible` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration


__END__

Check warning on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] vm/src/crypto_functions.rs#L37

warning: unexpected `cfg` condition value: `wasm-incopatible` --> vm/src/crypto_functions.rs:37:11 | 37 | #[cfg(not(feature = "wasm-incopatible"))] | ^^^^^^^^^^------------------ | | | help: there is a expected value with a similar name: `"wasm-incompatible"` | = note: expected values for `feature` are: `rand` and `wasm-incompatible` = help: consider adding `wasm-incopatible` as a feature in `Cargo.toml` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
Raw output
vm/src/crypto_functions.rs:37:11:w:warning: unexpected `cfg` condition value: `wasm-incopatible`
  --> vm/src/crypto_functions.rs:37:11
   |
37 | #[cfg(not(feature = "wasm-incopatible"))]
   |           ^^^^^^^^^^------------------
   |                     |
   |                     help: there is a expected value with a similar name: `"wasm-incompatible"`
   |
   = note: expected values for `feature` are: `rand` and `wasm-incompatible`
   = help: consider adding `wasm-incopatible` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration


__END__

Check failure on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Proxy compare - newly generated vs present in file tree

unexpected `cfg` condition value: `wasm-incopatible`

Check failure on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts (nightly) / Test Coverage

unexpected `cfg` condition value: `wasm-incopatible`

Check warning on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts (nightly) / Rust tests

unexpected `cfg` condition value: `wasm-incopatible`

Check warning on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts / Rust tests

unexpected `cfg` condition value: `wasm-incopatible`

Check failure on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Template tool test - released templates

unexpected `cfg` condition value: `wasm-incopatible`

Check failure on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Template tool test - current (unreleased) templates

unexpected `cfg` condition value: `wasm-incopatible`

Check failure on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts / Wasm tests

unexpected `cfg` condition value: `wasm-incopatible`

Check failure on line 37 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / Contracts (nightly) / Wasm tests

unexpected `cfg` condition value: `wasm-incopatible`
pub fn verify_ed25519(_key: &[u8], _message: &[u8], _signature: &[u8]) -> bool {
panic!("verify_ed25519 not supported for wasm builds, feature `wasm-incopatible` needs to be enabled")
}

pub fn verify_bls_signature(key: &[u8], message: &[u8], signature: &[u8]) -> bool {
use blst::{
min_pk::{PublicKey, Signature},
BLST_ERROR,
};

let verifying_key_result = VerifyingKey::from_bytes(&key_32);
let verifying_key = if let Ok(verifying_key) = verifying_key_result {
verifying_key
} else {
return false;
let public_key = PublicKey::from_bytes(key).unwrap();

let sig = Signature::from_bytes(signature).unwrap();

let verify_response = sig.verify(true, message, BLS_DST_VALUE, &[], &public_key, true);

match verify_response {

Check warning on line 54 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] vm/src/crypto_functions.rs#L54

warning: match expression looks like `matches!` macro --> vm/src/crypto_functions.rs:54:5 | 54 | / match verify_response { 55 | | BLST_ERROR::BLST_SUCCESS => true, 56 | | _ => false, 57 | | } | |_____^ help: try: `matches!(verify_response, BLST_ERROR::BLST_SUCCESS)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro = note: `#[warn(clippy::match_like_matches_macro)]` on by default
Raw output
vm/src/crypto_functions.rs:54:5:w:warning: match expression looks like `matches!` macro
  --> vm/src/crypto_functions.rs:54:5
   |
54 | /     match verify_response {
55 | |         BLST_ERROR::BLST_SUCCESS => true,
56 | |         _ => false,
57 | |     }
   | |_____^ help: try: `matches!(verify_response, BLST_ERROR::BLST_SUCCESS)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
   = note: `#[warn(clippy::match_like_matches_macro)]` on by default


__END__

Check warning on line 54 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] vm/src/crypto_functions.rs#L54

warning: match expression looks like `matches!` macro --> vm/src/crypto_functions.rs:54:5 | 54 | / match verify_response { 55 | | BLST_ERROR::BLST_SUCCESS => true, 56 | | _ => false, 57 | | } | |_____^ help: try: `matches!(verify_response, BLST_ERROR::BLST_SUCCESS)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro = note: `#[warn(clippy::match_like_matches_macro)]` on by default
Raw output
vm/src/crypto_functions.rs:54:5:w:warning: match expression looks like `matches!` macro
  --> vm/src/crypto_functions.rs:54:5
   |
54 | /     match verify_response {
55 | |         BLST_ERROR::BLST_SUCCESS => true,
56 | |         _ => false,
57 | |     }
   | |_____^ help: try: `matches!(verify_response, BLST_ERROR::BLST_SUCCESS)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
   = note: `#[warn(clippy::match_like_matches_macro)]` on by default


__END__
BLST_ERROR::BLST_SUCCESS => true,
_ => false,
}
}

pub fn verify_multi_bls_signature(
public_keys: Vec<&[u8]>,
message: &[u8],
aggregated_signature: &[u8],
) -> bool {
use blst::{
min_pk::{AggregatePublicKey, AggregateSignature, PublicKey, Signature},
BLST_ERROR,
};

let sig = Signature::from_bytes(&signature_64);
let mut aggregate_pk: AggregatePublicKey =
AggregatePublicKey::from_public_key(&PublicKey::default());

let public_keys_converted: Vec<PublicKey> = public_keys
.iter()
.filter_map(|key| PublicKey::from_bytes(key).ok())
.collect();

public_keys_converted
.iter()
.for_each(|pk| aggregate_pk.add_public_key(pk, true).unwrap());

let aggregate_sig: Signature =
AggregateSignature::from_signature(&Signature::from_bytes(aggregated_signature).unwrap())
.to_signature();

let verify_response = aggregate_sig.verify(
true,
message,
BLS_DST_VALUE,
&[],
&aggregate_pk.to_public_key(),
true,
);

let result = verifying_key.verify(message, &sig);
result.is_ok()
match verify_response {

Check warning on line 95 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] vm/src/crypto_functions.rs#L95

warning: match expression looks like `matches!` macro --> vm/src/crypto_functions.rs:95:5 | 95 | / match verify_response { 96 | | BLST_ERROR::BLST_SUCCESS => true, 97 | | _ => false, 98 | | } | |_____^ help: try: `matches!(verify_response, BLST_ERROR::BLST_SUCCESS)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
Raw output
vm/src/crypto_functions.rs:95:5:w:warning: match expression looks like `matches!` macro
  --> vm/src/crypto_functions.rs:95:5
   |
95 | /     match verify_response {
96 | |         BLST_ERROR::BLST_SUCCESS => true,
97 | |         _ => false,
98 | |     }
   | |_____^ help: try: `matches!(verify_response, BLST_ERROR::BLST_SUCCESS)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro


__END__

Check warning on line 95 in vm/src/crypto_functions.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] vm/src/crypto_functions.rs#L95

warning: match expression looks like `matches!` macro --> vm/src/crypto_functions.rs:95:5 | 95 | / match verify_response { 96 | | BLST_ERROR::BLST_SUCCESS => true, 97 | | _ => false, 98 | | } | |_____^ help: try: `matches!(verify_response, BLST_ERROR::BLST_SUCCESS)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
Raw output
vm/src/crypto_functions.rs:95:5:w:warning: match expression looks like `matches!` macro
  --> vm/src/crypto_functions.rs:95:5
   |
95 | /     match verify_response {
96 | |         BLST_ERROR::BLST_SUCCESS => true,
97 | |         _ => false,
98 | |     }
   | |_____^ help: try: `matches!(verify_response, BLST_ERROR::BLST_SUCCESS)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro


__END__
BLST_ERROR::BLST_SUCCESS => true,
_ => false,
}
}
60 changes: 59 additions & 1 deletion vm/tests/test_crypto.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use blst::min_pk::{AggregateSignature, Signature};
use hex::FromHex;
use multiversx_chain_vm::crypto_functions;
use multiversx_chain_vm::crypto_functions::{
self, verify_bls_signature, verify_multi_bls_signature,
};

#[test]
fn test_verify_ed25519_basic() {
Expand Down Expand Up @@ -42,3 +45,58 @@ fn test_verify_ed25519_invalid_args() {
let success = crypto_functions::verify_ed25519(&pub_bytes, &msg_bytes, &sig_bytes);
assert!(!success);
}

#[test]
fn test_verify_bls_signature() {
let public_key_hex = b"82eb2ddfa71f1673fbfbd17952838cbca3816d5e60bf5cdb220d8cad6cb800e2ed18bb747ef45b17c9b8cbc971c6b980";
let message = b"hello";
let signature_hex = b"979a97882bd59dd97d860c99f9c4295e7d63e3fede1823b942d31d71ea3707d8c179ab733d38f7497b53bfa1535fe5e202f2a1c6e4df1dbc97dbe315dccd51676dbef31af1fe60d4b11c304db61913dc1d39e929f80f2cd10b72cbc661235048";

let public_key_bytes: Vec<u8> = FromHex::from_hex(public_key_hex).unwrap();
let signature_bytes: Vec<u8> = FromHex::from_hex(signature_hex).unwrap();

let success = verify_bls_signature(&public_key_bytes, message, &signature_bytes);

assert_eq!(success, true, "BLS signature verification failed");

Check warning on line 60 in vm/tests/test_crypto.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] vm/tests/test_crypto.rs#L60

warning: used `assert_eq!` with a literal bool --> vm/tests/test_crypto.rs:60:5 | 60 | assert_eq!(success, true, "BLS signature verification failed"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison = note: `#[warn(clippy::bool_assert_comparison)]` on by default help: replace it with `assert!(..)` | 60 - assert_eq!(success, true, "BLS signature verification failed"); 60 + assert!(success, "BLS signature verification failed"); |
Raw output
vm/tests/test_crypto.rs:60:5:w:warning: used `assert_eq!` with a literal bool
  --> vm/tests/test_crypto.rs:60:5
   |
60 |     assert_eq!(success, true, "BLS signature verification failed");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
   = note: `#[warn(clippy::bool_assert_comparison)]` on by default
help: replace it with `assert!(..)`
   |
60 -     assert_eq!(success, true, "BLS signature verification failed");
60 +     assert!(success, "BLS signature verification failed");
   |


__END__
}

#[test]
fn test_verify_aggregated_signatures() {
let message = b"hello";

let pk1 = b"82eb2ddfa71f1673fbfbd17952838cbca3816d5e60bf5cdb220d8cad6cb800e2ed18bb747ef45b17c9b8cbc971c6b980";
let pk2 = b"a81795a7afa09274717a170d6ba42ab06b65b25c7887eca7be46dfddae4e5b1a249f104b15551a7a445cccac9b403926";
let pk3 = b"8bf9e68f8fc54d8cb808ba43f0ada562cafa3c07448ab038eff6f579f1e4c1d497a957f50f6eca2608f36c39d874cbea";

let pk1_bytes: Vec<u8> = FromHex::from_hex(pk1).unwrap();
let pk2_bytes: Vec<u8> = FromHex::from_hex(pk2).unwrap();
let pk3_bytes: Vec<u8> = FromHex::from_hex(pk3).unwrap();

let sig1 = b"979a97882bd59dd97d860c99f9c4295e7d63e3fede1823b942d31d71ea3707d8c179ab733d38f7497b53bfa1535fe5e202f2a1c6e4df1dbc97dbe315dccd51676dbef31af1fe60d4b11c304db61913dc1d39e929f80f2cd10b72cbc661235048";
let sig2 = b"a5a465bb34264faa5d695ad844cfbacc5514ef8cb50abdc874bbbe065e74fc2dcd69f22e6e3a25260c8a9b6c55d7ca6d0d42227a58385f7af440b85d447675bee433c88726c582ef66fba5357b60e6d980ce43e7c6a6929ed605dbe51d47c453";
let sig3 = b"9936262ea50315d00c2b082cae3a97315f8852a021de195cb256bf532d439f1965a65c9fa536693ecb7a238611cb9ac30926d4958a7852955ff56aba9f60d9bda7ba10a939bd8b370bc42b667ee2f4fe4bb671482abc93bcac11ec10c0230229";

let sig1_bytes: Vec<u8> = FromHex::from_hex(sig1).unwrap();
let sig2_bytes: Vec<u8> = FromHex::from_hex(sig2).unwrap();
let sig3_bytes: Vec<u8> = FromHex::from_hex(sig3).unwrap();

let sig1_converted = Signature::from_bytes(&sig1_bytes).unwrap();
let sig2_converted = Signature::from_bytes(&sig2_bytes).unwrap();
let sig3_converted = Signature::from_bytes(&sig3_bytes).unwrap();

let mut agg_sig = AggregateSignature::from_signature(&sig1_converted);
agg_sig.add_signature(&sig2_converted, true).unwrap();
agg_sig.add_signature(&sig3_converted, true).unwrap();
let final_agg_sig = agg_sig.to_signature();

let success = verify_multi_bls_signature(
vec![&pk1_bytes, &pk2_bytes, &pk3_bytes],
message,
&final_agg_sig.to_bytes(),
);

assert_eq!(

Check warning on line 98 in vm/tests/test_crypto.rs

View workflow job for this annotation

GitHub Actions / clippy

[clippy] vm/tests/test_crypto.rs#L98

warning: used `assert_eq!` with a literal bool --> vm/tests/test_crypto.rs:98:5 | 98 | / assert_eq!( 99 | | success, true, 100 | | "Aggregated BLS signature verification failed" 101 | | ); | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison help: replace it with `assert!(..)` | 98 ~ assert!( 99 ~ success, |
Raw output
vm/tests/test_crypto.rs:98:5:w:warning: used `assert_eq!` with a literal bool
   --> vm/tests/test_crypto.rs:98:5
    |
98  | /     assert_eq!(
99  | |         success, true,
100 | |         "Aggregated BLS signature verification failed"
101 | |     );
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison
help: replace it with `assert!(..)`
    |
98  ~     assert!(
99  ~         success,
    |


__END__
success, true,
"Aggregated BLS signature verification failed"
);
}

0 comments on commit d143418

Please sign in to comment.