Closed AtropineTears closed 3 years ago
That should be very possible. I'm not sure if I will have time to do this soon myself, but a pull request would be welcome: you would need to patch the pqcrypto-template/scheme
directory files as those are used to generate the rest.
Hi, any updates on serde implementation or whether you can do it? I am working on a project that needs serialization.
I will see if I have some time to get to it this week; in the mean time I would be open to pull requests.
Awesome
You may be interested in the ops
crate by the way, which already has serde
support
Unfortunately, it seems it's not trivial as derive(Serialize, Deserialize)
doesn't work for arbitrary-sized arrays in Rust.
error[E0277]: the trait bound `[u8; 690]: Deserialize<'_>` is not satisfied
--> pqcrypto-falcon/src/falcon512.rs:89:30
|
89 | pub struct DetachedSignature([u8; ffi::PQCLEAN_FALCON512_CLEAN_CRYPTO_BYTES], usize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `[u8; 690]`
|
I will have to look into workarounds.
Note: This question is specific to
pqcrypto-falcon
and I really would like it implemented in that if possible but it also goes for other pqcrypto cratesHi,
I was wondering whether it is possible to add serde support for deriving serialization/deserialization to the Public Key, Private Key, and Signature structs so they can be serialized/deserialized by simply adding:
Specifically (if there is one you want to try it out on first), I am talking about
pqcrypto-falcon
as I am trying to create structs that implement serde like below:Due to the actual structs themselves not having serde support, to the best of my knowledge, it does not allow me to serialize/deserialize. If I am wrong about anything, feel free to correct me.