(curve_order)
return random_int
Generates a random secret exponent.
Generates a random secret exponent.
Generates a random secret exponent .
def random_secret_exponent(curve_order):
    """ Generates a random secret exponent. """
    # run a rejection sampling algorithm to ensure the random int is less
    # than the curve order
    while True:
        # generate a random 256 bit hex string
        random_hex = binascii.hexlify(get_entropy(32))
        random_int = int(random_hex, 16)
        if random_int >= 1 and random_int < curve_order:
            break
    return random_int
def random_secret_exponent ( curve_order ) : # run a rejection sampling algorithm to ensure the random int is less # than the curve order while True : # generate a random 256 bit hex string random_hex = binascii . hexlify ( get_entropy ( 32 ) ) random_int = int ( random_hex , 16 ) if random_int >= 1 and random_int < curve_order : break return random_int