Comments (9)
All types have a blanket impl of impl<T> From<T> for <T>
:
https://docs.rs/aead/0.3.2/aead/struct.Payload.html#impl-From%3CT%3E
...and all types that impl From
have a blanket impl for Into
:
https://doc.rust-lang.org/std/convert/trait.Into.html#impl-Into%3CU%3E
...so Payload
receives a blanket impl of Into<Payload>
as well.
I agree the documentation for aead::Aead
could be better there.
from aeads.
Ah I see, thanks for the clarification!
Understood now, can close the issue. 👍🏻
from aeads.
I'll leave it open to track adding better documentation
from aeads.
hmm... 🤔 the following gives me Err, not sure why
// message: &[u8], assoc_data: &u8, nonce and recipient_box is properly constructed.
let ct = recipient_box.encrypt(&nonce,
Payload { msg: &message,
aad: &assoc_data });
Just to double check with you @tarcieri , ☝️ this is the correct way to use Payload
right?
update: if I set assoc_data
to an empty slice, then it will pass. but if aad is non empty, it will fail. -- feels like a bug 🪲 ?
to reproduce it, see playground here: https://repl.it/repls/OutstandingWildNature#src/lib.rs
from aeads.
crypto_box
and the xsalsa20poly1305
construction it's based on doesn't support AAD as an algorithm. Unfortunately it's unclear from the current API it's unsupported and you're getting an unhelpful error.
We have this tracking issue open for traits which better reflect constructions like xsalsa20poly1305
which don't support AAD: RustCrypto/traits#261
from aeads.
the xsalsa20poly1305 construction it's based on doesn't support AAD as an algorithm
so will the team add support for AAD in the near future (if so, mind me asking roughly when)? or this exclusion has some rationale behind?
We have this tracking issue open for traits which better reflect constructions like xsalsa20poly1305 which don't support AAD: RustCrypto/traits#261
so basically, xsalsa20poly1305
is "designed to not have AAD support"?
from aeads.
The design of the xsalsa20poly1305
algorithm itself has no support for AAD. It's the only such algorithm in this repo which doesn't.
The similar chacha20poly1305
construction supports it. We could potentially add support for it to crypto_box
from aeads.
I see.
The similar chacha20poly1305 construction supports it. We could potentially add support for it to crypto_box
that would be great
from aeads.
I think this was ultimately addressed in #225
from aeads.
Related Issues (20)
- Using streamed data with ChaCha20Poly1305 HOT 2
- Support for nonce omission in AES-SIV HOT 4
- chacha20poly1305 decode issue HOT 2
- trap at Instance error with codegen-backend = "cranelift" HOT 2
- Cannot build with no-std HOT 1
- Lack of immediate access to GenericArray to view associated functions and trait impls leads to confusion and annoyance. HOT 13
- Requesting an example HOT 3
- Question about nonce size in xchacha20poly1305 HOT 2
- Extremely poor performance on AES256Gcm with anything but opt-level=3 HOT 2
- Consider exposing AesGcm::compute_tag HOT 3
- OCB3: restrict short nonces
- Enable and fix `missing_debug_implementations`
- `bytes` feature of `aead` is not re-exported by AEADs HOT 1
- Performance on Apple Silicon HOT 5
- Seeking help for encrypt files HOT 1
- How to serialize / deserialize `Nonce` HOT 1
- How to serialize a `Nonce` in `aes_gcm` HOT 3
- Get NonceSize from the algorithm HOT 4
- Q: nonce in ChaCha20Poly1305 HOT 2
- AES-256 generating a 64 byte key? HOT 4
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 aeads.