....
This commit is contained in:
@ -5,7 +5,16 @@ const PAILLIER = 0;
|
||||
const JURIK = 1;
|
||||
|
||||
class Ciphertext {
|
||||
constructor(key, plainText, r) {
|
||||
constructor(key, plainText, r, set) {
|
||||
if (set !== undefined) {
|
||||
this.pubKey = key;
|
||||
this.plainText = plainText;
|
||||
|
||||
this.readOnly = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (r === undefined) {
|
||||
// Use the optimised form using Jacobi classes
|
||||
r = cryptoRandom();
|
||||
@ -107,6 +116,15 @@ class Ciphertext {
|
||||
asReadOnlyCiphertext() {
|
||||
return new ReadOnlyCiphertext(this.pubKey, this.cipherText);
|
||||
}
|
||||
|
||||
clone() {
|
||||
let c = new Ciphertext(this.pubKey, this.plainText, 0, true);
|
||||
c.cipherText = this.cipherText;
|
||||
c.r = this.r;
|
||||
c.mode = this.mode;
|
||||
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
class ValueProofSessionProver {
|
||||
|
Reference in New Issue
Block a user