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

Side by Side Diff: benchmarks/crypto.js

Issue 3300031: Recalibrate benchmarks. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 3 months 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
« no previous file with comments | « no previous file | benchmarks/deltablue.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2003-2005 Tom Wu 2 * Copyright (c) 2003-2005 Tom Wu
3 * All Rights Reserved. 3 * All Rights Reserved.
4 * 4 *
5 * Permission is hereby granted, free of charge, to any person obtaining 5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the 6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including 7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish, 8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to 9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to 10 * permit persons to whom the Software is furnished to do so, subject to
(...skipping 13 matching lines...) Expand all
24 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 24 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 * 25 *
26 * In addition, the following condition applies: 26 * In addition, the following condition applies:
27 * 27 *
28 * All redistributions must retain an intact copy of this copyright notice 28 * All redistributions must retain an intact copy of this copyright notice
29 * and disclaimer. 29 * and disclaimer.
30 */ 30 */
31 31
32 32
33 // The code has been adapted for use as a benchmark by Google. 33 // The code has been adapted for use as a benchmark by Google.
34 var Crypto = new BenchmarkSuite('Crypto', 110465, [ 34 var Crypto = new BenchmarkSuite('Crypto', 266181, [
35 new Benchmark("Encrypt", encrypt), 35 new Benchmark("Encrypt", encrypt),
36 new Benchmark("Decrypt", decrypt) 36 new Benchmark("Decrypt", decrypt)
37 ]); 37 ]);
38 38
39 39
40 // Basic JavaScript BN library - subset useful for RSA encryption. 40 // Basic JavaScript BN library - subset useful for RSA encryption.
41 41
42 // Bits per digit 42 // Bits per digit
43 var dbits; 43 var dbits;
44 var BI_DB; 44 var BI_DB;
(...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 1689
1690 function decrypt() { 1690 function decrypt() {
1691 var RSA = new RSAKey(); 1691 var RSA = new RSAKey();
1692 RSA.setPublic(nValue, eValue); 1692 RSA.setPublic(nValue, eValue);
1693 RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue); 1693 RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue);
1694 var decrypted = RSA.decrypt(encrypted); 1694 var decrypted = RSA.decrypt(encrypted);
1695 if (decrypted != TEXT) { 1695 if (decrypted != TEXT) {
1696 throw new Error("Crypto operation failed"); 1696 throw new Error("Crypto operation failed");
1697 } 1697 }
1698 } 1698 }
OLDNEW
« no previous file with comments | « no previous file | benchmarks/deltablue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698