Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sigma ZKP for veiled operations #3

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

KlausKidman
Copy link
Collaborator

No description provided.

@@ -71,18 +66,17 @@ export class TwistedElGamal {
if (amount < 0n && amount >= ed25519.CURVE.n)
throw new Error(`The amount must be in the range 0 to ${ed25519.CURVE.n}`);

const rBytes = random ? ensureBytes("Random bytes", random, 32) : randomBytes(32);
const rBytes = ensureBytes("Random bytes", random ?? randomBytes(32), 32);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add the encryptWithNoRandomness method.
It should set <C, D> = <amount * BASE, 0>.

switch (operation) {
case "add":
return ciphertext.addAmount(amount);
case "subtract":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cosmetic: please use sub instead of substract everywhere in the naming.

@dovgopoly
Copy link
Collaborator

Overall LGTM!

@KlausKidman KlausKidman merged commit 7ac9c75 into feature/veild-balances Sep 23, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants