Implement visit_seq() for deserialization visitors#64
Implement visit_seq() for deserialization visitors#64omershlo merged 3 commits intoZenGo-X:masterfrom
Conversation
|
I'll add bincode test in #61 after this gets merged |
|
(This will also be effectively unusable for me until dependencies in rust-paillier and zk-paillier are updated.) |
|
@djc how come ? what dependencies ? |
|
Okay, for this one I have the option of taking on duplicate dependencies I guess, but that's not a great solution; my zk-paillier dependency will pull in old curv. |
|
I will make do a proper update later today. |
|
Thanks! |
|
Ping? |
|
Thanks @djc . Curv serdes is sensitive as other libraries are using them. Therefore it takes time |
|
What are you afraid of? As far as I can tell this does not touch the existing deserialization path, it only adds another one (as used by bincode and potentially other non-self-describing formats) -- seems like a very low-risk fix to me. |
|
I did not get it. I thought this pr changes the serialization not supports another type. |
|
As you can see in the code, it does NOT change anything pertaining to serialization. On the other hand, it adds support for deserializing the point types from a different types of structure ( |
|
Sorry, mixed it with another PR. |
https://github.com/KZen-networks/curv/pull/61/files#diff-99ffb7b09882f90f6bf48a2d6247c2dcR551 https://github.com/KZen-networks/curv/pull/61/files#diff-99ffb7b09882f90f6bf48a2d6247c2dcR569 |
|
@kigawas this is only a test for secp256k1. I think it's best to have as part of this PR a test per curve. |
|
@omershlo |
| .ok_or_else(|| panic!("deserialization failed"))?; | ||
| let bytes_bn = BigInt::from_hex(bytes_str); | ||
| let bytes = BigInt::to_vec(&bytes_bn); | ||
| Ok(Ed25519Point::from_bytes(&bytes[..]).expect("error deserializing point")) |
There was a problem hiding this comment.
better map_err instead of panicking
There was a problem hiding this comment.
This merely exhibits the same behavior as visit_map(), so this seems like an improvement that is orthogonal to this PR.
1139b5a to
c81a080
Compare
|
This now includes tests for public key bincode round trips with each curve. Please review! |
This enables the use of non-self-describing encodings like bincode.
c81a080 to
01961b5
Compare
|
(Test failure is one of the intermittent ones.) |
|
If you don't mind - can you update the tag in |
|
Done! |
This enables the use of non-self-describing encodings like bincode.