File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727npm run build
2828npm run tsrun
2929```
30+
31+ ## Example Output
32+
33+ ```
34+ $ npm run tsrun
35+ > wolfcrypt_binding@1.0.0 tsrun /home/davidgarske/GitHub/wolfcrypt_nodejs
36+ > npx tsc main.ts && node main.js
37+
38+ PASS
39+ ```
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ export class WolfSSLDecryptor {
5959 * process.
6060 */
6161 public finalize ( ) : Buffer {
62+ this . totalInputLength += this . totalInputLength % 16 ;
63+
6264 let outBuffer = Buffer . alloc ( this . totalInputLength )
6365
6466 let ret = wolfcrypt . EVP_CipherFinal ( this . evp , outBuffer )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ var WolfSSLDecryptor_1 = require("./WolfSSLDecryptor");
44var key = Buffer . from ( '12345678901234567890123456789012' ) ;
55var iv = Buffer . from ( '1234567890123456' ) ;
66var decrypt = new WolfSSLDecryptor_1 . WolfSSLDecryptor ( 'AES-256-CBC' , key , iv ) ;
7- var expected = 'test' ;
7+ var expected = 'test\0\0\0\0\0\0\0\0\0\0\0\0 ' ;
88var actual = Buffer . concat ( [
99 decrypt . update ( Buffer . from ( '24d31b1e41fc8c40' , 'hex' ) ) ,
1010 decrypt . update ( Buffer . from ( 'e521531d67c72c20' , 'hex' ) ) ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { WolfSSLDecryptor } from './WolfSSLDecryptor'
33const key = Buffer . from ( '12345678901234567890123456789012' )
44const iv = Buffer . from ( '1234567890123456' )
55const decrypt = new WolfSSLDecryptor ( 'AES-256-CBC' , key , iv )
6- const expected = 'test'
6+ const expected = 'test\0\0\0\0\0\0\0\0\0\0\0\0 '
77
88const actual = Buffer . concat ( [
99 decrypt . update ( Buffer . from ( '24d31b1e41fc8c40' , 'hex' ) ) ,
You can’t perform that action at this time.
0 commit comments