1 new sjcl
.test
.TestCase("AES official known-answer tests", function (cb
) {
2 if (!sjcl
.cipher
.aes
) {
8 var i
, kat
= sjcl
.test
.vector
.aes
, tv
, len
, aes
;
10 //XXX add more vectors instead of looping
11 for (var index
= 0; index
< 8; index
++) {
12 for (i
=0; i
<kat
.length
; i
++) {
14 len
= 32 * tv
.key
.length
;
15 aes
= new sjcl
.cipher
.aes(tv
.key
);
16 this.require(sjcl
.bitArray
.equal(aes
.encrypt(tv
.pt
), tv
.ct
), "encrypt "+len
+" #"+i
);
17 this.require(sjcl
.bitArray
.equal(aes
.decrypt(tv
.ct
), tv
.pt
), "decrypt "+len
+" #"+i
);