diff --git a/src/shared/lib/encryption/EncryptionManager.test.ts b/src/shared/lib/encryption/EncryptionManager.test.ts index 6881e694e..a7f868780 100644 --- a/src/shared/lib/encryption/EncryptionManager.test.ts +++ b/src/shared/lib/encryption/EncryptionManager.test.ts @@ -1,4 +1,5 @@ -import { crypto } from './crypto'; +import crypto from 'crypto-browserify'; + import { EncryptionManager } from './EncryptionManager'; import { getDefaultEncryptionManager } from './encryptionManagerInstance'; import { IEncryptionManager } from './IEncryptionManager'; @@ -138,7 +139,17 @@ describe('Encryption', () => { const generatedPrivateKey = encryptionManager.getPrivateKey(userParams); - const result = [119,246,61,4,69,250,117,76,124,94,83,227,223,184,230,126,252,194,122,167,138,161,129,226,125,229,100,32,41,219,255,183,193,232,127,139,132,37,7,138,162,69,59,54,31,108,146,220,103,194,154,35,179,57,97,219,210,141,118,82,66,131,194,237,14,117,143,233,157,169,111,173,6,235,26,233,23,248,138,49,100,206,165,177,151,205,97,103,85,41,181,124,102,136,159,89,204,213,232,28,154,3,10,31,140,201,135,91,2,129,40,210,175,162,44,241,89,178,78,98,148,11,241,144,227,216,75,249] + const result = [ + 119, 246, 61, 4, 69, 250, 117, 76, 124, 94, 83, 227, 223, 184, 230, 126, + 252, 194, 122, 167, 138, 161, 129, 226, 125, 229, 100, 32, 41, 219, 255, + 183, 193, 232, 127, 139, 132, 37, 7, 138, 162, 69, 59, 54, 31, 108, 146, + 220, 103, 194, 154, 35, 179, 57, 97, 219, 210, 141, 118, 82, 66, 131, + 194, 237, 14, 117, 143, 233, 157, 169, 111, 173, 6, 235, 26, 233, 23, + 248, 138, 49, 100, 206, 165, 177, 151, 205, 97, 103, 85, 41, 181, 124, + 102, 136, 159, 89, 204, 213, 232, 28, 154, 3, 10, 31, 140, 201, 135, 91, + 2, 129, 40, 210, 175, 162, 44, 241, 89, 178, 78, 98, 148, 11, 241, 144, + 227, 216, 75, 249, + ]; expect(generatedPrivateKey).toStrictEqual(result); }); diff --git a/src/shared/lib/encryption/EncryptionManager.ts b/src/shared/lib/encryption/EncryptionManager.ts index 9b01fac1b..95dd4be65 100644 --- a/src/shared/lib/encryption/EncryptionManager.ts +++ b/src/shared/lib/encryption/EncryptionManager.ts @@ -1,6 +1,6 @@ import { Buffer } from 'buffer'; +import crypto from 'crypto-browserify'; -import { crypto } from './crypto'; import { DecryptDataProps, EncryptDataProps, diff --git a/src/shared/lib/encryption/crypto.ts b/src/shared/lib/encryption/crypto.ts deleted file mode 100644 index c7dc6e82d..000000000 --- a/src/shared/lib/encryption/crypto.ts +++ /dev/null @@ -1,3 +0,0 @@ -import crypto from 'crypto-browserify'; - -export { crypto };