Skip to content

Commit 8e15a1a

Browse files
committed
remmoved encrypt function from index file
2 parents 5eaa3e4 + aff2311 commit 8e15a1a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

dapps/ui/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ethers } from "ethers"
1+
import { ethers } from "ethers";
22

33
import './index.css';
44

@@ -576,4 +576,4 @@ updateAccountButton.onclick = onClickUpdateAccount
576576

577577
window.addEventListener('DOMContentLoaded', initialize)
578578

579-
579+
module.exports = {encryptIM, decryptIM}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@nomicfoundation/hardhat-toolbox": "^2.0.1",
2626
"@openzeppelin/contracts": "^4.8.1",
2727
"copy-webpack-plugin": "^11.0.0",
28+
"crypto": "^1.0.1",
2829
"css-loader": "^6.8.1",
2930
"eth-sig-util": "^3.0.1",
3031
"hardhat": "^2.12.7",

test/hub/hub.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ describe("Hub Contract", function () {
99
let heir;
1010
let oracle;
1111

12+
const privateKeys = {
13+
Owner: Buffer.from('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex'),
14+
Heir: Buffer.from('0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', 'hex'),
15+
Oracle: Buffer.from('0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a', 'hex'),
16+
}
17+
1218
before(async function () {
1319
Hub = await ethers.getContractFactory("Hub");
1420
[owner, heir, oracle] = await ethers.getSigners();
@@ -47,6 +53,8 @@ describe("Hub Contract", function () {
4753
});
4854

4955
//1. Owner encrypts (DH with Owner + Heir): DH_O_H(IM) - EIM
56+
57+
alice.privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', 'hex');
5058
//2. Owner gets Oracle public key
5159
//3. Owner encrypts (DH with Owner + Oracle): DH_O_Or(DH_O_H(IM)) - EIM
5260
//2. Owner sends DH_O_Or(DH_O_H(IM)) to Oracle

0 commit comments

Comments
 (0)