@toruslabs/openlogin-utils
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -175,2 +175,3 @@ module.exports = | ||
// EXPORTS | ||
__webpack_require__.d(__webpack_exports__, "SECP256K1_CURVE_N", function() { return /* reexport */ SECP256K1_CURVE_N; }); | ||
__webpack_require__.d(__webpack_exports__, "subkey", function() { return /* reexport */ subkey; }); | ||
@@ -310,9 +311,11 @@ __webpack_require__.d(__webpack_exports__, "keccak256", function() { return /* reexport */ keccak256; }); | ||
// creates subkeys via MiMC hash, output keys are not padded | ||
var SECP256K1_CURVE_N = "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"; // creates subkeys via MiMC hash, output keys are not padded | ||
function subkey(keyHex, input) { | ||
var privKeyBuf = new external_bn_js_default.a(keyHex, "hex").toBuffer(); // TODO: check against existing usage of mimc | ||
var privKeyBuf = Buffer.from(new external_bn_js_default.a(keyHex, "hex").toString(16, 64), "hex"); // TODO: check against existing usage of mimc | ||
// TODO: check that MPC is possible with mimc, with tests | ||
var output = mimcHash(1, privKeyBuf, input); | ||
var inputPath = new external_bn_js_default.a(input).umod(new external_bn_js_default.a(SECP256K1_CURVE_N, "hex")); | ||
var output = mimcHash(1, privKeyBuf, inputPath); | ||
return output.xL.toString(16); | ||
@@ -319,0 +322,0 @@ } |
{ | ||
"name": "@toruslabs/openlogin-utils", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"homepage": "https://github.com/torusresearch/OpenLoginSdk#readme", | ||
@@ -60,3 +60,3 @@ "license": "ISC", | ||
}, | ||
"gitHead": "833cee86766ed975a394a85e59775422667248db" | ||
"gitHead": "d257d80b54ec8319a5aeecf0017fecca97f58a02" | ||
} |
/// <reference types="node" /> | ||
export declare const SECP256K1_CURVE_N = "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"; | ||
export declare function subkey(keyHex: string, input: Buffer): string; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1662093
5271