Comments (6)
JOSE transmits the ciphertext and tag separately, thus an interface such as:
val decrypt_raw : key -> nonce -> adata -> ciphertext -> tag -> plaintext option
val encrypt_raw : key -> nonce -> adata -> plaintext -> ciphertext * tag
could be useful (NB: the names _raw
should be revised). the encrypt_aead / decrypt_aead can be implemented in terms of the functions above.
from mirage-crypto.
on a separate note, there could be (measurable) speedup of AEAD encryption if the allocated cipher-stream is extended by tag-size (i.e. Cstruct.len msg + tag_size) -- thus a Cstruct.append can be avoided (which is costly since it allocates and memmoves).
from mirage-crypto.
similarly, the Chacha20 implementation -- where djb does 64 bit nonce and 64 bit counter -- while IETF does 96 bit nonce and 32 bit counter -- could be functorised to allow more static checkng (and fewer conditional branches at runtime in the hot loop [incrementing the counter]).
from mirage-crypto.
Came here to ask for tag_size
in the AEAD interface, and remebered about this issue again.
from mirage-crypto.
@anmonteiro currently, GCM.tag_size
, and Poly1305.mac_size
are provided. For CCM it is what you passed as ~maclen
into CCM.of_secret ~maclen
.
from mirage-crypto.
See #171 which integrates "of_secret", "tag_size" and also "authenticate_encrypt_tag" and "authenticate_decrypt_tag". Any feedback on the PR is welcome.
from mirage-crypto.
Related Issues (20)
- test failures on arm32 HOT 1
- Question: Exposing the tag in AES-GCM HOT 3
- Config flags are not correct when used in cross-architecture-compilation with Dune 3 HOT 5
- Split sub libraries in `mirage-crypto-rng` into individual packages HOT 3
- RNG initialization inconsistencies HOT 1
- cleanup CI scripts HOT 1
- mirage-crypto-rng-eio questions HOT 6
- Mirage_crypto.Chacha20.authenticate_encrypt seg-faults on empty message HOT 3
- Failure to build in a unikernel with target hvt HOT 3
- Support for secp256k1 HOT 1
- Ed25519 / X25519 potential performance improvements (by looking at BoringSSL)
- [dkml] Virtual library for mirage-crypto-pk
- Make mirage-crypto-ec (test) independent of mirage-crypto-pk HOT 2
- [dkml] mirage-crypto-ec issues
- Roadmap for 1.0 release HOT 10
- ARM64 cycle count HOT 3
- data races in mirage-crypto HOT 9
- Revise API (remove intermediate modules)
- P-521 sign not constant-time HOT 7
- Wipe secret key data HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mirage-crypto.