@iden3/js-crypto
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -26,3 +26,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.exp = exports.mulScalar = exports.F1Field = void 0; | ||
exports.F1Field = void 0; | ||
exports.mulScalar = mulScalar; | ||
exports.exp = exp; | ||
const Scalar = __importStar(require("./scalar")); | ||
@@ -297,7 +299,7 @@ const random_1 = require("./random"); | ||
} | ||
// Pases a buffer with Little Endian Representation | ||
// Passes a buffer with Little Endian Representation | ||
fromRprLE(buff, o) { | ||
return Scalar.fromRprLE(buff, o, this.n8); | ||
} | ||
// Pases a buffer with Big Endian Representation | ||
// Passes a buffer with Big Endian Representation | ||
fromRprBE(buff, o) { | ||
@@ -377,3 +379,3 @@ return Scalar.fromRprBE(buff, o, this.n8); | ||
else { | ||
throw new Error('invlaud NAF'); | ||
throw new Error('invalid NAF'); | ||
} | ||
@@ -391,3 +393,2 @@ for (let i = n.length - 2; i >= 0; i--) { | ||
} | ||
exports.mulScalar = mulScalar; | ||
function exp(F, base, e) { | ||
@@ -408,3 +409,2 @@ if (Scalar.isZero(e)) | ||
} | ||
exports.exp = exp; | ||
//# sourceMappingURL=f1field.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getRandomBytes = void 0; | ||
exports.getRandomBytes = getRandomBytes; | ||
function getRandomBytes(length) { | ||
@@ -22,3 +22,2 @@ if (length <= 0) { | ||
} | ||
exports.getRandomBytes = getRandomBytes; | ||
//# sourceMappingURL=random.js.map |
@@ -216,3 +216,3 @@ "use strict"; | ||
exports.toRprBE = toRprBE; | ||
// Pases a buffer with Little Endian Representation | ||
// Passes a buffer with Little Endian Representation | ||
const fromRprLE = (buff, o, n8) => { | ||
@@ -227,3 +227,3 @@ n8 = n8 || buff.byteLength; | ||
exports.fromRprLE = fromRprLE; | ||
// Pases a buffer with Big Endian Representation | ||
// Passes a buffer with Big Endian Representation | ||
const fromRprBE = (buff, o, n8) => { | ||
@@ -230,0 +230,0 @@ n8 = n8 || buff.byteLength; |
@@ -26,3 +26,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.leInt2Buff = exports.leBuff2int = exports.beInt2Buff = exports.beBuff2int = exports.unstringifyBigInts = void 0; | ||
exports.unstringifyBigInts = unstringifyBigInts; | ||
exports.beBuff2int = beBuff2int; | ||
exports.beInt2Buff = beInt2Buff; | ||
exports.leBuff2int = leBuff2int; | ||
exports.leInt2Buff = leInt2Buff; | ||
const Scalar = __importStar(require("./scalar")); | ||
@@ -45,3 +49,2 @@ function unstringifyBigInts(o) { | ||
} | ||
exports.unstringifyBigInts = unstringifyBigInts; | ||
function beBuff2int(buff) { | ||
@@ -71,3 +74,2 @@ let res = BigInt(0); | ||
} | ||
exports.beBuff2int = beBuff2int; | ||
function beInt2Buff(n, len) { | ||
@@ -100,3 +102,2 @@ let r = n; | ||
} | ||
exports.beInt2Buff = beInt2Buff; | ||
function leBuff2int(buff) { | ||
@@ -122,3 +123,2 @@ let res = BigInt(0); | ||
} | ||
exports.leBuff2int = leBuff2int; | ||
function leInt2Buff(n, len) { | ||
@@ -156,3 +156,2 @@ let r = n; | ||
} | ||
exports.leInt2Buff = leInt2Buff; | ||
//# sourceMappingURL=utils.js.map |
@@ -22,2 +22,5 @@ "use strict"; | ||
} | ||
if (inputs.some((i) => i < 0 || i >= F.p)) { | ||
throw new Error(`One or more inputs are not in the field: ${F.p}`); | ||
} | ||
const t = inputs.length + 1; | ||
@@ -24,0 +27,0 @@ const nRoundsF = N_ROUNDS_F; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sha256 = exports.Hash = void 0; | ||
exports.Hash = void 0; | ||
exports.sha256 = sha256; | ||
// SHA-256 for JavaScript. | ||
@@ -217,3 +218,2 @@ // Original implementation https://github.com/dchest/fast-sha256-js/blob/master/src/sha256.ts | ||
} | ||
exports.sha256 = sha256; | ||
//# sourceMappingURL=sha256.js.map |
@@ -270,7 +270,7 @@ import * as Scalar from './scalar'; | ||
} | ||
// Pases a buffer with Little Endian Representation | ||
// Passes a buffer with Little Endian Representation | ||
fromRprLE(buff, o) { | ||
return Scalar.fromRprLE(buff, o, this.n8); | ||
} | ||
// Pases a buffer with Big Endian Representation | ||
// Passes a buffer with Big Endian Representation | ||
fromRprBE(buff, o) { | ||
@@ -349,3 +349,3 @@ return Scalar.fromRprBE(buff, o, this.n8); | ||
else { | ||
throw new Error('invlaud NAF'); | ||
throw new Error('invalid NAF'); | ||
} | ||
@@ -352,0 +352,0 @@ for (let i = n.length - 2; i >= 0; i--) { |
@@ -178,3 +178,3 @@ const hexLen = [0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4]; | ||
}; | ||
// Pases a buffer with Little Endian Representation | ||
// Passes a buffer with Little Endian Representation | ||
export const fromRprLE = (buff, o, n8) => { | ||
@@ -188,3 +188,3 @@ n8 = n8 || buff.byteLength; | ||
}; | ||
// Pases a buffer with Big Endian Representation | ||
// Passes a buffer with Big Endian Representation | ||
export const fromRprBE = (buff, o, n8) => { | ||
@@ -191,0 +191,0 @@ n8 = n8 || buff.byteLength; |
@@ -16,2 +16,5 @@ import { F1Field, Scalar, utils } from '../ff'; | ||
} | ||
if (inputs.some((i) => i < 0 || i >= F.p)) { | ||
throw new Error(`One or more inputs are not in the field: ${F.p}`); | ||
} | ||
const t = inputs.length + 1; | ||
@@ -18,0 +21,0 @@ const nRoundsF = N_ROUNDS_F; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
export declare class Hex { | ||
@@ -3,0 +2,0 @@ static readonly HEX_TABLE = "0123456789abcdef"; |
{ | ||
"name": "@iden3/js-crypto", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Crypto primitives for iden3", | ||
@@ -29,4 +29,6 @@ "source": "./src/index.ts", | ||
"test": "jest", | ||
"lint": "eslint --fix --ext .js,.ts src/**", | ||
"format": "prettier --config .prettierrc './**/*.ts' --write" | ||
"lint": "eslint --fix --ext .js,.ts src/** tests/**", | ||
"lint:check": "eslint --ext .js,.ts src/** tests/**", | ||
"format": "prettier --config .prettierrc './**/*.ts' --write", | ||
"format:check": "prettier --config .prettierrc './**/*.ts' --check" | ||
}, | ||
@@ -38,3 +40,3 @@ "repository": { | ||
"author": "", | ||
"license": "AGPL-3.0", | ||
"license": "GPL-3.0", | ||
"bugs": { | ||
@@ -45,2 +47,3 @@ "url": "https://github.com/iden3/js-crypto/issues" | ||
"devDependencies": { | ||
"@cspell/eslint-plugin": "^8.14.2", | ||
"@iden3/eslint-config": "https://github.com/iden3/eslint-config", | ||
@@ -47,0 +50,0 @@ "@types/jest": "^29.5.3", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
7871051
89
21761
0
6
13