started working on another proof
This commit is contained in:
@ -97,6 +97,20 @@ class Ciphertext {
|
||||
}
|
||||
}
|
||||
|
||||
mul(e) {
|
||||
this.cipherText = mod_exp(this.cipherText, e, this.pubKey.n2);
|
||||
this.r = mod_exp(this.r, e, this.pubKey.n2);
|
||||
this.plainText = (this.plainText * e) % this.pubKey.n2;
|
||||
|
||||
// Force into range
|
||||
while (this.cipherText < 0n) {
|
||||
this.cipherText += this.pubKey.n2;
|
||||
}
|
||||
while (this.plainText < 0n) {
|
||||
this.plainText += this.pubKey.n2;
|
||||
}
|
||||
}
|
||||
|
||||
toString() {
|
||||
return "0x" + this.cipherText.toString(16);
|
||||
}
|
||||
@ -202,6 +216,15 @@ export class ReadOnlyCiphertext {
|
||||
}
|
||||
}
|
||||
|
||||
mul(e) {
|
||||
this.cipherText = mod_exp(this.cipherText, e, this.pubKey.n2);
|
||||
|
||||
// Force into range
|
||||
while (this.cipherText < 0n) {
|
||||
this.cipherText += this.pubKey.n2;
|
||||
}
|
||||
}
|
||||
|
||||
prove(plainText, a) {
|
||||
return new ValueProofSessionVerifier(this, plainText, a);
|
||||
}
|
||||
|
Reference in New Issue
Block a user