Giter VIP home page Giter VIP logo

elastic-elgamal's People

Contributors

dependabot[bot] avatar dufkan avatar jirigav avatar slowli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elastic-elgamal's Issues

`PublicInfo<'_, Ristretto>` doesn't serialize easily

Feature request

I am trying to serialize the polynomials generated by participant.public_info().into_owned() to send them to different peers on a network.

error[E0277]: the trait bound `PublicInfo<'_, Ristretto>: Serialize` is not satisfied
   --> src/lib.rs:21:10
    |
21  | #[derive(Serialize, Deserialize, Debug)]
    |          ^^^^^^^^^ the trait `Serialize` is not implemented for `PublicInfo<'_, Ristretto>`
...
24  |     RequestPoly(PublicInfo<'a, Ristretto>),
    |                 ---------- required by a bound introduced by this call
    |
    = 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 133 others
note: required by a bound in `serialize_newtype_variant`
   --> /Users/tadad/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.188/src/ser/mod.rs:936:12
    |
936 |         T: Serialize;
    |            ^^^^^^^^^ required by this bound in `Serializer::serialize_newtype_variant`

error[E0277]: the trait bound `PublicInfo<'a, Ristretto>: Deserialize<'_>` is not satisfied
    --> src/lib.rs:24:17
     |
24   |     RequestPoly(PublicInfo<'a, Ristretto>),
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `PublicInfo<'a, Ristretto>`
     |
     = help: the following other types implement trait `Deserialize<'de>`:
               &'a Path
               &'a [u8]
               &'a str
               ()
               (T0, T1)
               (T0, T1, T2)
               (T0, T1, T2, T3)
               (T0, T1, T2, T3, T4)
             and 136 others
note: required by a bound in `newtype_variant`
    --> /Users/tadad/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.188/src/de/mod.rs:2117:12
     |
2117 |         T: Deserialize<'de>,
     |            ^^^^^^^^^^^^^^^^ required by this bound in `VariantAccess::newtype_variant`

I believe this might have something to do with Ristretto not implementing Serialize/Deserialize because PublicInfo does. You can serialize Ristretto elements with myElement.serialize_element() but that doesn't let you easily serialize a PublicInfo - maybe not at all, I'm still trying to get it to work. Also possible I'm just doing something wrong...let me know, thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.