Skip to content

Commit

Permalink
Turn on public key nistkat test; it's failing.
Browse files Browse the repository at this point in the history
  • Loading branch information
xvzcf committed May 29, 2024
1 parent 3a6785b commit cfbef78
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions libcrux-ml-dsa/tests/nistkats.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use serde::Deserialize;
use serde_json;

use std::path::Path;
use std::{fs::File, io::BufReader, path::Path};

use std::{fs::File, io::BufReader};
use libcrux_sha3::sha256;

#[derive(Debug, Deserialize)]
struct MlDsaNISTKAT {
#[serde(with = "hex::serde")]
key_generation_seed: [u8; 32],

#[serde(with = "hex::serde")]
sha3_256_hash_of_public_key: [u8; 32],
sha3_256_hash_of_verification_key: [u8; 32],

#[serde(with = "hex::serde")]
sha3_256_hash_of_secret_key: [u8; 32],
sha3_256_hash_of_signing_key: [u8; 32],

// The length of the message in each KAT is 33 * (i + 1), where i is the
// 0-indexed KAT counter.
Expand All @@ -24,7 +24,6 @@ struct MlDsaNISTKAT {
sha3_256_hash_of_signature: [u8; 32],
}

#[ignore]
#[test]
fn ml_dsa_65_nist_known_answer_tests() {
let katfile_path = Path::new("tests")
Expand All @@ -37,6 +36,9 @@ fn ml_dsa_65_nist_known_answer_tests() {
serde_json::from_reader(reader).expect("Could not deserialize KAT file.");

for kat in nist_kats {
let _ = libcrux_ml_dsa::ml_dsa_65::generate_key_pair(kat.key_generation_seed);
let key_pair = libcrux_ml_dsa::ml_dsa_65::generate_key_pair(kat.key_generation_seed);

let verification_key_hash = libcrux_sha3::sha256(&key_pair.verification_key);
assert_eq!(verification_key_hash, kat.sha3_256_hash_of_verification_key);
}
}

0 comments on commit cfbef78

Please sign in to comment.