ZcashFoundation / frost

Rust implementation of FROST (Flexible Round-Optimised Schnorr Threshold signatures) by the Zcash Foundation
https://frost.zfnd.org
Other
133 stars 50 forks source link

return error when deserializing the identity #671

Closed conradoplg closed 2 months ago

conradoplg commented 3 months ago

Closes #667

To keep serde working, I switched to another approach which is actually much simpler. Instead of using serde(try_from/into) (which I no longer couldn't since there is no try_into) I simply created a SerializedElement type which does define serde encoding and used it in place of a raw Element. This allows the struct that contains it to support serde by simply deriving it. It does introduce some friction by requiring using e.g. val.0 .0 but that's internal (and can be avoided with getters). We should probably use the same approach for Scalars, but we can do that in a separate PR.