@ -13,7 +13,7 @@ var h1 = crypto.createHmac('sha1', 'Node')
. update ( 'some data' )
. update ( 'to hmac' )
. digest ( 'hex' ) ;
assert . e qual( h1 , '19fd6e1ba73d9ed2224dd5094a71babe85d9a892' , 'test HMAC' ) ;
assert . strictE qual( h1 , '19fd6e1ba73d9ed2224dd5094a71babe85d9a892' , 'test HMAC' ) ;
// Test HMAC (Wikipedia Test Cases)
var wikipedia = [
@ -67,9 +67,9 @@ for (let i = 0, l = wikipedia.length; i < l; i++) {
const result = crypto . createHmac ( hash , wikipedia [ i ] [ 'key' ] )
. update ( wikipedia [ i ] [ 'data' ] )
. digest ( 'hex' ) ;
assert . e qual( wikipedia [ i ] [ 'hmac' ] [ hash ] ,
result ,
'Test HMAC-' + hash + ': Test case ' + ( i + 1 ) + ' wikipedia' ) ;
assert . strictE qual( wikipedia [ i ] [ 'hmac' ] [ hash ] ,
result ,
` Test HMAC- ${ hash } : Test case ${ i + 1 } wikipedia ` ) ;
}
}
@ -233,10 +233,10 @@ for (let i = 0, l = rfc4231.length; i < l; i++) {
result = result . substr ( 0 , 32 ) ; // first 128 bits == 32 hex chars
strRes = strRes . substr ( 0 , 32 ) ;
}
assert . e qual( rfc4231 [ i ] [ 'hmac' ] [ hash ] ,
result ,
'Test HMAC-' + hash + ': Test case ' + ( i + 1 ) + ' rfc 4231' ) ;
assert . e qual( strRes , result , 'Should get same result from stream' ) ;
assert . strictE qual( rfc4231 [ i ] [ 'hmac' ] [ hash ] ,
result ,
` Test HMAC- ${ hash } : Test case ${ i + 1 } rfc 4231 ` ) ;
assert . strictE qual( strRes , result , 'Should get same result from stream' ) ;
}
}
@ -356,7 +356,7 @@ if (!common.hasFipsCrypto) {
crypto . createHmac ( 'md5' , rfc2202_md5 [ i ] [ 'key' ] )
. update ( rfc2202_md5 [ i ] [ 'data' ] )
. digest ( 'hex' ) ,
'Test HMAC-MD5 : Test case ' + ( i + 1 ) + ' rfc 2202'
` Test HMAC-MD5 : Test case ${ i + 1 } rfc 2202 `
) ;
}
}
@ -366,6 +366,6 @@ for (let i = 0, l = rfc2202_sha1.length; i < l; i++) {
crypto . createHmac ( 'sha1' , rfc2202_sha1 [ i ] [ 'key' ] )
. update ( rfc2202_sha1 [ i ] [ 'data' ] )
. digest ( 'hex' ) ,
'Test HMAC-SHA1 : Test case ' + ( i + 1 ) + ' rfc 2202'
` Test HMAC-SHA1 : Test case ${ i + 1 } rfc 2202 `
) ;
}