Sign In

@celo/poprf

Package Overview
Dependencies
Maintainers
19
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@celo/poprf - npm Package Compare versions

Comparing version
0.1.7
to
0.1.8
+1
-1
package.json
{
"name": "@celo/poprf",
"description": "A threshold-computable partially-oblivous psuedo-random function",
"version": "0.1.7",
"version": "0.1.8",
"license": "Apache-2.0",

@@ -6,0 +6,0 @@ "repository": {

@@ -6,2 +6,4 @@ /* tslint:disable */

*
* # Arguments
*
* * message: A cleartext message which you want to blind

@@ -25,2 +27,4 @@ * * seed: A 32 byte seed for randomness. You can get one securely via `crypto.randomBytes(32)`

*
* # Arguments
*
* * public_key: Public key against which the response should be verified.

@@ -47,2 +51,4 @@ * * blinding_factor: The blinding_factor used to blind the message.

*
* # Arguments
*
* * polynomial: Public key polynomial against which the response should be verified.

@@ -53,2 +59,4 @@ * * blinding_factor: The blinding_factor used to blind the message.

*
* Returns the unblinded evaluation share.
*
* # Throws

@@ -83,2 +91,10 @@ *

*
* # Arguments
*
* * private_key: Private key to be used in evaluating the POPRF.
* * tag: Message tag passed into the evaluation of the POPRF.
* * blinded_message: Blinded message input containing the hidden message.
*
* Returns the blinded evaluation over the tag and blinded message.
*
* # Throws

@@ -98,2 +114,10 @@ *

*
* # Arguments
*
* * share: Private key share to be used in evaluating the POPRF.
* * tag: Message tag passed into the evaluation of the POPRF.
* * message: Plaintext message input.
*
* Returns a share of the evaluation over the tag and message.
*
* # Throws

@@ -104,4 +128,6 @@ *

*
* NOTE: This method must NOT be called with a PrivateKey which is not generated via a
* secret sharing scheme.
* # Safety
*
* In order for the decentralized security properties of the system to hold, the private key
* share input must be derived using a secure distributed key generation ceremony.
* @param {Uint8Array} share_buf

@@ -117,2 +143,10 @@ * @param {Uint8Array} tag

*
* # Arguments
*
* * share: Private key share to be used in evaluating the POPRF.
* * tag: Message tag passed into the evaluation of the POPRF.
* * blinded_message: Blinded message input containing the hidden message.
*
* Returns a share of the blinded evaluation over the tag and blinded message.
*
* # Throws

@@ -123,4 +157,6 @@ *

*
* NOTE: This method must NOT be called with a PrivateKey which is not generated via a
* secret sharing scheme.
* # Safety
*
* In order for the decentralized security properties of the system to hold, the private key
* share input must be derived using a secure distributed key generation ceremony.
* @param {Uint8Array} share_buf

@@ -135,8 +171,22 @@ * @param {Uint8Array} tag

*
* NOTE: Wasm-bindgen does not support Vec<Vec<u8>>, so this function accepts a flattened
* byte vector which it will parse in chunks for each signature.
* # Arguments
*
* NOTE: If you are working with an array of Uint8Arrays In Javascript, the simplest
* way to flatten them is via:
* * threshold: The required number of evluation shares to reconstruct the full response.
* * evaluations: A flattened array of plaintext partial evaluations.
*
* Returns the aggregated plaintext evaluation response.
*
* # Throws
*
* - If any of the inputs fail to deserialize.
* - If the aggregation fails.
*
* # Note
*
* Wasm-bindgen does not support Vec<Vec<u8>>, so this function accepts a flattened byte vector
* which it will parse in chunks for each signature.
*
* If you are working with an array of Uint8Arrays In Javascript, the simplest way to flatten them
* is via:
*
* ```js

@@ -149,7 +199,2 @@ * function flatten(arr) {

* ```
*
* # Throws
*
* - If any of the inputs fail to deserialize.
* - If the aggregation fails.
* @param {number} threshold

@@ -164,8 +209,22 @@ * @param {Uint8Array} evaluations_buf

*
* NOTE: Wasm-bindgen does not support Vec<Vec<u8>>, so this function accepts a flattened
* byte vector which it will parse in chunks for each signature.
* # Arguments
*
* NOTE: If you are working with an array of Uint8Arrays In Javascript, the simplest
* way to flatten them is via:
* * threshold: The required number of evluation shares to reconstruct the full response.
* * blinded_evaluations: A flattened array of blind partial evaluations.
*
* Returns the aggregated blind evaluation response.
*
* # Throws
*
* - If any of the inputs fail to deserialize.
* - If the aggregation fails.
*
* # Note
*
* Wasm-bindgen does not support Vec<Vec<u8>>, so this function accepts a flattened byte vector
* which it will parse in chunks for each signature.
*
* If you are working with an array of Uint8Arrays In Javascript, the simplest way to flatten them
* is via:
*
* ```js

@@ -178,7 +237,2 @@ * function flatten(arr) {

* ```
*
* # Throws
*
* - If any of the inputs fail to deserialize.
* - If the aggregation fails.
* @param {number} threshold

@@ -185,0 +239,0 @@ * @param {Uint8Array} blinded_evaluations_buf

+136
-82

@@ -70,2 +70,4 @@ let imports = {};

*
* # Arguments
*
* * message: A cleartext message which you want to blind

@@ -87,6 +89,6 @@ * * seed: A 32 byte seed for randomness. You can get one securely via `crypto.randomBytes(32)`

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
var ptr1 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
var len1 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ptr1 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
const len1 = WASM_VECTOR_LEN;
wasm.blindMsg(retptr, ptr0, len0, ptr1, len1);

@@ -112,2 +114,4 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

*
* # Arguments
*
* * public_key: Public key against which the response should be verified.

@@ -131,10 +135,10 @@ * * blinding_factor: The blinding_factor used to blind the message.

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(public_key_buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
var ptr1 = passArray8ToWasm0(blinding_factor_buf, wasm.__wbindgen_malloc);
var len1 = WASM_VECTOR_LEN;
var ptr2 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
var len2 = WASM_VECTOR_LEN;
var ptr3 = passArray8ToWasm0(blinded_resp_buf, wasm.__wbindgen_malloc);
var len3 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(public_key_buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ptr1 = passArray8ToWasm0(blinding_factor_buf, wasm.__wbindgen_malloc);
const len1 = WASM_VECTOR_LEN;
const ptr2 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
const len2 = WASM_VECTOR_LEN;
const ptr3 = passArray8ToWasm0(blinded_resp_buf, wasm.__wbindgen_malloc);
const len3 = WASM_VECTOR_LEN;
wasm.unblindResp(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);

@@ -161,2 +165,4 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

*
* # Arguments
*
* * polynomial: Public key polynomial against which the response should be verified.

@@ -167,2 +173,4 @@ * * blinding_factor: The blinding_factor used to blind the message.

*
* Returns the unblinded evaluation share.
*
* # Throws

@@ -181,10 +189,10 @@ *

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(polynomial_buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
var ptr1 = passArray8ToWasm0(blinding_factor_buf, wasm.__wbindgen_malloc);
var len1 = WASM_VECTOR_LEN;
var ptr2 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
var len2 = WASM_VECTOR_LEN;
var ptr3 = passArray8ToWasm0(blinded_partial_resp_buf, wasm.__wbindgen_malloc);
var len3 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(polynomial_buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ptr1 = passArray8ToWasm0(blinding_factor_buf, wasm.__wbindgen_malloc);
const len1 = WASM_VECTOR_LEN;
const ptr2 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
const len2 = WASM_VECTOR_LEN;
const ptr3 = passArray8ToWasm0(blinded_partial_resp_buf, wasm.__wbindgen_malloc);
const len3 = WASM_VECTOR_LEN;
wasm.unblindPartialResp(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);

@@ -222,8 +230,8 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(private_key_buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
var ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
var len1 = WASM_VECTOR_LEN;
var ptr2 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
var len2 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(private_key_buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
const len1 = WASM_VECTOR_LEN;
const ptr2 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
const len2 = WASM_VECTOR_LEN;
wasm.eval(retptr, ptr0, len0, ptr1, len1, ptr2, len2);

@@ -249,2 +257,10 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

*
* # Arguments
*
* * private_key: Private key to be used in evaluating the POPRF.
* * tag: Message tag passed into the evaluation of the POPRF.
* * blinded_message: Blinded message input containing the hidden message.
*
* Returns the blinded evaluation over the tag and blinded message.
*
* # Throws

@@ -262,8 +278,8 @@ *

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(private_key_buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
var ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
var len1 = WASM_VECTOR_LEN;
var ptr2 = passArray8ToWasm0(blinded_message_buf, wasm.__wbindgen_malloc);
var len2 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(private_key_buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
const len1 = WASM_VECTOR_LEN;
const ptr2 = passArray8ToWasm0(blinded_message_buf, wasm.__wbindgen_malloc);
const len2 = WASM_VECTOR_LEN;
wasm.blindEval(retptr, ptr0, len0, ptr1, len1, ptr2, len2);

@@ -289,2 +305,10 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

*
* # Arguments
*
* * share: Private key share to be used in evaluating the POPRF.
* * tag: Message tag passed into the evaluation of the POPRF.
* * message: Plaintext message input.
*
* Returns a share of the evaluation over the tag and message.
*
* # Throws

@@ -295,4 +319,6 @@ *

*
* NOTE: This method must NOT be called with a PrivateKey which is not generated via a
* secret sharing scheme.
* # Safety
*
* In order for the decentralized security properties of the system to hold, the private key
* share input must be derived using a secure distributed key generation ceremony.
* @param {Uint8Array} share_buf

@@ -306,8 +332,8 @@ * @param {Uint8Array} tag

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(share_buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
var ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
var len1 = WASM_VECTOR_LEN;
var ptr2 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
var len2 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(share_buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
const len1 = WASM_VECTOR_LEN;
const ptr2 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
const len2 = WASM_VECTOR_LEN;
wasm.parialEval(retptr, ptr0, len0, ptr1, len1, ptr2, len2);

@@ -333,2 +359,10 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

*
* # Arguments
*
* * share: Private key share to be used in evaluating the POPRF.
* * tag: Message tag passed into the evaluation of the POPRF.
* * blinded_message: Blinded message input containing the hidden message.
*
* Returns a share of the blinded evaluation over the tag and blinded message.
*
* # Throws

@@ -339,4 +373,6 @@ *

*
* NOTE: This method must NOT be called with a PrivateKey which is not generated via a
* secret sharing scheme.
* # Safety
*
* In order for the decentralized security properties of the system to hold, the private key
* share input must be derived using a secure distributed key generation ceremony.
* @param {Uint8Array} share_buf

@@ -350,8 +386,8 @@ * @param {Uint8Array} tag

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(share_buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
var ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
var len1 = WASM_VECTOR_LEN;
var ptr2 = passArray8ToWasm0(blinded_message_buf, wasm.__wbindgen_malloc);
var len2 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(share_buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
const ptr1 = passArray8ToWasm0(tag, wasm.__wbindgen_malloc);
const len1 = WASM_VECTOR_LEN;
const ptr2 = passArray8ToWasm0(blinded_message_buf, wasm.__wbindgen_malloc);
const len2 = WASM_VECTOR_LEN;
wasm.blindPartialEval(retptr, ptr0, len0, ptr1, len1, ptr2, len2);

@@ -376,8 +412,22 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

*
* NOTE: Wasm-bindgen does not support Vec<Vec<u8>>, so this function accepts a flattened
* byte vector which it will parse in chunks for each signature.
* # Arguments
*
* NOTE: If you are working with an array of Uint8Arrays In Javascript, the simplest
* way to flatten them is via:
* * threshold: The required number of evluation shares to reconstruct the full response.
* * evaluations: A flattened array of plaintext partial evaluations.
*
* Returns the aggregated plaintext evaluation response.
*
* # Throws
*
* - If any of the inputs fail to deserialize.
* - If the aggregation fails.
*
* # Note
*
* Wasm-bindgen does not support Vec<Vec<u8>>, so this function accepts a flattened byte vector
* which it will parse in chunks for each signature.
*
* If you are working with an array of Uint8Arrays In Javascript, the simplest way to flatten them
* is via:
*
* ```js

@@ -390,7 +440,2 @@ * function flatten(arr) {

* ```
*
* # Throws
*
* - If any of the inputs fail to deserialize.
* - If the aggregation fails.
* @param {number} threshold

@@ -403,4 +448,4 @@ * @param {Uint8Array} evaluations_buf

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(evaluations_buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(evaluations_buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.aggregate(retptr, threshold, ptr0, len0);

@@ -426,8 +471,22 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

*
* NOTE: Wasm-bindgen does not support Vec<Vec<u8>>, so this function accepts a flattened
* byte vector which it will parse in chunks for each signature.
* # Arguments
*
* NOTE: If you are working with an array of Uint8Arrays In Javascript, the simplest
* way to flatten them is via:
* * threshold: The required number of evluation shares to reconstruct the full response.
* * blinded_evaluations: A flattened array of blind partial evaluations.
*
* Returns the aggregated blind evaluation response.
*
* # Throws
*
* - If any of the inputs fail to deserialize.
* - If the aggregation fails.
*
* # Note
*
* Wasm-bindgen does not support Vec<Vec<u8>>, so this function accepts a flattened byte vector
* which it will parse in chunks for each signature.
*
* If you are working with an array of Uint8Arrays In Javascript, the simplest way to flatten them
* is via:
*
* ```js

@@ -440,7 +499,2 @@ * function flatten(arr) {

* ```
*
* # Throws
*
* - If any of the inputs fail to deserialize.
* - If the aggregation fails.
* @param {number} threshold

@@ -453,4 +507,4 @@ * @param {Uint8Array} blinded_evaluations_buf

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(blinded_evaluations_buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(blinded_evaluations_buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.blindAggregate(retptr, threshold, ptr0, len0);

@@ -487,4 +541,4 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.thresholdKeygen(retptr, n, t, ptr0, len0);

@@ -511,4 +565,4 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.keygen(retptr, ptr0, len0);

@@ -733,3 +787,3 @@ var r0 = getInt32Memory0()[retptr / 4 + 0];

get t() {
var ret = wasm.__wbg_get_keys_t(this.ptr);
const ret = wasm.__wbg_get_keys_t(this.ptr);
return ret >>> 0;

@@ -746,3 +800,3 @@ }

get n() {
var ret = wasm.__wbg_get_keys_n(this.ptr);
const ret = wasm.__wbg_get_keys_n(this.ptr);
return ret >>> 0;

@@ -777,3 +831,3 @@ }

numShares() {
var ret = wasm.keys_numShares(this.ptr);
const ret = wasm.keys_numShares(this.ptr);
return ret >>> 0;

@@ -817,3 +871,3 @@ }

module.exports.__wbindgen_string_new = function(arg0, arg1) {
var ret = getStringFromWasm0(arg0, arg1);
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);

@@ -827,3 +881,3 @@ };

module.exports.__wbg_new_693216e109162396 = function() {
var ret = new Error();
const ret = new Error();
return addHeapObject(ret);

@@ -833,5 +887,5 @@ };

module.exports.__wbg_stack_0ddaca5d1abfb52f = function(arg0, arg1) {
var ret = getObject(arg1).stack;
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
const ret = getObject(arg1).stack;
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len0;

@@ -838,0 +892,0 @@ getInt32Memory0()[arg0 / 4 + 0] = ptr0;

Sorry, the diff of this file is not supported yet