File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
- import { ethers } from "ethers"
1
+ import { ethers } from "ethers" ;
2
2
3
3
import './index.css' ;
4
4
@@ -576,4 +576,4 @@ updateAccountButton.onclick = onClickUpdateAccount
576
576
577
577
window . addEventListener ( 'DOMContentLoaded' , initialize )
578
578
579
-
579
+ module . exports = { encryptIM , decryptIM }
Original file line number Diff line number Diff line change 25
25
"@nomicfoundation/hardhat-toolbox" : " ^2.0.1" ,
26
26
"@openzeppelin/contracts" : " ^4.8.1" ,
27
27
"copy-webpack-plugin" : " ^11.0.0" ,
28
+ "crypto" : " ^1.0.1" ,
28
29
"css-loader" : " ^6.8.1" ,
29
30
"eth-sig-util" : " ^3.0.1" ,
30
31
"hardhat" : " ^2.12.7" ,
Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ describe("Hub Contract", function () {
9
9
let heir ;
10
10
let oracle ;
11
11
12
+ const privateKeys = {
13
+ Owner : Buffer . from ( '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' , 'hex' ) ,
14
+ Heir : Buffer . from ( '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d' , 'hex' ) ,
15
+ Oracle : Buffer . from ( '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a' , 'hex' ) ,
16
+ }
17
+
12
18
before ( async function ( ) {
13
19
Hub = await ethers . getContractFactory ( "Hub" ) ;
14
20
[ owner , heir , oracle ] = await ethers . getSigners ( ) ;
@@ -47,6 +53,8 @@ describe("Hub Contract", function () {
47
53
} ) ;
48
54
49
55
//1. Owner encrypts (DH with Owner + Heir): DH_O_H(IM) - EIM
56
+
57
+ alice . privateKey = Buffer . from ( 'ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' , 'hex' ) ;
50
58
//2. Owner gets Oracle public key
51
59
//3. Owner encrypts (DH with Owner + Oracle): DH_O_Or(DH_O_H(IM)) - EIM
52
60
//2. Owner sends DH_O_Or(DH_O_H(IM)) to Oracle
You can’t perform that action at this time.
0 commit comments