forked from brix/crypto-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
x64-wordarray-test.js
38 lines (30 loc) · 1.26 KB
/
x64-wordarray-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
YUI.add('x64-wordarray-test', function (Y) {
var C = CryptoJS;
Y.Test.Runner.add(new Y.Test.Case({
name: 'X64WordArray',
testInit0: function () {
Y.Assert.areEqual('', C.x64.WordArray.create().toX32().toString());
},
testInit1: function () {
var wordArray = C.x64.WordArray.create([
C.x64.Word.create(0x00010203, 0x04050607),
C.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
]);
Y.Assert.areEqual('000102030405060718191a1b1c1d1e1f', wordArray.toX32().toString());
},
testInit2: function () {
var wordArray = C.x64.WordArray.create([
C.x64.Word.create(0x00010203, 0x04050607),
C.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
], 10);
Y.Assert.areEqual('00010203040506071819', wordArray.toX32().toString());
},
testToX32: function () {
var wordArray = C.x64.WordArray.create([
C.x64.Word.create(0x00010203, 0x04050607),
C.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
], 10);
Y.Assert.areEqual('00010203040506071819', wordArray.toX32().toString());
}
}));
}, '$Rev$');