paillier-bigint
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -94,3 +94,3 @@ import { bitLength, prime, modInv, modPow, lcm, primeSync, randBetween } from 'bigint-crypto-utils' | ||
/** | ||
* Creates an instance of class PaillierPublicKey | ||
* Creates an instance of class PublicKey | ||
* @param {bigint} n - the public modulo | ||
@@ -154,7 +154,7 @@ * @param {bigint | number} g - the public generator | ||
/** | ||
* Creates an instance of class PaillierPrivateKey | ||
* Creates an instance of class PrivateKey | ||
* | ||
* @param {bigint} lambda | ||
* @param {bigint} mu | ||
* @param {PaillierPublicKey} publicKey | ||
* @param {PublicKey} publicKey | ||
* @param {bigint} [p = null] - a big prime | ||
@@ -161,0 +161,0 @@ * @param {bigint} [q = null] - a big prime |
@@ -98,3 +98,3 @@ 'use strict' | ||
/** | ||
* Creates an instance of class PaillierPublicKey | ||
* Creates an instance of class PublicKey | ||
* @param {bigint} n - the public modulo | ||
@@ -158,7 +158,7 @@ * @param {bigint | number} g - the public generator | ||
/** | ||
* Creates an instance of class PaillierPrivateKey | ||
* Creates an instance of class PrivateKey | ||
* | ||
* @param {bigint} lambda | ||
* @param {bigint} mu | ||
* @param {PaillierPublicKey} publicKey | ||
* @param {PublicKey} publicKey | ||
* @param {bigint} [p = null] - a big prime | ||
@@ -165,0 +165,0 @@ * @param {bigint} [q = null] - a big prime |
{ | ||
"name": "paillier-bigint", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "An implementation of the Paillier cryptosystem using native JS (ECMA 2020) implementation of BigInt", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -164,3 +164,3 @@ [![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard) | ||
### new PublicKey(n, g) | ||
Creates an instance of class PaillierPublicKey | ||
Creates an instance of class PublicKey | ||
@@ -231,3 +231,3 @@ | ||
### new PrivateKey(lambda, mu, publicKey, [p], [q]) | ||
Creates an instance of class PaillierPrivateKey | ||
Creates an instance of class PrivateKey | ||
@@ -239,3 +239,3 @@ | ||
| mu | <code>bigint</code> | | | | ||
| publicKey | <code>PaillierPublicKey</code> | | | | ||
| publicKey | [<code>PublicKey</code>](#PublicKey) | | | | ||
| [p] | <code>bigint</code> | <code></code> | a big prime | | ||
@@ -314,3 +314,3 @@ | [q] | <code>bigint</code> | <code></code> | a big prime | | ||
### new PublicKey(n, g) | ||
Creates an instance of class PaillierPublicKey | ||
Creates an instance of class PublicKey | ||
@@ -383,3 +383,3 @@ | ||
### new PrivateKey(lambda, mu, publicKey, [p], [q]) | ||
Creates an instance of class PaillierPrivateKey | ||
Creates an instance of class PrivateKey | ||
@@ -391,3 +391,3 @@ | ||
| mu | <code>bigint</code> | | | | ||
| publicKey | <code>PaillierPublicKey</code> | | | | ||
| publicKey | [<code>PublicKey</code>](#PublicKey) | | | | ||
| [p] | <code>bigint</code> | <code></code> | a big prime | | ||
@@ -394,0 +394,0 @@ | [q] | <code>bigint</code> | <code></code> | a big prime | |
@@ -48,3 +48,37 @@ export type KeyPair = { | ||
_q: bigint; | ||
publicKey: any; | ||
publicKey: { | ||
n: bigint; | ||
_n2: bigint; | ||
g: bigint; | ||
/** | ||
* Get the bit length of the public modulo | ||
* @return {number} - bit length of the public modulo | ||
*/ | ||
readonly bitLength: number; | ||
/** | ||
* Paillier public-key encryption | ||
* | ||
* @param {bigint} m - a bigint representation of a cleartext message | ||
* | ||
* @returns {bigint} - the encryption of m with this public key | ||
*/ | ||
encrypt(m: bigint): bigint; | ||
/** | ||
* Homomorphic addition | ||
* | ||
* @param {...bigint} ciphertexts - n >= 2 ciphertexts (c_1,..., c_n) that are the encryption of (m_1, ..., m_n) with this public key | ||
* | ||
* @returns {bigint} - the encryption of (m_1 + ... + m_2) with this public key | ||
*/ | ||
addition(...ciphertexts: bigint[]): bigint; | ||
/** | ||
* Pseudo-homomorphic Paillier multiplication | ||
* | ||
* @param {bigint} c - a number m encrypted with this public key | ||
* @param {bigint | number} k - either a bigint or a number | ||
* | ||
* @returns {bigint} - the encryption of k·m with this public key | ||
*/ | ||
multiply(c: bigint, k: number | bigint): bigint; | ||
}; | ||
/** | ||
@@ -74,3 +108,37 @@ * Get the bit length of the public modulo | ||
export const PrivateKey: { | ||
new (lambda: bigint, mu: bigint, publicKey: any, p?: bigint, q?: bigint): { | ||
new (lambda: bigint, mu: bigint, publicKey: { | ||
n: bigint; | ||
_n2: bigint; | ||
g: bigint; | ||
/** | ||
* Get the bit length of the public modulo | ||
* @return {number} - bit length of the public modulo | ||
*/ | ||
readonly bitLength: number; | ||
/** | ||
* Paillier public-key encryption | ||
* | ||
* @param {bigint} m - a bigint representation of a cleartext message | ||
* | ||
* @returns {bigint} - the encryption of m with this public key | ||
*/ | ||
encrypt(m: bigint): bigint; | ||
/** | ||
* Homomorphic addition | ||
* | ||
* @param {...bigint} ciphertexts - n >= 2 ciphertexts (c_1,..., c_n) that are the encryption of (m_1, ..., m_n) with this public key | ||
* | ||
* @returns {bigint} - the encryption of (m_1 + ... + m_2) with this public key | ||
*/ | ||
addition(...ciphertexts: bigint[]): bigint; | ||
/** | ||
* Pseudo-homomorphic Paillier multiplication | ||
* | ||
* @param {bigint} c - a number m encrypted with this public key | ||
* @param {bigint | number} k - either a bigint or a number | ||
* | ||
* @returns {bigint} - the encryption of k·m with this public key | ||
*/ | ||
multiply(c: bigint, k: number | bigint): bigint; | ||
}, p?: bigint, q?: bigint): { | ||
lambda: bigint; | ||
@@ -80,3 +148,37 @@ mu: bigint; | ||
_q: bigint; | ||
publicKey: any; | ||
publicKey: { | ||
n: bigint; | ||
_n2: bigint; | ||
g: bigint; | ||
/** | ||
* Get the bit length of the public modulo | ||
* @return {number} - bit length of the public modulo | ||
*/ | ||
readonly bitLength: number; | ||
/** | ||
* Paillier public-key encryption | ||
* | ||
* @param {bigint} m - a bigint representation of a cleartext message | ||
* | ||
* @returns {bigint} - the encryption of m with this public key | ||
*/ | ||
encrypt(m: bigint): bigint; | ||
/** | ||
* Homomorphic addition | ||
* | ||
* @param {...bigint} ciphertexts - n >= 2 ciphertexts (c_1,..., c_n) that are the encryption of (m_1, ..., m_n) with this public key | ||
* | ||
* @returns {bigint} - the encryption of (m_1 + ... + m_2) with this public key | ||
*/ | ||
addition(...ciphertexts: bigint[]): bigint; | ||
/** | ||
* Pseudo-homomorphic Paillier multiplication | ||
* | ||
* @param {bigint} c - a number m encrypted with this public key | ||
* @param {bigint | number} k - either a bigint or a number | ||
* | ||
* @returns {bigint} - the encryption of k·m with this public key | ||
*/ | ||
multiply(c: bigint, k: number | bigint): bigint; | ||
}; | ||
/** | ||
@@ -83,0 +185,0 @@ * Get the bit length of the public modulo |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
57402
682
0