@@ -22,10 +22,10 @@ const xsalsa20_encrypt_decrypt: BenchFn = () => {
2222 if ( encrypted . length !== data . length ) {
2323 throw new Error ( 'Encryption failed: output size mismatch' ) ;
2424 }
25-
25+
2626 // Decrypt by applying XSalsa20 again
2727 const decrypted = rnqc . xsalsa20 ( key , nonce , encrypted ) ;
28-
28+
2929 // Verify decryption worked correctly
3030 for ( let i = 0 ; i < data . length ; i ++ ) {
3131 if ( data [ i ] !== decrypted [ i ] ) {
@@ -40,10 +40,10 @@ const xsalsa20_encrypt_decrypt: BenchFn = () => {
4040 if ( encrypted . length !== data . length ) {
4141 throw new Error ( 'Encryption failed: output size mismatch' ) ;
4242 }
43-
43+
4444 // Decrypt
4545 const decrypted = nobleXSalsa20 ( key , nonce , encrypted ) ;
46-
46+
4747 // Verify
4848 for ( let i = 0 ; i < data . length ; i ++ ) {
4949 if ( data [ i ] !== decrypted [ i ] ) {
@@ -71,17 +71,17 @@ const xsalsa20_encrypt_decrypt_large: BenchFn = () => {
7171 if ( encrypted . length !== largeData . length ) {
7272 throw new Error ( 'Encryption failed: output size mismatch' ) ;
7373 }
74-
74+
7575 // Decrypt
7676 const decrypted = rnqc . xsalsa20 ( key , nonce , encrypted ) ;
77-
77+
7878 // Verify (checking first and last 100 bytes for performance)
7979 for ( let i = 0 ; i < 100 ; i ++ ) {
8080 if ( largeData [ i ] !== decrypted [ i ] ) {
8181 throw new Error ( `Decryption verification failed at start index ${ i } ` ) ;
8282 }
8383 }
84-
84+
8585 for ( let i = largeData . length - 100 ; i < largeData . length ; i ++ ) {
8686 if ( largeData [ i ] !== decrypted [ i ] ) {
8787 throw new Error ( `Decryption verification failed at end index ${ i } ` ) ;
@@ -95,17 +95,17 @@ const xsalsa20_encrypt_decrypt_large: BenchFn = () => {
9595 if ( encrypted . length !== largeData . length ) {
9696 throw new Error ( 'Encryption failed: output size mismatch' ) ;
9797 }
98-
98+
9999 // Decrypt
100100 const decrypted = nobleXSalsa20 ( key , nonce , encrypted ) ;
101-
101+
102102 // Verify (checking first and last 100 bytes for performance)
103103 for ( let i = 0 ; i < 100 ; i ++ ) {
104104 if ( largeData [ i ] !== decrypted [ i ] ) {
105105 throw new Error ( `Decryption verification failed at start index ${ i } ` ) ;
106106 }
107107 }
108-
108+
109109 for ( let i = largeData . length - 100 ; i < largeData . length ; i ++ ) {
110110 if ( largeData [ i ] !== decrypted [ i ] ) {
111111 throw new Error ( `Decryption verification failed at end index ${ i } ` ) ;
0 commit comments