File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -118,10 +118,7 @@ export class Xchacha20poly1305Ietf {
118118
119119 const cipher = xchacha20poly1305 ( key , nonce , additionalAuthenticatedData ) ;
120120
121- let ciphertext : Uint8Array = new Uint8Array ( message . length + 16 ) ;
122- ciphertext = cipher . encrypt ( message , ciphertext ) ;
123-
124- return ciphertext ;
121+ return cipher . encrypt ( message ) ;
125122 }
126123
127124 public static async decrypt (
@@ -133,9 +130,6 @@ export class Xchacha20poly1305Ietf {
133130
134131 const cipher = xchacha20poly1305 ( key , nonce , additionalAuthenticatedData ) ;
135132
136- let plaintext : Uint8Array = new Uint8Array ( ciphertext . length - 16 ) ;
137- plaintext = cipher . decrypt ( ciphertext , plaintext ) ;
138-
139- return plaintext ;
133+ return cipher . decrypt ( ciphertext ) ;
140134 }
141135}
You can’t perform that action at this time.
0 commit comments