Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDonavon committed Aug 24, 2023
1 parent 88298e5 commit 19fa3be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/algorithms/MontgomeryMultiplication.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ALEO_FIELD_MODULUS } from "../params/AleoConstants";
import { FIELD_MODULUS } from "../params/BLS12_377Constants";
import { Montgomery } from "./MontgomeryMultiplication";

describe('Montgomery', () => {
it.each([
[BigInt(8), BigInt(7), BigInt(56)],
[ALEO_FIELD_MODULUS, BigInt(0), BigInt(0)],
[ALEO_FIELD_MODULUS, BigInt(2), BigInt(0)],
[ALEO_FIELD_MODULUS, ALEO_FIELD_MODULUS, BigInt(0)],
[ALEO_FIELD_MODULUS + BigInt(2), BigInt(2), BigInt(4)],
[FIELD_MODULUS, BigInt(0), BigInt(0)],
[FIELD_MODULUS, BigInt(2), BigInt(0)],
[FIELD_MODULUS, FIELD_MODULUS, BigInt(0)],
[FIELD_MODULUS + BigInt(2), BigInt(2), BigInt(4)],
])('properly does modulus multiplication', (a: bigint, b: bigint, expected: bigint) => {
const result = Montgomery(a, b);
expect(result).toEqual(expected);
Expand Down
10 changes: 5 additions & 5 deletions src/algorithms/MontgomeryMultiplication.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
ALEO_FIELD_MODULUS as N,
ALEO_MONTGOMERY_RADIX as R,
ALEO_MONTGOMERY_RINVERSE as R_PRIME,
ALEO_FIELD_MODULUS_NPRIME as N_PRIME
} from "../params/AleoConstants";
FIELD_MODULUS as N,
MONTGOMERY_RADIX as R,
MONTGOMERY_RINVERSE as R_PRIME,
FIELD_MODULUS_NPRIME as N_PRIME
} from "../params/BLS12_377Constants";

/**
* Computes a x b mod AleoFieldModulus using Montgomery multiplication.
Expand Down

0 comments on commit 19fa3be

Please sign in to comment.