Example #1
0
File: EC.py Project: pmp-p/M2Crypto
Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam.
All rights reserved."""

from M2Crypto import BIO, Err, EVP, m2, util
from typing import AnyStr, Callable, Dict, Optional, Tuple, Union  # noqa
from M2Crypto.EVP import PKey

EC_Key = bytes


class ECError(Exception):
    pass


m2.ec_init(ECError)

# Curve identifier constants
NID_secp112r1 = m2.NID_secp112r1  # type: int
NID_secp112r2 = m2.NID_secp112r2  # type: int
NID_secp128r1 = m2.NID_secp128r1  # type: int
NID_secp128r2 = m2.NID_secp128r2  # type: int
NID_secp160k1 = m2.NID_secp160k1  # type: int
NID_secp160r1 = m2.NID_secp160r1  # type: int
NID_secp160r2 = m2.NID_secp160r2  # type: int
NID_secp192k1 = m2.NID_secp192k1  # type: int
NID_secp224k1 = m2.NID_secp224k1  # type: int
NID_secp224r1 = m2.NID_secp224r1  # type: int
NID_secp256k1 = m2.NID_secp256k1  # type: int
NID_secp384r1 = m2.NID_secp384r1  # type: int
NID_secp521r1 = m2.NID_secp521r1  # type: int
Example #2
0
File: EC.py Project: mcepl/M2Crypto
Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.

Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam.
All rights reserved."""

from M2Crypto import BIO, Err, EVP, m2, util
if util.py27plus:
    from typing import AnyStr, Callable, Dict, Optional, Tuple, Union  # noqa

EC_Key = bytes


class ECError(Exception):
    pass

m2.ec_init(ECError)

# Curve identifier constants
NID_secp112r1 = m2.NID_secp112r1  # type: int
NID_secp112r2 = m2.NID_secp112r2  # type: int
NID_secp128r1 = m2.NID_secp128r1  # type: int
NID_secp128r2 = m2.NID_secp128r2  # type: int
NID_secp160k1 = m2.NID_secp160k1  # type: int
NID_secp160r1 = m2.NID_secp160r1  # type: int
NID_secp160r2 = m2.NID_secp160r2  # type: int
NID_secp192k1 = m2.NID_secp192k1  # type: int
NID_secp224k1 = m2.NID_secp224k1  # type: int
NID_secp224r1 = m2.NID_secp224r1  # type: int
NID_secp256k1 = m2.NID_secp256k1  # type: int
NID_secp384r1 = m2.NID_secp384r1  # type: int
NID_secp521r1 = m2.NID_secp521r1  # type: int