From 8ce0b05484040b038f85b6315b5811bd5fc4c327 Mon Sep 17 00:00:00 2001 From: Johannes Date: Thu, 8 Dec 2022 15:24:03 +0100 Subject: [PATCH] dir changes --- src/App.tsx | 3 --- src/cdm.ts | 2 +- src/curve/{EDDSA => }/EC.test.ts | 4 ++-- src/curve/{EDDSA => }/EC.ts | 2 +- src/curve/EDDSA/keyGeneration.test.ts | 2 +- src/curve/EDDSA/keyGeneration.ts | 2 +- src/curve/EDDSA/signature.test.ts | 2 +- src/curve/EDDSA/signature.ts | 4 ++-- src/curve/curvesDefined.ts | 1 + 9 files changed, 10 insertions(+), 12 deletions(-) rename src/curve/{EDDSA => }/EC.test.ts (96%) rename src/curve/{EDDSA => }/EC.ts (99%) diff --git a/src/App.tsx b/src/App.tsx index 455ee96..09cee82 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -4,9 +4,6 @@ import { secp256k1 } from "./curve/curvesDefined"; import Header from "./frontend/Header"; import Menu from "./frontend/Menu"; import Keys from "./frontend/Keys"; -import { EC, Point } from "./curve/EDDSA/EC"; -import Signature, { signature } from "./curve/EDDSA/signature"; -import { BN } from "bn.js"; const bob = new KeySet(secp256k1); const alice = new KeySet(secp256k1); diff --git a/src/cdm.ts b/src/cdm.ts index a534732..75223df 100644 --- a/src/cdm.ts +++ b/src/cdm.ts @@ -1,4 +1,4 @@ -import { EC } from './curve/EDDSA/EC'; +import { EC } from './curve/EC'; import KeySet from "./curve/EDDSA/keyGeneration"; import Signature from "./curve/EDDSA/signature"; import { secp256k1 } from './curve/curvesDefined'; diff --git a/src/curve/EDDSA/EC.test.ts b/src/curve/EC.test.ts similarity index 96% rename from src/curve/EDDSA/EC.test.ts rename to src/curve/EC.test.ts index 705cfa7..2945b42 100644 --- a/src/curve/EDDSA/EC.test.ts +++ b/src/curve/EC.test.ts @@ -1,7 +1,7 @@ import { EC } from "./EC"; import { BN } from "bn.js"; -import { secp256k1 } from "../curvesDefined"; -import KeySet from "./keyGeneration"; +import { secp256k1 } from "./curvesDefined"; +import KeySet from "./EDDSA/keyGeneration"; describe("EC", () => { const ec = new EC(secp256k1); diff --git a/src/curve/EDDSA/EC.ts b/src/curve/EC.ts similarity index 99% rename from src/curve/EDDSA/EC.ts rename to src/curve/EC.ts index 2463cf8..537fd0e 100644 --- a/src/curve/EDDSA/EC.ts +++ b/src/curve/EC.ts @@ -1,5 +1,5 @@ import BN from "bn.js"; -import { curveOpt } from "../curvesDefined"; +import { curveOpt } from "./curvesDefined"; export interface Point { x: BN; diff --git a/src/curve/EDDSA/keyGeneration.test.ts b/src/curve/EDDSA/keyGeneration.test.ts index 9a1b183..4b3f34c 100644 --- a/src/curve/EDDSA/keyGeneration.test.ts +++ b/src/curve/EDDSA/keyGeneration.test.ts @@ -1,4 +1,4 @@ -import { EC } from "./EC"; +import { EC } from "../EC"; import KeySet from "./keyGeneration"; import { secp256k1 } from "../curvesDefined"; import { BN } from "bn.js"; diff --git a/src/curve/EDDSA/keyGeneration.ts b/src/curve/EDDSA/keyGeneration.ts index ef2ce5e..958779f 100644 --- a/src/curve/EDDSA/keyGeneration.ts +++ b/src/curve/EDDSA/keyGeneration.ts @@ -1,6 +1,6 @@ import BN from "bn.js"; import { randomBytes } from "crypto"; -import { EC } from "./EC"; +import { EC } from "../EC"; import { curveOpt } from "../curvesDefined"; /** diff --git a/src/curve/EDDSA/signature.test.ts b/src/curve/EDDSA/signature.test.ts index 8d0a51c..2ee07ce 100644 --- a/src/curve/EDDSA/signature.test.ts +++ b/src/curve/EDDSA/signature.test.ts @@ -1,5 +1,5 @@ import { secp256k1 } from "../curvesDefined"; -import { EC } from "./EC"; +import { EC } from "../EC"; import Signature, { signature } from "./signature"; import KeySet from "./keyGeneration"; import BN from "bn.js"; diff --git a/src/curve/EDDSA/signature.ts b/src/curve/EDDSA/signature.ts index 41efb4e..f56a858 100644 --- a/src/curve/EDDSA/signature.ts +++ b/src/curve/EDDSA/signature.ts @@ -1,7 +1,7 @@ import BN from "bn.js"; import { randomBytes } from "crypto"; -import { Point } from "./EC"; -import { EC } from "./EC"; +import { Point } from "../EC"; +import { EC } from "../EC"; import { hashMsgSHA256 } from "../../util"; export interface signature { diff --git a/src/curve/curvesDefined.ts b/src/curve/curvesDefined.ts index 5853900..6571ad3 100644 --- a/src/curve/curvesDefined.ts +++ b/src/curve/curvesDefined.ts @@ -1,4 +1,5 @@ import { sha256 } from "hash.js"; + export interface curveOpt { name: string; // Name of the curve prime: string; // modulo prime number p