inkfish/proof_of_time.py
def generate_r_value(x, y, sqrt_mu, int_size_bits):
    """creates an r value by hashing the inputs"""
    if isinstance(x, ClassGroup):
        s = serialize_proof([x, y, sqrt_mu])
    else:
        int_size = int_size_bits // 8
        s = (x.to_bytes(int_size, "big", signed=False) +
             y.to_bytes(int_size, "big", signed=False) +
             sqrt_mu.to_bytes(int_size, "big", signed=False))
    b = hashlib.sha256(s).digest()
    return int.from_bytes(b[:16], "big")
creates an r value by hashing the inputs
creates an r value by hashing the inputs
creates an r value by hashing the inputs
def generate_r_value(x, y, sqrt_mu, int_size_bits):
    if isinstance(x, ClassGroup):
        s = serialize_proof([x, y, sqrt_mu])
    else:
        int_size = int_size_bits // 8
        s = (x.to_bytes(int_size, "big", signed=False) +
             y.to_bytes(int_size, "big", signed=False) +
             sqrt_mu.to_bytes(int_size, "big", signed=False))
    b = hashlib.sha256(s).digest()
    return int.from_bytes(b[:16], "big")
def generate_r_value ( x , y , sqrt_mu , int_size_bits ) : if isinstance ( x , ClassGroup ) : s = serialize_proof ( [ x , y , sqrt_mu ] ) else : int_size = int_size_bits // 8 s = ( x . to_bytes ( int_size , "big" , signed = False ) + y . to_bytes ( int_size , "big" , signed = False ) + sqrt_mu . to_bytes ( int_size , "big" , signed = False ) ) b = hashlib . sha256 ( s ) . digest ( ) return int . from_bytes ( b [ : 16 ] , "big" )
creates an r value by hashing the inputs
creates an r value by hashing the inputs
"""creates an r value by hashing the inputs"""
x
y
sqrt_mu
int_size_bits