summaryrefslogtreecommitdiffstats
path: root/test/ccm_arraybuffer_test.js
diff options
context:
space:
mode:
authorMarco Munizaga <marco.munizaga@ufl.edu>2013-10-26 19:19:42 -0400
committerMarco Munizaga <marco.munizaga@ufl.edu>2013-10-26 19:19:57 -0400
commit3946df7f72caac0859f34e40be7037efaa9feae8 (patch)
treeda81b4f09396610eecc45001bfe444387fb53c4a /test/ccm_arraybuffer_test.js
parent0e6166ee4418bec330fcbc356be1a8225865b02d (diff)
downloadsjcl-3946df7f72caac0859f34e40be7037efaa9feae8.zip
sjcl-3946df7f72caac0859f34e40be7037efaa9feae8.tar.gz
sjcl-3946df7f72caac0859f34e40be7037efaa9feae8.tar.bz2
updated tests
Diffstat (limited to 'test/ccm_arraybuffer_test.js')
-rw-r--r--test/ccm_arraybuffer_test.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/test/ccm_arraybuffer_test.js b/test/ccm_arraybuffer_test.js
index 4069d71..75c47bf 100644
--- a/test/ccm_arraybuffer_test.js
+++ b/test/ccm_arraybuffer_test.js
@@ -6,6 +6,9 @@ sjcl.test = {}
sjcl.test.vector = {}
require("./ccm_vectors.js")
+console.log("Running CCM using ArrayBuffer tests")
+var start_time = +(new Date())
+
//This ccm implementation is only defined for IV Lengths of 8 bytes
var applicable_tests = sjcl.test.vector.ccm.filter(function(test){
return test.iv.length === 16
@@ -27,21 +30,20 @@ applicable_tests.map(function(tv, index){
sjcl.arrayBuffer.ccm.compat_encrypt(aes, pt, iv, ad, tlen), ct
)
- console.log("Running: ",len+"-ccm-encrypt #", index, "Pass?:", pass_e)
-
pass_d = sjcl.bitArray.equal(
sjcl.arrayBuffer.ccm.compat_decrypt(aes, ct, iv, ad, tlen), pt
)
- console.log("Running: ",len+"-ccm-decrypt #", index, "Pass?:", pass_d)
-
if (!(pass_e && pass_d)){
- throw("Failed at: "+i)
+ console.log("Failed at : ",len+"-ccm #", index, "Pass?:", pass_d)
+ phantom.exit(1);
}
return pass_e && pass_d;
})
-phantom.exit()
+var total_time = parseInt(+(new Date())-start_time)
+console.log(" + passed all",applicable_tests.length,"tests. ("+ total_time, "ms)")
+phantom.exit();