@@ -8,7 +8,6 @@ const assert = require('assert');
88const crypto = require ( 'crypto' ) ;
99const fs = require ( 'fs' ) ;
1010
11- const { hasOpenSSL } = require ( '../common/crypto' ) ;
1211const fixtures = require ( '../common/fixtures' ) ;
1312
1413let cryptoType ;
@@ -184,21 +183,19 @@ assert.throws(
184183
185184// Test XOF hash functions and the outputLength option.
186185{
187- // Default outputLengths. Since OpenSSL 3.4 an outputLength is mandatory
188- if ( ! hasOpenSSL ( 3 , 4 ) ) {
189- assert . strictEqual ( crypto . createHash ( 'shake128' ) . digest ( 'hex' ) ,
190- '7f9c2ba4e88f827d616045507605853e' ) ;
191- assert . strictEqual ( crypto . createHash ( 'shake128' , null ) . digest ( 'hex' ) ,
192- '7f9c2ba4e88f827d616045507605853e' ) ;
193- assert . strictEqual ( crypto . createHash ( 'shake256' ) . digest ( 'hex' ) ,
194- '46b9dd2b0ba88d13233b3feb743eeb24' +
195- '3fcd52ea62b81b82b50c27646ed5762f' ) ;
196- assert . strictEqual ( crypto . createHash ( 'shake256' , { outputLength : 0 } )
197- . copy ( ) // Default outputLength.
198- . digest ( 'hex' ) ,
199- '46b9dd2b0ba88d13233b3feb743eeb24' +
200- '3fcd52ea62b81b82b50c27646ed5762f' ) ;
201- }
186+ // Default outputLengths.
187+ assert . strictEqual ( crypto . createHash ( 'shake128' ) . digest ( 'hex' ) ,
188+ '7f9c2ba4e88f827d616045507605853e' ) ;
189+ assert . strictEqual ( crypto . createHash ( 'shake128' , null ) . digest ( 'hex' ) ,
190+ '7f9c2ba4e88f827d616045507605853e' ) ;
191+ assert . strictEqual ( crypto . createHash ( 'shake256' ) . digest ( 'hex' ) ,
192+ '46b9dd2b0ba88d13233b3feb743eeb24' +
193+ '3fcd52ea62b81b82b50c27646ed5762f' ) ;
194+ assert . strictEqual ( crypto . createHash ( 'shake256' , { outputLength : 0 } )
195+ . copy ( ) // Default outputLength.
196+ . digest ( 'hex' ) ,
197+ '46b9dd2b0ba88d13233b3feb743eeb24' +
198+ '3fcd52ea62b81b82b50c27646ed5762f' ) ;
202199
203200 // Short outputLengths.
204201 assert . strictEqual ( crypto . createHash ( 'shake128' , { outputLength : 0 } )
0 commit comments