Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: chrome/test/data/third_party/kraken/tests/kraken-1.1/stanford-crypto-aes.js

Issue 11348021: Automate Kraken benchmark with Chrome Remote Control. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 new sjcl.test.TestCase("AES official known-answer tests", function (cb) {
2 if (!sjcl.cipher.aes) {
3 this.unimplemented();
4 cb && cb();
5 return;
6 }
7
8 var i, kat = sjcl.test.vector.aes, tv, len, aes;
9
10 //XXX add more vectors instead of looping
11 for (var index = 0; index < 8; index++) {
12 for (i=0; i<kat.length; i++) {
13 tv = kat[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);
18 }
19 }
20 cb && cb();
21 });
22
23 sjcl.test.run();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698