pyecsca.ec.key_agreement module¶
Provides an implementation of ECDH (Elliptic Curve Diffie-Hellman).
- class ECDHAction(params, hash_algo, privkey, pubkey)[source]¶
Bases:
ResultAction
ECDH key exchange.
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶
- exit(result)¶
- property result: Any¶
-
inside:
bool
¶
-
params:
- class KeyAgreement(mult, params, pubkey, privkey, hash_algo=None)[source]¶
Bases:
object
EC based key agreement primitive (ECDH).
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶
-
mult:
- class ECDH_NONE(mult, params, pubkey, privkey)[source]¶
Bases:
KeyAgreement
Raw x-coordinate ECDH.
- perform()¶
Perform the key agreement operation.
- Return type:
bytes
- Returns:
The shared secret.
- perform_raw()¶
Perform the scalar-multiplication of the key agreement.
- Return type:
- Returns:
The shared point.
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶
- class ECDH_SHA1(mult, params, pubkey, privkey)[source]¶
Bases:
KeyAgreement
ECDH with SHA1 of x-coordinate.
- perform()¶
Perform the key agreement operation.
- Return type:
bytes
- Returns:
The shared secret.
- perform_raw()¶
Perform the scalar-multiplication of the key agreement.
- Return type:
- Returns:
The shared point.
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶
- class ECDH_SHA224(mult, params, pubkey, privkey)[source]¶
Bases:
KeyAgreement
ECDH with SHA224 of x-coordinate.
- perform()¶
Perform the key agreement operation.
- Return type:
bytes
- Returns:
The shared secret.
- perform_raw()¶
Perform the scalar-multiplication of the key agreement.
- Return type:
- Returns:
The shared point.
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶
- class ECDH_SHA256(mult, params, pubkey, privkey)[source]¶
Bases:
KeyAgreement
ECDH with SHA256 of x-coordinate.
- perform()¶
Perform the key agreement operation.
- Return type:
bytes
- Returns:
The shared secret.
- perform_raw()¶
Perform the scalar-multiplication of the key agreement.
- Return type:
- Returns:
The shared point.
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶
- class ECDH_SHA384(mult, params, pubkey, privkey)[source]¶
Bases:
KeyAgreement
ECDH with SHA384 of x-coordinate.
- perform()¶
Perform the key agreement operation.
- Return type:
bytes
- Returns:
The shared secret.
- perform_raw()¶
Perform the scalar-multiplication of the key agreement.
- Return type:
- Returns:
The shared point.
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶
- class ECDH_SHA512(mult, params, pubkey, privkey)[source]¶
Bases:
KeyAgreement
ECDH with SHA512 of x-coordinate.
- perform()¶
Perform the key agreement operation.
- Return type:
bytes
- Returns:
The shared secret.
- perform_raw()¶
Perform the scalar-multiplication of the key agreement.
- Return type:
- Returns:
The shared point.
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶