Skip to content

Commit

Permalink
refactor(finite_field.ts): update the 'not' function
Browse files Browse the repository at this point in the history
  • Loading branch information
ymekuria committed Nov 1, 2023
1 parent fe6d56b commit cfb9bb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crypto/finite_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ function createField(p: bigint, t: bigint, twoadicRoot: bigint) {
sizeInBits: 255,
t,
twoadicRoot,
not(x: bigint, bits: number) {
return 2n ** BigInt(bits) - (x + 1n);
},
add(x: bigint, y: bigint) {
return mod(x + y, p);
},
not(x: bigint, bits: number) {
return 2n ** BigInt(bits) - (x + 1n);
},
negate(x: bigint) {
return x === 0n ? 0n : p - x;
},
Expand Down

0 comments on commit cfb9bb7

Please sign in to comment.