pyecsca.ec.key_agreement module

class pyecsca.ec.key_agreement.KeyAgreement(mult, pubkey, privkey, hash_algo=None)[source]

Bases: object

An EC based key agreement primitive. (ECDH)

perform()[source]

Perform the key agreement operation.

Return type:bytes
Returns:The shared secret.
perform_raw()[source]

Perform the scalar-multiplication of the key agreement.

Return type:Point
Returns:The shared point.
class pyecsca.ec.key_agreement.ECDH_NONE(mult, pubkey, privkey)[source]

Bases: pyecsca.ec.key_agreement.KeyAgreement

Raw x-coordinate ECDH.

class pyecsca.ec.key_agreement.ECDH_SHA1(mult, pubkey, privkey)[source]

Bases: pyecsca.ec.key_agreement.KeyAgreement

ECDH with SHA1 of x-coordinate.

class pyecsca.ec.key_agreement.ECDH_SHA224(mult, pubkey, privkey)[source]

Bases: pyecsca.ec.key_agreement.KeyAgreement

ECDH with SHA224 of x-coordinate.

class pyecsca.ec.key_agreement.ECDH_SHA256(mult, pubkey, privkey)[source]

Bases: pyecsca.ec.key_agreement.KeyAgreement

ECDH with SHA256 of x-coordinate.

class pyecsca.ec.key_agreement.ECDH_SHA384(mult, pubkey, privkey)[source]

Bases: pyecsca.ec.key_agreement.KeyAgreement

ECDH with SHA384 of x-coordinate.

class pyecsca.ec.key_agreement.ECDH_SHA512(mult, pubkey, privkey)[source]

Bases: pyecsca.ec.key_agreement.KeyAgreement

ECDH with SHA512 of x-coordinate.