How to use the fastecdsa.curve.P256 function in fastecdsa

To help you get started, we’ve selected a few fastecdsa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github csunny / py-bitcoin / core / wallet / wallet.py View on Github external
def new_keypair(self):
        """ 生成公私钥的键值对"""
        priv_key = keys.gen_private_key(curve.P256)

        pub_key = keys.get_public_key(priv_key, curve.P256)

        pub_key = "".join([str(pub_key.x), str(pub_key.y)])

        self.private_key = priv_key
        self.pub_key = pub_key
        return priv_key, pub_key
github csunny / py-bitcoin / core / wallet / wallet.py View on Github external
def new_keypair(self):
        """ 生成公私钥的键值对"""
        priv_key = keys.gen_private_key(curve.P256)

        pub_key = keys.get_public_key(priv_key, curve.P256)

        pub_key = "".join([str(pub_key.x), str(pub_key.y)])

        self.private_key = priv_key
        self.pub_key = pub_key
        return priv_key, pub_key
github libp2p / py-libp2p / libp2p / crypto / ecc.py View on Github external
def infer_local_type(curve: str) -> curve_types.Curve:
    """converts a ``str`` representation of some elliptic curve to a
    representation understood by the backend of this module."""
    if curve == "P-256":
        return curve_types.P256
    else:
        raise NotImplementedError()
github kendricktan / misocoin / misocoin / crypto.py View on Github external
def get_new_priv_key() -> str:
    '''
    Returns a random private key in hex format
    '''
    return '{:x}'.format(keys.gen_private_key(curve.P256))