Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#442 RSAGenerate key length issue fix
- Loading branch information
Showing
5 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | ||
"http://www.w3.org/TR/html4/loose.dtd"> | ||
<html> | ||
<head> | ||
<title>QUnit for RSAKey genarated key length test</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | ||
<script type="text/javascript" src="jquery-1.4.2.min.js"></script> | ||
<script type="text/javascript" src="qunit.js"></script> | ||
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen" /> | ||
|
||
<script src="../ext/jsbn.js"></script> | ||
<script src="../ext/jsbn2.js"></script> | ||
<script src="../ext/prng4.js"></script> | ||
<script src="../ext/rng.js"></script> | ||
<script src="../ext/rsa.js"></script> | ||
<script src="../ext/rsa2.js"></script> | ||
|
||
<script> | ||
$(document).ready(function(){ | ||
//========================================================================= | ||
module("RSAKey.generate() Test"); | ||
|
||
test("RSAGenerate 100 generated 512bit key size check test", function() { | ||
var nbit = 512; | ||
//var nbit = 1024; | ||
//var nbit = 2048; | ||
var isCorrectLength = true; | ||
for (var i = 0; i < 100; i++) { | ||
var key = new RSAKey(); | ||
key.generate(nbit, '10001'); | ||
if (key.n.bitLength() != nbit) isCorrectLength = false; | ||
} | ||
equal(isCorrectLength, true, "all 100 keys are " + nbit + "bit length"); | ||
}); | ||
|
||
}); | ||
</script> | ||
|
||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture">test markup</div> | ||
|
||
<p> | ||
<a href="../">TOP</a> | | ||
<a href="index.html">TEST INDEX</a> | | ||
</p> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -494,6 +494,5 @@ | |
</p> | ||
|
||
</body> | ||
<center><p>© 2010-2017 Kenji Urushima</p></center> | ||
</html> | ||
|