@@ -5,30 +5,37 @@ import { deepStrictEqual } from "./assert";
5
5
const TEST_VECTORS = [
6
6
{
7
7
input : utf8ToBytes ( "" ) ,
8
- output : "cf83e1357eefb8bd f1542850d66d8007 d620e4050b5715dc 83f4a921d36ce9ce 47d0d13c5d85f2b0 ff8318d2877eec2f 63b931bd47417a81 a538327af927da3e"
8
+ output :
9
+ "cf83e1357eefb8bd f1542850d66d8007 d620e4050b5715dc 83f4a921d36ce9ce 47d0d13c5d85f2b0 ff8318d2877eec2f 63b931bd47417a81 a538327af927da3e"
9
10
} ,
10
11
{
11
12
input : utf8ToBytes ( "abc" ) ,
12
- output : "ddaf35a193617aba cc417349ae204131 12e6fa4e89a97ea2 0a9eeee64b55d39a 2192992a274fc1a8 36ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"
13
+ output :
14
+ "ddaf35a193617aba cc417349ae204131 12e6fa4e89a97ea2 0a9eeee64b55d39a 2192992a274fc1a8 36ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"
13
15
} ,
14
16
{
15
17
input : utf8ToBytes (
16
18
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"
17
19
) ,
18
- output : "204a8fc6dda82f0a 0ced7beb8e08a416 57c16ef468b228a8 279be331a703c335 96fd15c13b1b07f9 aa1d3bea57789ca0 31ad85c7a71dd703 54ec631238ca3445"
20
+ output :
21
+ "204a8fc6dda82f0a 0ced7beb8e08a416 57c16ef468b228a8 279be331a703c335 96fd15c13b1b07f9 aa1d3bea57789ca0 31ad85c7a71dd703 54ec631238ca3445"
19
22
} ,
20
23
{
21
24
input : utf8ToBytes (
22
25
"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"
23
26
) ,
24
- output : "8e959b75dae313da 8cf4f72814fc143f 8f7779c6eb9f7fa1 7299aeadb6889018 501d289e4900f7e4 331b99dec4b5433a c7d329eeb6dd2654 5e96e55b874be909"
27
+ output :
28
+ "8e959b75dae313da 8cf4f72814fc143f 8f7779c6eb9f7fa1 7299aeadb6889018 501d289e4900f7e4 331b99dec4b5433a c7d329eeb6dd2654 5e96e55b874be909"
25
29
}
26
30
] ;
27
31
28
32
describe ( "sha512" , function ( ) {
29
33
for ( const [ i , vector ] of TEST_VECTORS . entries ( ) ) {
30
34
it ( `Should return the right hash for the test ${ i } ` , async function ( ) {
31
- deepStrictEqual ( toHex ( sha512 ( vector . input ) ) , vector . output . replace ( / / g, '' ) ) ;
35
+ deepStrictEqual (
36
+ toHex ( sha512 ( vector . input ) ) ,
37
+ vector . output . replace ( / / g, "" )
38
+ ) ;
32
39
} ) ;
33
40
}
34
41
} ) ;
0 commit comments