@spliterati/shamir
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -1,2 +0,2 @@ | ||
import { uint8 } from '@spliterati/uint8'; | ||
import type { uint8 } from '@spliterati/uint8'; | ||
export declare module GF2p8 { | ||
@@ -3,0 +3,0 @@ const FIELD: number; |
@@ -9,2 +9,3 @@ "use strict"; | ||
const utils_1 = __importDefault(require("@spliterati/utils")); | ||
const constant_time_js_1 = require("constant-time-js"); | ||
var GF2p8; | ||
@@ -83,12 +84,9 @@ (function (GF2p8) { | ||
const mul = (a, b) => { | ||
if (a === 0 || b === 0) { | ||
return 0; | ||
} | ||
const sum = (logTable[a] + logTable[b]) % (GF2p8.FIELD - 1); | ||
return expTable[sum]; | ||
let ret = expTable[sum]; | ||
ret = constant_time_js_1.select_ints(constant_time_js_1.compare_ints(0, a), ret, 0); | ||
ret = constant_time_js_1.select_ints(constant_time_js_1.compare_ints(0, b), ret, 0); | ||
return ret; | ||
}; | ||
const div = (a, b) => { | ||
if (a === 0) { | ||
return 0; | ||
} | ||
if (b === 0) { | ||
@@ -99,3 +97,5 @@ throw new RangeError('div zero'); | ||
const diff = ((logTable[a] - logTable[b]) + fm1) % fm1; | ||
return expTable[diff]; | ||
let ret = expTable[diff]; | ||
ret = constant_time_js_1.select_ints(constant_time_js_1.compare_ints(a, 0), ret, 0); | ||
return ret; | ||
}; | ||
@@ -102,0 +102,0 @@ class Polynomial { |
{ | ||
"name": "@spliterati/shamir", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Arbitrary-length shamir implementation", | ||
@@ -33,5 +33,6 @@ "private": false, | ||
"dependencies": { | ||
"@spliterati/uint8": "^1.0.4", | ||
"@spliterati/utils": "^0.3.0", | ||
"@types/node": "^14.14.20" | ||
"@spliterati/uint8": "^1.0.5", | ||
"@spliterati/utils": "^0.3.1", | ||
"@types/node": "^14.14.20", | ||
"constant-time-js": "https://github.com/soatok/constant-time-js.git#8e056b2" | ||
}, | ||
@@ -54,3 +55,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "69755a969f98668751e3d2e1b33362f9f24839e0" | ||
"gitHead": "cbd41342e23c810e9bc6645859ab005106612495" | ||
} |
Sorry, the diff of this file is not supported yet
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
33104
9
330
4
1
1