pyecsca.ec.signature module¶
Provides an implementation of ECDSA (Elliptic Curve Digital Signature Algorithm).
- class SignatureResult(r, s)[source]¶
Bases:
object
ECDSA signature result (r, s).
-
r:
int
¶
-
s:
int
¶
-
r:
- class ECDSAAction(params, hash_algo, msg)[source]¶
Bases:
Action
An ECDSA action base class.
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶
-
msg:
bytes
¶
-
inside:
bool
¶
-
params:
- class ECDSASignAction(params, hash_algo, msg, privkey)[source]¶
Bases:
ECDSAAction
ECDSA signing.
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶
-
msg:
bytes
¶
-
inside:
bool
¶
-
params:
- class ECDSAVerifyAction(params, hash_algo, msg, signature, pubkey)[source]¶
Bases:
ECDSAAction
ECDSA verification.
-
signature:
SignatureResult
¶
-
params:
DomainParameters
¶
-
hash_algo:
Optional
[Any
]¶
-
msg:
bytes
¶
-
inside:
bool
¶
-
signature:
- class Signature(mult, params, add=None, pubkey=None, privkey=None, hash_algo=None)[source]¶
Bases:
object
EC based signature primitive (ECDSA).
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
add:
Optional
[AdditionFormula
]¶
-
hash_algo:
Optional
[Any
]¶
- property can_sign: bool¶
Whether this instance can sign (has a private key).
- property can_verify: bool¶
Whether this instance can verify (has a public key and add formula).
-
mult:
- class ECDSA_NONE(mult, params, add=None, pubkey=None, privkey=None)[source]¶
Bases:
Signature
ECDSA with raw message input.
- property can_sign: bool¶
Whether this instance can sign (has a private key).
- property can_verify: bool¶
Whether this instance can verify (has a public key and add formula).
- sign_data(data, nonce=None)¶
Sign data.
- Return type:
- sign_hash(digest, nonce=None)¶
Sign already hashed data.
- Return type:
- verify_data(signature, data)¶
Verify data.
- Return type:
bool
- verify_hash(signature, digest)¶
Verify already hashed data.
- Return type:
bool
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
add:
Optional
[AdditionFormula
]¶
-
hash_algo:
Optional
[Any
]¶
- class ECDSA_SHA1(mult, params, add=None, pubkey=None, privkey=None)[source]¶
Bases:
Signature
ECDSA with SHA1.
- property can_sign: bool¶
Whether this instance can sign (has a private key).
- property can_verify: bool¶
Whether this instance can verify (has a public key and add formula).
- sign_data(data, nonce=None)¶
Sign data.
- Return type:
- sign_hash(digest, nonce=None)¶
Sign already hashed data.
- Return type:
- verify_data(signature, data)¶
Verify data.
- Return type:
bool
- verify_hash(signature, digest)¶
Verify already hashed data.
- Return type:
bool
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
add:
Optional
[AdditionFormula
]¶
-
hash_algo:
Optional
[Any
]¶
- class ECDSA_SHA224(mult, params, add=None, pubkey=None, privkey=None)[source]¶
Bases:
Signature
ECDSA with SHA224.
- property can_sign: bool¶
Whether this instance can sign (has a private key).
- property can_verify: bool¶
Whether this instance can verify (has a public key and add formula).
- sign_data(data, nonce=None)¶
Sign data.
- Return type:
- sign_hash(digest, nonce=None)¶
Sign already hashed data.
- Return type:
- verify_data(signature, data)¶
Verify data.
- Return type:
bool
- verify_hash(signature, digest)¶
Verify already hashed data.
- Return type:
bool
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
add:
Optional
[AdditionFormula
]¶
-
hash_algo:
Optional
[Any
]¶
- class ECDSA_SHA256(mult, params, add=None, pubkey=None, privkey=None)[source]¶
Bases:
Signature
ECDSA with SHA256.
- property can_sign: bool¶
Whether this instance can sign (has a private key).
- property can_verify: bool¶
Whether this instance can verify (has a public key and add formula).
- sign_data(data, nonce=None)¶
Sign data.
- Return type:
- sign_hash(digest, nonce=None)¶
Sign already hashed data.
- Return type:
- verify_data(signature, data)¶
Verify data.
- Return type:
bool
- verify_hash(signature, digest)¶
Verify already hashed data.
- Return type:
bool
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
add:
Optional
[AdditionFormula
]¶
-
hash_algo:
Optional
[Any
]¶
- class ECDSA_SHA384(mult, params, add=None, pubkey=None, privkey=None)[source]¶
Bases:
Signature
ECDSA with SHA384.
- property can_sign: bool¶
Whether this instance can sign (has a private key).
- property can_verify: bool¶
Whether this instance can verify (has a public key and add formula).
- sign_data(data, nonce=None)¶
Sign data.
- Return type:
- sign_hash(digest, nonce=None)¶
Sign already hashed data.
- Return type:
- verify_data(signature, data)¶
Verify data.
- Return type:
bool
- verify_hash(signature, digest)¶
Verify already hashed data.
- Return type:
bool
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
add:
Optional
[AdditionFormula
]¶
-
hash_algo:
Optional
[Any
]¶
- class ECDSA_SHA512(mult, params, add=None, pubkey=None, privkey=None)[source]¶
Bases:
Signature
ECDSA with SHA512.
- property can_sign: bool¶
Whether this instance can sign (has a private key).
- property can_verify: bool¶
Whether this instance can verify (has a public key and add formula).
- sign_data(data, nonce=None)¶
Sign data.
- Return type:
- sign_hash(digest, nonce=None)¶
Sign already hashed data.
- Return type:
- verify_data(signature, data)¶
Verify data.
- Return type:
bool
- verify_hash(signature, digest)¶
Verify already hashed data.
- Return type:
bool
-
mult:
ScalarMultiplier
¶
-
params:
DomainParameters
¶
-
add:
Optional
[AdditionFormula
]¶
-
hash_algo:
Optional
[Any
]¶