WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

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

@d3lm

Description

@d3lm

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions