@@ -14,36 +14,36 @@ import { test } from '../util';
1414
1515const SUITE = 'cipher' ;
1616const ciphers = getCiphers ( ) ;
17- const key = 'secret' ;
17+ const key = randomFillSync ( new Uint8Array ( 32 ) ) ;
1818const iv = randomFillSync ( new Uint8Array ( 16 ) ) ;
1919const plaintext =
2020 '32|RmVZZkFUVmpRRkp0TmJaUm56ZU9qcnJkaXNNWVNpTTU*|iXmckfRWZBGWWELw' +
2121 'eCBsThSsfUHLeRe0KCsK8ooHgxie0zOINpXxfZi/oNG7uq9JWFVCk70gfzQH8ZUJ' +
2222 'jAfaFg**' ;
2323
24- test ( SUITE , 'cipher - valid algorithm' , async ( ) => {
24+ test ( SUITE , 'valid algorithm' , async ( ) => {
2525 expect ( ( ) => {
2626 createCipheriv ( 'aes-128-cbc' , key , iv , { } ) ;
2727 } ) . to . not . throw ( ) ;
2828} ) ;
2929
30- test ( SUITE , 'cipher - invalid algorithm' , async ( ) => {
30+ test ( SUITE , 'invalid algorithm' , async ( ) => {
3131 expect ( ( ) => {
3232 createCipheriv ( 'aes-128-boorad' , key , iv , { } ) ;
3333 } ) . to . throw ( / I n v a l i d C i p h e r A l g o r i t h m : a e s - 1 2 8 - b o o r a d / ) ;
3434} ) ;
3535
36- test ( SUITE , 'cipher - getSupportedCiphers' , async ( ) => {
36+ test ( SUITE , 'getSupportedCiphers' , async ( ) => {
3737 expect ( ciphers ) . to . be . instanceOf ( Array ) ;
3838 expect ( ciphers ) . to . have . length . greaterThan ( 0 ) ;
3939} ) ;
4040
4141// different value types
42- test ( SUITE , 'cipher - strings' , async ( ) => {
42+ test ( SUITE , 'strings' , async ( ) => {
4343 roundtrip ( 'aes-128-cbc' , '0123456789abcd0123456789' , '12345678' , plaintext ) ;
4444} ) ;
4545
46- test ( SUITE , 'cipher - buffers' , async ( ) => {
46+ test ( SUITE , 'buffers' , async ( ) => {
4747 roundtrip (
4848 'aes-128-cbc' ,
4949 Buffer . from ( '0123456789abcd0123456789' ) ,
@@ -54,7 +54,7 @@ test(SUITE, 'cipher - buffers', async () => {
5454
5555// update/final
5656ciphers . forEach ( cipherName => {
57- test ( SUITE , `cipher - non-stream - ${ cipherName } ` , async ( ) => {
57+ test ( SUITE , `non-stream - ${ cipherName } ` , async ( ) => {
5858 roundtrip ( cipherName , key , iv , plaintext ) ;
5959 } ) ;
6060} ) ;
0 commit comments