Skip to content

MP_GEN_RANDOM() calling rand() might be insecure #103

@mkj

Description

@mkj

https://github.com/libtom/libtommath/blob/develop/tommath.h#L113
On non-BSD platforms MP_GEN_RANDOM() calls rand(). It's used by mp_rand() which is in turn used by RSA blinding. Is that secure?

It would probably be best for a crypto library should totally avoid calling rand() anywhere - it would be easy for someone to assume mp_rand() has good quality entropy.
It also raises a warning in Coverity.

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