diff --git a/KATs/Ascon-128a_KAT.js b/KATs/Ascon-128a_KAT.js index 80c3f5d..74a804d 100644 --- a/KATs/Ascon-128a_KAT.js +++ b/KATs/Ascon-128a_KAT.js @@ -25,17 +25,18 @@ function ascon_128a_KAT(){ try { var ct_to_test = ascon_aead(key, nonce, ad, pt, operation, variant).toUpperCase(); } catch (error) { - console.log("failed test: "+ascon_128a_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_128a_kats[i].Count}`); } } - var print_encryption_KAT_result = "(encryption):\npassed: "+passed+"\nfailed: "+failed; + var print_encryption_KAT_result = `(encryption):\npassed: ${passed}\nfailed: ${failed}`; console.log(print_encryption_KAT_result); @@ -53,13 +54,14 @@ function ascon_128a_KAT(){ try { var pt_to_test = ascon_aead(key, nonce, ad, ct.toLowerCase(), operation, variant).toUpperCase(); } catch (error) { - console.log("failed test: "+ascon_128a_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_128a_kats[i].Count}`); } } @@ -68,8 +70,8 @@ function ascon_128a_KAT(){ note = "\n\nnote: you can view the failed tests in the console"; } - var print_decryption_KAT_result = "\n(decryption):\npassed: "+passed+"\nfailed: "+failed; + var print_decryption_KAT_result = `\n(decryption):\npassed: ${passed}\nfailed: ${failed}`; console.log(print_decryption_KAT_result); return print_title+"\n"+print_encryption_KAT_result+"\n"+print_decryption_KAT_result+note; -} \ No newline at end of file +}