Skip to content

Commit

Permalink
chore/removing crypto import file and import directly on components, …
Browse files Browse the repository at this point in the history
…fixing test and eslint fix
  • Loading branch information
Felipe Imperio authored and Felipe Imperio committed Oct 11, 2024
1 parent 1901a6d commit 0ae9c3f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
15 changes: 13 additions & 2 deletions src/shared/lib/encryption/EncryptionManager.test.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion src/shared/lib/encryption/EncryptionManager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Buffer } from 'buffer';
import crypto from 'crypto-browserify';

import { crypto } from './crypto';
import {
DecryptDataProps,
EncryptDataProps,
Expand Down
3 changes: 0 additions & 3 deletions src/shared/lib/encryption/crypto.ts

This file was deleted.

0 comments on commit 0ae9c3f

Please sign in to comment.