Comments (6)
@drewstone, looks like I will need to implement these traits for various types in fs-dkr
as well so I can implement on ProtocolMessage
- are you ok to merge/support this if I prepare some PRs?
from cggmp-threshold-ecdsa.
So I noticed that they are implemented for JoinMessage
and RefreshMessage
in fs-dkr
which is great. Maybe you can advise on the best way to approach this given these errors when I try to derive for M
:
error[E0277]: the trait bound `Sha256: Serialize` is not satisfied
--> src/refresh/state_machine.rs:320:9
|
320 | Round1(Option<JoinMessage<Secp256k1, Sha256, { crate::utilities::STAT_PARAM }>>),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Serialize` is not implemented for `Sha256`
|
= help: the following other types implement trait `Serialize`:
&'a T
&'a mut T
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
and 371 others
= note: required because of the requirements on the impl of `Serialize` for `fs_dkr::add_party_message::JoinMessage<Secp256k1, Sha256, 80_usize>`
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `Serialize` for `std::option::Option<fs_dkr::add_party_message::JoinMessage<Secp256k1, Sha256, 80_usize>>`
note: required by a bound in `serialize_newtype_variant`
--> /Users/muji/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.147/src/ser/mod.rs:940:12
|
940 | T: Serialize;
| ^^^^^^^^^ required by this bound in `serialize_newtype_variant`
error[E0277]: the trait bound `fs_dkr::error::FsDkrError: Serialize` is not satisfied
--> src/refresh/state_machine.rs:322:3
|
322 | Option<FsDkrResult<RefreshMessage<Secp256k1, Sha256, { crate::utilities::STAT_PARAM }>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Serialize` is not implemented for `fs_dkr::error::FsDkrError`
|
= help: the following other types implement trait `Serialize`:
&'a T
&'a mut T
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
and 371 others
= note: required because of the requirements on the impl of `Serialize` for `std::result::Result<fs_dkr::refresh_message::RefreshMessage<Secp256k1, Sha256, 80_usize>, fs_dkr::error::FsDkrError>`
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `Serialize` for `std::option::Option<std::result::Result<fs_dkr::refresh_message::RefreshMessage<Secp256k1, Sha256, 80_usize>, fs_dkr::error::FsDkrError>>`
note: required by a bound in `serialize_newtype_variant`
--> /Users/muji/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.147/src/ser/mod.rs:940:12
|
940 | T: Serialize;
| ^^^^^^^^^ required by this bound in `serialize_newtype_variant`
error[E0277]: the trait bound `Sha256: Serialize` is not satisfied
--> src/refresh/state_machine.rs:322:3
|
322 | Option<FsDkrResult<RefreshMessage<Secp256k1, Sha256, { crate::utilities::STAT_PARAM }>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Serialize` is not implemented for `Sha256`
|
= help: the following other types implement trait `Serialize`:
&'a T
&'a mut T
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
and 371 others
= note: required because of the requirements on the impl of `Serialize` for `fs_dkr::refresh_message::RefreshMessage<Secp256k1, Sha256, 80_usize>`
= note: 2 redundant requirements hidden
= note: required because of the requirements on the impl of `Serialize` for `std::option::Option<std::result::Result<fs_dkr::refresh_message::RefreshMessage<Secp256k1, Sha256, 80_usize>, fs_dkr::error::FsDkrError>>`
note: required by a bound in `serialize_newtype_variant`
--> /Users/muji/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.147/src/ser/mod.rs:940:12
|
940 | T: Serialize;
| ^^^^^^^^^ required by this bound in `serialize_newtype_variant`
error[E0277]: the trait bound `Sha256: Deserialize<'_>` is not satisfied
--> src/refresh/state_machine.rs:320:9
|
320 | Round1(Option<JoinMessage<Secp256k1, Sha256, { crate::utilities::STAT_PARAM }>>),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `Sha256`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a serde_bytes::bytes::Bytes
&'a str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
and 603 others
= note: required because of the requirements on the impl of `Deserialize<'_>` for `fs_dkr::add_party_message::JoinMessage<Secp256k1, Sha256, 80_usize>`
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `Deserialize<'_>` for `std::option::Option<fs_dkr::add_party_message::JoinMessage<Secp256k1, Sha256, 80_usize>>`
note: required by a bound in `newtype_variant`
--> /Users/muji/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.147/src/de/mod.rs:2123:12
|
2123 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `newtype_variant`
error[E0277]: the trait bound `fs_dkr::error::FsDkrError: Deserialize<'_>` is not satisfied
--> src/refresh/state_machine.rs:322:3
|
322 | Option<FsDkrResult<RefreshMessage<Secp256k1, Sha256, { crate::utilities::STAT_PARAM }>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `fs_dkr::error::FsDkrError`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a serde_bytes::bytes::Bytes
&'a str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
and 603 others
= note: required because of the requirements on the impl of `Deserialize<'_>` for `std::result::Result<fs_dkr::refresh_message::RefreshMessage<Secp256k1, Sha256, 80_usize>, fs_dkr::error::FsDkrError>`
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `Deserialize<'_>` for `std::option::Option<std::result::Result<fs_dkr::refresh_message::RefreshMessage<Secp256k1, Sha256, 80_usize>, fs_dkr::error::FsDkrError>>`
note: required by a bound in `newtype_variant`
--> /Users/muji/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.147/src/de/mod.rs:2123:12
|
2123 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `newtype_variant`
error[E0277]: the trait bound `Sha256: Deserialize<'_>` is not satisfied
--> src/refresh/state_machine.rs:322:3
|
322 | Option<FsDkrResult<RefreshMessage<Secp256k1, Sha256, { crate::utilities::STAT_PARAM }>>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `Sha256`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a serde_bytes::bytes::Bytes
&'a str
()
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
and 603 others
= note: required because of the requirements on the impl of `Deserialize<'_>` for `fs_dkr::refresh_message::RefreshMessage<Secp256k1, Sha256, 80_usize>`
= note: 2 redundant requirements hidden
= note: required because of the requirements on the impl of `Deserialize<'_>` for `std::option::Option<std::result::Result<fs_dkr::refresh_message::RefreshMessage<Secp256k1, Sha256, 80_usize>, fs_dkr::error::FsDkrError>>`
note: required by a bound in `newtype_variant`
--> /Users/muji/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.147/src/de/mod.rs:2123:12
|
2123 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `newtype_variant`
For more information about this error, try `rustc --explain E0277`.
The main issues seem to be the Sha256
type and the use of FsDkrResult
, I would have thought that Round2
should wrap RefreshMessage
rather than FsDkrResult
- is that feasible?
from cggmp-threshold-ecdsa.
Ok, so removing FsDkrResult
was pretty straightforward and the tests continue to pass (for now I just want to focus on the refresh
module): cc72049 - I think it makes the code cleaner too 👍
from cggmp-threshold-ecdsa.
I think to workaround the Sha256
problem I can't derive Serialize
and Deserialize
but will need to implement them manually on M
.
Nope, we need a type that implements Digest + Clone + Serialize + Deserialize
and use that in place of the Sha256
type - the only thing I can think of is a new type struct that wraps an inner sha2::Sha256
and proxies the Digest
implementation.
What do you think?
from cggmp-threshold-ecdsa.
So the only way I think this is possible is with a new type that wraps sha2::Sha256
, I added it here: 04e695f
And it compiles and all the tests pass.
Will implement for the sign
and presign
modules and then I think this is ready for review.
from cggmp-threshold-ecdsa.
Cool, derived the serde traits for the sign and presign modules - a review would be appreciated: #17
Thanks 🙏
from cggmp-threshold-ecdsa.
Related Issues (20)
- [SPEC] Presigning and Signing HOT 1
- Review c-split vulnerability from TSS Shock HOT 9
- [BUG] paillier_decryption_modulo_q test is flaky HOT 2
- [BUG] Fix flaky tests
- [TASK] Remove duplicate utility modules
- Fix webassembly checks in CI
- [SPEC] missing Π-mod ZK-proof HOT 3
- Discuss possible fork of curv library
- [CHECKLIST] follow CGGMP20 paper HOT 10
- refactor: use DLNProof as PI-prm proof and use instead of current ring-Pedersen proofs
- feat: replace ZK_PDL_WITH_SLACK proof with PI-log* from CGGMP paper
- [SPEC] Converting Shamir Shares to Additive Shares
- feat: implement PI-mod proof and give the proof for the Paillier keys
- refactor: single set of Paillier keys as in CGGMP paper
- feat: configurable security levels for testing/release
- [TASK] Remove superfluous/extra encryption in keygen HOT 1
- Backport c-split fixes to the multi-party-ecdsa repository
- perf: safe-prime generation HOT 6
- [SPEC] Key Refresh (fs-dkr) State Machine (in progress)
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 cggmp-threshold-ecdsa.