Esempio n. 1
0
    def __init__(self, key: Union[int, bytes]) -> None:
        #If a nickname was specified, generate a consistent Private Key based on it.
        if isinstance(key, int):
            key = blake2b(key.to_bytes(2 if key > 255 else 1, "little"),
                          digest_size=32).digest()

        key = key.rjust(48, b'\0')
        self.value: Big384 = Big384()
        MilagroCurve.BIG_384_58_fromBytesLen(self.value, c_char_p(key), 48)
        MilagroCurve.BIG_384_58_mod(self.value, r)
Esempio n. 2
0
 def __init__(self, key: bytes) -> None:
     key = key.rjust(48, b'\0')
     self.value: Big384 = Big384()
     MilagroCurve.BIG_384_58_fromBytesLen(self.value, c_char_p(key), 48)
     MilagroCurve.BIG_384_58_mod(self.value, r)