-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to serialize a Nonce
in aes_gcm
#621
Comments
There are several ways to convert normal core arrays like You can also use the
To avoid you having to specify the algorithm, So you should really work with that, not |
This crate uses a very old version of And thanks for helping! |
We re-export It's available as In our next breaking releases, we're migrating to |
When creating a random nonce, Rust automagically gives it the following type:
My goal is to put the
Nonce
into a struct that implements bothserde::Serialize
andserde::Deserialize
. And actually writing that whole type doesn't seem intended.The library provides two
Nonce
types:aes_gcm::Nonce
andaes_gcm::aead::Nonce
with the latter one being returned from thegenerate_nonce
function.Signature of
generate_nonce
:Type
Nonce
:However, when I try to give the nonce the type myself, like in the following, I get the following error:
All this is getting way too complicated, which I hope is not intended. What would be the intended solution to
(de)?serialize
aNonce
?The text was updated successfully, but these errors were encountered: