RustCrypto / RustCrypto/AEADs

Consider adding an API that takes the nonce size and tag size as parameters

Open
#544 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
961
Forks
200
Avg merge
1h 30m
Merged PRs (30d)
6

Description

We are building a Node.js runtime for the browser so you can run Node.js entirely in your browser without relying on cloud servers. That means we run arbitrary code and right now it's only possible to specify the nonce size and tag size statically via types so we are forced to always call from_slice(...). Ideally we can create it once and not rely on a match that matches nonce size and tag size, e.g.

 match nonce.len() {
   12 => match tag_size {
     12 => AesGcm::<Aes, U12, U12>::new_from_slice(key),
     ...
   },
   ...
 }

So it'd be nice if we could do from_slice(key, nonce_size, tag_size).

Contributor guide

No contributing guide indexed for this repository

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 locating the AesGcm API and its current from_slice(...) constructor, then review how nonce and tag sizes are represented in the type parameters. Determine the intended behavior for runtime nonce and tag sizes; done means the API design is agreed and its supported size combinations are covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.