Skip to content

Commit

Permalink
Update Ascon-128_KAT.js
Browse files Browse the repository at this point in the history
  • Loading branch information
motarekk authored Oct 3, 2023
1 parent 7d571f8 commit 5454546
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions KATs/Ascon-128_KAT.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ function ascon_128_KAT(){
try {
var ct_to_test = ascon_aead(key, nonce, ad, pt, operation, variant).toUpperCase();
} catch (error) {
console.log(`failed test: ${ascon_128_kats[i].Count}`);
console.log(`Error in test case ${ascon_128a_kats[i].Count}: ${error}`)
}

if(ct == ct_to_test){
passed += 1;
} else {
failed += 1;
console.log(`failed test: ${ascon_128_kats[i].Count}`);
}
}

Expand All @@ -52,13 +53,14 @@ function ascon_128_KAT(){
try {
var pt_to_test = ascon_aead(key, nonce, ad, ct.toLowerCase(), operation, variant).toUpperCase();
} catch (error) {
console.log(`failed test: ${ascon_128_kats[i].Count}`);
console.log(`Error in test case ${ascon_128a_kats[i].Count}: ${error}`);
}

if(pt == pt_to_test){
passed += 1;
} else {
failed += 1;
console.log(`failed test: ${ascon_128_kats[i].Count}`);
}
}

Expand Down

0 comments on commit 5454546

Please sign in to comment.