File tree Expand file tree Collapse file tree 3 files changed +3
-47
lines changed
packages/ethereum-cryptography Expand file tree Collapse file tree 3 files changed +3
-47
lines changed Original file line number Diff line number Diff line change 55
55
"./ripemd160.js" : " ./pure/ripemd160.js" ,
56
56
"./secp256k1.js" : " ./pure/secp256k1.js" ,
57
57
"./sha256.js" : " ./pure/sha256.js" ,
58
- "./aes.js" : " ./pure/aes.js" ,
59
58
"./hdkey.js" : " ./pure/hdkey.js" ,
60
59
"./blake2b.js" : " ./pure/blake2b.js" ,
61
60
"./random.js" : " ./pure/random.js" ,
Original file line number Diff line number Diff line change 1
- import { createCipheriv , createDecipheriv } from "crypto" ;
1
+ const browserifyAes = require ( "browserify-aes" ) ;
2
2
3
3
function ensureAesMode ( mode : string ) {
4
4
if ( ! mode . startsWith ( "aes-" ) ) {
@@ -15,7 +15,7 @@ export function encrypt(
15
15
) : Buffer {
16
16
ensureAesMode ( mode ) ;
17
17
18
- const cipher = createCipheriv ( mode , key , iv ) ;
18
+ const cipher = browserifyAes . createCipheriv ( mode , key , iv ) ;
19
19
cipher . setAutoPadding ( pkcs7PaddingEnabled ) ;
20
20
21
21
const encrypted = cipher . update ( msg ) ;
@@ -33,7 +33,7 @@ export function decrypt(
33
33
) : Buffer {
34
34
ensureAesMode ( mode ) ;
35
35
36
- const decipher = createDecipheriv ( mode , key , iv ) ;
36
+ const decipher = browserifyAes . createDecipheriv ( mode , key , iv ) ;
37
37
decipher . setAutoPadding ( pkcs7PaddingEnabled ) ;
38
38
39
39
const encrypted = decipher . update ( cypherText ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments