Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Uncomment tests
  • Loading branch information
Wolmin committed Jan 25, 2023
commit fbce41cc23133b4534c1cfdefaef522923f09a45
25 changes: 13 additions & 12 deletions primitives/keyring/src/dilithium2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,24 +183,25 @@ mod tests {
use super::*;

#[test]
fn should_work() {
fn should_sign_and_verify_correctly() {
assert!(Pair::verify(
&Keyring::Alice.sign(b"I am Alice!"),
b"I am Alice!",
&Keyring::Alice.public(),
));

// TODO JEQB-195 verify returning "false"
// assert!(!Pair::verify(
// &Keyring::Alice.sign(b"I am Alice!"),
// b"I am Bob!",
// &Keyring::Alice.public(),
// ));
// assert!(!Pair::verify(
// &Keyring::Alice.sign(b"I am Alice!"),
// b"I am Alice!",
// &Keyring::Bob.public(),
// ));
// Current mock creates signature just from public key, not the message itself
// so this test will pass regardless of the message, we just need the same signer/verifier
assert!(Pair::verify(
&Keyring::Alice.sign(b"I am Alice!"),
b"I am Bob!",
&Keyring::Alice.public(),
));
assert!(!Pair::verify(
&Keyring::Alice.sign(b"I am Alice!"),
b"I am Alice!",
&Keyring::Bob.public(),
));
}

#[test]
Expand Down