Skip to content

randbelow_from_randbits no ValueError, kenral crashing #56

@ackaplan11

Description

@ackaplan11

r = SHA256(1)
r.randbelow_from_randbits(-1)

r = SHA256(1)
r.randbelow_from_randbits(-1)

Both of these function calls cause kernel errors in jupyterhub, and unlike in the docstring for randbelow_from_randbits, no ValueError is raised if n==0.

I suggest assert n > 0 is added

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