OpenZeppelin / OpenZeppelin/compact-contracts

dev: split the Jubjub key agreement Ecdh out of EcdhMask

Open
#879 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2-low effort: 2-S enhancement feat:crypto
Dominant language
TypeScript
Stars
55
Forks
29
Avg merge
5d 7h
Merged PRs (30d)
25

Description

crypto/EcdhMask carries the Jubjub key agreement inline, so a consumer that needs several masks from one shared secret (the Field pad in #735) cannot reach the shared point without going through encrypt.

Move the key agreement into its own crypto/Ecdh module: deriveShared (sender side, owns the identity-key and zero-ephemeral guards), recoverShared (recipient side), and a SharedSecret struct. EcdhMask.encrypt / decrypt delegate to it and keep their ciphertexts unchanged.

Prerequisite for #735.

PR: #866

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading crypto/EcdhMask and the changes proposed in PR #866, then trace how its inline Jubjub agreement currently supports encrypt and decrypt. Done means a separate crypto/Ecdh module exposes deriveShared, recoverShared, and SharedSecret, while EcdhMask delegates to it and produces unchanged ciphertexts.

Written by the indexing model from the issue text.

Assessment

Domain
cryptography
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.