Skip to content

Validation Algorithms #2

Description

@hairyharryspider

Return true will break out of the function

Should be or and not and

     if not (is_prime(p) and is_prime(q)):
        return False
     if not (powmod(g, q, p) == 1 and g > 1 and (p - 1) % q == 0):
        return False
     return True


def validate_sign(r, s, q):
    if r <= 0 or r >= q:
        return False
    if s <= 0 or s >= q:
        return False
    return True```

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions