Skip to content

Commit

Permalink
barrett reduction?
Browse files Browse the repository at this point in the history
  • Loading branch information
Cubelrti committed Feb 1, 2024
1 parent 53e0065 commit 628dead
Show file tree
Hide file tree
Showing 13 changed files with 2,043 additions and 23 deletions.
2 changes: 1 addition & 1 deletion benchmark/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { run, mark, utils } from 'micro-bmark';
import * as sm from 'sm-crypto'
import * as smV2 from 'sm-crypto-v2'
import * as smV2 from '../dist/index.js'

const msg = 'Hello world~!'
const longMsg = msg.repeat(10000)
Expand Down
2 changes: 1 addition & 1 deletion src/sm2/asn1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as utils from './curves/utils';
import { ONE } from './bn';
import { utf8ToHex } from './utils';
import JSBI from 'jsbi';
import JSBI from './curves/jsbi';

export function bigintToValue(bigint: JSBI) {
let h = bigint.toString(16)
Expand Down
2 changes: 1 addition & 1 deletion src/sm2/bn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import JSBI from 'jsbi';
import JSBI from './curves/jsbi';

export const ZERO = JSBI.BigInt(0);
export const ONE = JSBI.BigInt(1);
Expand Down
2 changes: 1 addition & 1 deletion src/sm2/curves/curve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Abelian group utilities
import { IField, validateField, nLength } from './modular.js';
import { validateObject } from './utils.js';
import JSBI from 'jsbi';
import JSBI from './jsbi.js';
const _0n = JSBI.BigInt(0);
const _1n = JSBI.BigInt(1);
const _2n = JSBI.BigInt(2);
Expand Down
Loading

0 comments on commit 628dead

Please sign in to comment.