Git Product home page Git Product logo

Comments (5)

hdevalence avatar hdevalence commented on September 28, 2024

While we're fixing up Scalar::random, maybe we should get rid of it entirely? I think there's a trait from the rand crate that types can implement in order to be "randomly generable" by any RNG.

from curve25519-dalek.

hdevalence avatar hdevalence commented on September 28, 2024

Looking into it a bit, I think that what that would look like is implementing a Distribution https://docs.rs/rand/0.5.4/rand/distributions/trait.Distribution.html for Scalars, which people would call sample on. There's also a provided sample_iter, which could be more convenient for generating sequences than what we're doing now.

from curve25519-dalek.

isislovecruft avatar isislovecruft commented on September 28, 2024

I'm not sure exactly what that would look like? impl rand::distributions::Distribution<Scalar> for Uniform? But Uniform is their type, so the orphan rules will hate us, so we'd need to create our own Uniform type.. it sounds slightly messy. That should probably be a new issue in any case.

from curve25519-dalek.

isislovecruft avatar isislovecruft commented on September 28, 2024

This is fixed in #167.

from curve25519-dalek.

hdevalence avatar hdevalence commented on September 28, 2024

We'd define our own distribution type and implement the trait for it.

from curve25519-dalek.

Related Issues (20)

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.