@@ -74,38 +74,44 @@ function dec(encd, pad) {
7474 * Test encryption
7575 */
7676
77- assert . equal ( enc ( ODD_LENGTH_PLAIN , true ) , ODD_LENGTH_ENCRYPTED ) ;
78- assert . equal ( enc ( EVEN_LENGTH_PLAIN , true ) , EVEN_LENGTH_ENCRYPTED ) ;
77+ assert . strictEqual ( enc ( ODD_LENGTH_PLAIN , true ) , ODD_LENGTH_ENCRYPTED ) ;
78+ assert . strictEqual ( enc ( EVEN_LENGTH_PLAIN , true ) , EVEN_LENGTH_ENCRYPTED ) ;
7979
8080assert . throws ( function ( ) {
8181 // input must have block length %
8282 enc ( ODD_LENGTH_PLAIN , false ) ;
83- } ) ;
83+ } , / d a t a n o t m u l t i p l e o f b l o c k l e n g t h / ) ;
8484
8585assert . doesNotThrow ( function ( ) {
86- assert . equal ( enc ( EVEN_LENGTH_PLAIN , false ) , EVEN_LENGTH_ENCRYPTED_NOPAD ) ;
86+ assert . strictEqual (
87+ enc ( EVEN_LENGTH_PLAIN , false ) , EVEN_LENGTH_ENCRYPTED_NOPAD
88+ ) ;
8789} ) ;
8890
8991
9092/*
9193 * Test decryption
9294 */
9395
94- assert . equal ( dec ( ODD_LENGTH_ENCRYPTED , true ) , ODD_LENGTH_PLAIN ) ;
95- assert . equal ( dec ( EVEN_LENGTH_ENCRYPTED , true ) , EVEN_LENGTH_PLAIN ) ;
96+ assert . strictEqual ( dec ( ODD_LENGTH_ENCRYPTED , true ) , ODD_LENGTH_PLAIN ) ;
97+ assert . strictEqual ( dec ( EVEN_LENGTH_ENCRYPTED , true ) , EVEN_LENGTH_PLAIN ) ;
9698
9799assert . doesNotThrow ( function ( ) {
98100 // returns including original padding
99- assert . equal ( dec ( ODD_LENGTH_ENCRYPTED , false ) . length , 32 ) ;
100- assert . equal ( dec ( EVEN_LENGTH_ENCRYPTED , false ) . length , 48 ) ;
101+ assert . strictEqual ( dec ( ODD_LENGTH_ENCRYPTED , false ) . length , 32 ) ;
102+ assert . strictEqual ( dec ( EVEN_LENGTH_ENCRYPTED , false ) . length , 48 ) ;
101103} ) ;
102104
103105assert . throws ( function ( ) {
104106 // must have at least 1 byte of padding (PKCS):
105- assert . equal ( dec ( EVEN_LENGTH_ENCRYPTED_NOPAD , true ) , EVEN_LENGTH_PLAIN ) ;
106- } ) ;
107+ assert . strictEqual (
108+ dec ( EVEN_LENGTH_ENCRYPTED_NOPAD , true ) , EVEN_LENGTH_PLAIN
109+ ) ;
110+ } , / b a d d e c r y p t / ) ;
107111
108112assert . doesNotThrow ( function ( ) {
109113 // no-pad encrypted string should return the same:
110- assert . equal ( dec ( EVEN_LENGTH_ENCRYPTED_NOPAD , false ) , EVEN_LENGTH_PLAIN ) ;
114+ assert . strictEqual (
115+ dec ( EVEN_LENGTH_ENCRYPTED_NOPAD , false ) , EVEN_LENGTH_PLAIN
116+ ) ;
111117} ) ;
0 commit comments