summaryrefslogtreecommitdiff
path: root/frontend/gamma/tests/tests/Clipperz/Crypto/ECC.BinaryField.Value.html
Side-by-side diff
Diffstat (limited to 'frontend/gamma/tests/tests/Clipperz/Crypto/ECC.BinaryField.Value.html') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/tests/tests/Clipperz/Crypto/ECC.BinaryField.Value.html15
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/tests/tests/Clipperz/Crypto/ECC.BinaryField.Value.html b/frontend/gamma/tests/tests/Clipperz/Crypto/ECC.BinaryField.Value.html
index 885bcc4..c58cf42 100644
--- a/frontend/gamma/tests/tests/Clipperz/Crypto/ECC.BinaryField.Value.html
+++ b/frontend/gamma/tests/tests/Clipperz/Crypto/ECC.BinaryField.Value.html
@@ -1,88 +1,85 @@
<!--
Copyright 2008-2011 Clipperz Srl
-This file is part of Clipperz's Javascript Crypto Library.
-Javascript Crypto Library provides web developers with an extensive
-and efficient set of cryptographic functions. The library aims to
-obtain maximum execution speed while preserving modularity and
-reusability.
+This file is part of Clipperz Community Edition.
+Clipperz Community Edition is an online password manager.
For further information about its features and functionalities please
-refer to http://www.clipperz.com
+refer to http://www.clipperz.com.
-* Javascript Crypto Library is free software: you can redistribute
+* Clipperz Community Edition is free software: you can redistribute
it and/or modify it under the terms of the GNU Affero General Public
License as published by the Free Software Foundation, either version
3 of the License, or (at your option) any later version.
-* Javascript Crypto Library is distributed in the hope that it will
+* Clipperz Community Edition is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public
- License along with Javascript Crypto Library. If not, see
+ License along with Clipperz Community Edition. If not, see
<http://www.gnu.org/licenses/>.
-->
<html>
<head>
<script type="text/javascript" src="../../../../js/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="../../../../js/JSLog/jslog.js"></script>
<script type="text/javascript" src="../../../SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="../../../SimpleTest/test.css">
<script type='text/javascript' src='../../../../js/Clipperz/Base.js'></script>
<script type='text/javascript' src='../../../../js/Clipperz/ByteArray.js'></script>
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/BigInt.js'></script>
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/Base.js'></script>
<!--<script type='text/javascript' src='../../../../js/Clipperz/Crypto/ECC.js'></script>-->
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/ECC/BinaryField/Value.js'></script>
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/ECC/BinaryField/Point.js'></script>
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js'></script>
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/ECC/BinaryField/Curve.js'></script>
<script type='text/javascript' src='../../../../js/Clipperz/Crypto/Functions.js'></script>
</head>
<body>
<pre id="test">
<script type="text/javascript">
try {
var value_1;
var value_2;
value_1 = new Clipperz.Crypto.ECC.BinaryField.Value("a", 16);
is(value_1.asString(16), "0a");
value_1 = new Clipperz.Crypto.ECC.BinaryField.Value("ffff", 16);
is(value_1.asString(16), "ffff");
value_1 = new Clipperz.Crypto.ECC.BinaryField.Value("7fff", 16);
is(value_1.asString(16), "7fff");
is(parseInt("ffff", 16), 65535);
is(parseInt("ffffff", 16), 16777215);
is(parseInt("ffffffff", 16), 4294967295);
is(parseInt("ffffffffff", 16), 1099511627775);
is(parseInt("ffffffffffff", 16), 281474976710655);
is(parseInt("ffffffffffffff", 16), 72057594037927940);
is(parseInt("ffffffffffffffff", 16), 18446744073709552000);
is(parseInt("10000000000000000", 16), 18446744073709552001);
is(parseInt("10000000000000001", 16), 18446744073709552002);
is(parseInt("10000000000000009", 16), 18446744073709552010);
value_1 = new Clipperz.Crypto.ECC.BinaryField.Value("000108cbbacda1f03ea9360301045434ec7d82ba150936df08a229cbb4832ce1", 16);
is(value_1.wordSize(), 8, "check the number of words of a 64 char hex string using the 'wordSize' method");
// 000108cb bacda1f0 3ea93603 01045434 ec7d82ba 150936df 08a229cb b4832ce1
is(value_1.value()[0], parseInt("b4832ce1", 16), "word[0]");
is(value_1.value()[1], parseInt("08a229cb", 16), "word[1]");
is(value_1.value()[2], parseInt("150936df", 16), "word[2]");
is(value_1.value()[3], parseInt("ec7d82ba", 16), "word[3]");
is(value_1.value()[4], parseInt("01045434", 16), "word[4]");
is(value_1.value()[5], parseInt("3ea93603", 16), "word[5]");
is(value_1.value()[6], parseInt("bacda1f0", 16), "word[6]");
is(value_1.value()[7], parseInt("000108cb", 16), "word[7]");
is(value_1.asString(16), "0108cbbacda1f03ea9360301045434ec7d82ba150936df08a229cbb4832ce1", "asString(16)");