Skip to content

Proper Initialization of SketchImpl #93

Open
@JeremyRubin

Description

@JeremyRubin

std::random_device rng;
std::uniform_int_distribution<uint64_t> dist;
m_basis = m_field.FromSeed(dist(rng));

I noticed that minisketch is using std::uniform_int_distribution and std::random_device... might make sense to do seeding as an input parameter as std::random_device might, on some platforms, give you the same seed for every object made. Then users of the library can use their own high-quality entropy.

Also of note: std::uniform_int_distribution can be platform dependent (in case any tests against vectors or other behavior are supposed to rely on a specific value being generated). May be better to swap it for a custom implementation, or drop it entirely -- it should be possible to directly use e.g. FastRandomContext.rand64() for uniform over 64 bits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions