@@ -372,15 +372,13 @@ if (!common.hasFipsCrypto) {
372
372
const a0 = crypto . createHash ( 'md5' ) . update ( 'Test123' ) . digest ( 'latin1' ) ;
373
373
assert . strictEqual (
374
374
a0 ,
375
- 'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca\u00bd\u008c' ,
376
- 'Test MD5 as latin1'
375
+ 'h\u00ea\u00cb\u0097\u00d8o\fF!\u00fa+\u000e\u0017\u00ca\u00bd\u008c'
377
376
) ;
378
377
}
379
378
380
- assert . strictEqual ( a1 , '8308651804facb7b9af8ffc53a33a22d6a1c8ac2' , 'Test SHA1' ) ;
379
+ assert . strictEqual ( a1 , '8308651804facb7b9af8ffc53a33a22d6a1c8ac2' ) ;
381
380
382
- assert . strictEqual ( a2 , '2bX1jws4GYKTlxhloUB09Z66PoJZW+y+hq5R8dnx9l4=' ,
383
- 'Test SHA256 as base64' ) ;
381
+ assert . strictEqual ( a2 , '2bX1jws4GYKTlxhloUB09Z66PoJZW+y+hq5R8dnx9l4=' ) ;
384
382
385
383
assert . strictEqual (
386
384
a3 ,
@@ -394,14 +392,13 @@ assert.strictEqual(
394
392
395
393
assert . deepStrictEqual (
396
394
a4 ,
397
- Buffer . from ( '8308651804facb7b9af8ffc53a33a22d6a1c8ac2' , 'hex' ) ,
398
- 'Test SHA1'
395
+ Buffer . from ( '8308651804facb7b9af8ffc53a33a22d6a1c8ac2' , 'hex' )
399
396
) ;
400
397
401
398
// Test multiple updates to same hash
402
399
const h1 = crypto . createHash ( 'sha1' ) . update ( 'Test123' ) . digest ( 'hex' ) ;
403
400
const h2 = crypto . createHash ( 'sha1' ) . update ( 'Test' ) . update ( '123' ) . digest ( 'hex' ) ;
404
- assert . strictEqual ( h1 , h2 , 'multipled updates' ) ;
401
+ assert . strictEqual ( h1 , h2 ) ;
405
402
406
403
// Test hashing for binary files
407
404
const fn = fixtures . path ( 'sample.png' ) ;
@@ -413,8 +410,7 @@ fileStream.on('data', function(data) {
413
410
fileStream . on ( 'close' , common . mustCall ( function ( ) {
414
411
assert . strictEqual (
415
412
sha1Hash . digest ( 'hex' ) ,
416
- '22723e553129a336ad96e10f6aecdf0f45e4149e' ,
417
- 'Test SHA1 of sample.png'
413
+ '22723e553129a336ad96e10f6aecdf0f45e4149e'
418
414
) ;
419
415
} ) ) ;
420
416
@@ -431,7 +427,7 @@ const s1Verified = crypto.createVerify('SHA1')
431
427
. update ( 'Test' )
432
428
. update ( '123' )
433
429
. verify ( certPem , s1 , 'base64' ) ;
434
- assert . strictEqual ( s1Verified , true , 'sign and verify (base 64)' ) ;
430
+ assert . strictEqual ( s1Verified , true ) ;
435
431
436
432
const s2 = crypto . createSign ( 'SHA256' )
437
433
. update ( 'Test123' )
@@ -440,7 +436,7 @@ const s2Verified = crypto.createVerify('SHA256')
440
436
. update ( 'Test' )
441
437
. update ( '123' )
442
438
. verify ( certPem , s2 ) ; // binary
443
- assert . strictEqual ( s2Verified , true , 'sign and verify (binary)' ) ;
439
+ assert . strictEqual ( s2Verified , true ) ;
444
440
445
441
const s3 = crypto . createSign ( 'SHA1' )
446
442
. update ( 'Test123' )
@@ -449,7 +445,7 @@ const s3Verified = crypto.createVerify('SHA1')
449
445
. update ( 'Test' )
450
446
. update ( '123' )
451
447
. verify ( certPem , s3 ) ;
452
- assert . strictEqual ( s3Verified , true , 'sign and verify (buffer)' ) ;
448
+ assert . strictEqual ( s3Verified , true ) ;
453
449
454
450
455
451
function testCipher1 ( key ) {
@@ -467,7 +463,7 @@ function testCipher1(key) {
467
463
let txt = decipher . update ( ciph , 'hex' , 'utf8' ) ;
468
464
txt += decipher . final ( 'utf8' ) ;
469
465
470
- assert . strictEqual ( txt , plaintext , 'encryption and decryption' ) ;
466
+ assert . strictEqual ( txt , plaintext ) ;
471
467
}
472
468
473
469
@@ -489,7 +485,7 @@ function testCipher2(key) {
489
485
let txt = decipher . update ( ciph , 'base64' , 'utf8' ) ;
490
486
txt += decipher . final ( 'utf8' ) ;
491
487
492
- assert . strictEqual ( txt , plaintext , 'encryption and decryption with Base64' ) ;
488
+ assert . strictEqual ( txt , plaintext ) ;
493
489
}
494
490
495
491
@@ -507,8 +503,7 @@ function testCipher3(key, iv) {
507
503
let txt = decipher . update ( ciph , 'hex' , 'utf8' ) ;
508
504
txt += decipher . final ( 'utf8' ) ;
509
505
510
- assert . strictEqual ( txt , plaintext ,
511
- 'encryption and decryption with key and iv' ) ;
506
+ assert . strictEqual ( txt , plaintext ) ;
512
507
}
513
508
514
509
@@ -526,8 +521,7 @@ function testCipher4(key, iv) {
526
521
let txt = decipher . update ( ciph , 'buffer' , 'utf8' ) ;
527
522
txt += decipher . final ( 'utf8' ) ;
528
523
529
- assert . strictEqual ( txt , plaintext ,
530
- 'encryption and decryption with key and iv' ) ;
524
+ assert . strictEqual ( txt , plaintext ) ;
531
525
}
532
526
533
527
@@ -545,8 +539,7 @@ function testCipher5(key, iv) {
545
539
let txt = decipher . update ( ciph , 'buffer' , 'utf8' ) ;
546
540
txt += decipher . final ( 'utf8' ) ;
547
541
548
- assert . strictEqual ( txt , plaintext ,
549
- 'encryption and decryption with key' ) ;
542
+ assert . strictEqual ( txt , plaintext ) ;
550
543
}
551
544
552
545
if ( ! common . hasFipsCrypto ) {
0 commit comments