Signature Classes
Classes for handling ECDSA and EdDSA signatures.
Signature classes for TROPIC01 ECC signing operations.
- class tropicsquare.ecc.signature.Signature(r, s)[source]
Bases:
objectBase class for cryptographic signatures.
Represents a digital signature with R and S components as returned by TROPIC01 signing operations (ECDSA and EdDSA).
- Parameters:
- to_dict()[source]
Convert signature to dictionary.
- Returns:
Dictionary with R and S components
- Return type:
Example:
{ 'r': 'a1b2c3...', 's': 'd4e5f6...' }
- class tropicsquare.ecc.signature.EcdsaSignature(r, s)[source]
Bases:
SignatureECDSA signature from P256 curve signing operation.
Represents an ECDSA (Elliptic Curve Digital Signature Algorithm) signature created using the P256 curve. This signature can be verified using standard ECDSA verification with the corresponding public key.
The signature consists of two 32-byte components (R, S) that can be converted to DER encoding for use with standard cryptographic libraries.
Example:
signature = ts.ecdsa_sign(1, message_hash) print(signature.r.hex()) print(signature.s.hex())
- class tropicsquare.ecc.signature.EddsaSignature(r, s)[source]
Bases:
SignatureEdDSA signature from Ed25519 curve signing operation.
Represents an EdDSA (Edwards-curve Digital Signature Algorithm) signature created using the Ed25519 curve. This signature can be verified using standard Ed25519 verification with the corresponding public key.
The signature consists of two 32-byte components (R, S) that form the standard 64-byte Ed25519 signature format when concatenated.
Example:
signature = ts.eddsa_sign(0, message) print(signature.r.hex()) print(signature.s.hex())
Signature Types
EcdsaSignature - ECDSA signatures for P-256 curve
EddsaSignature - EdDSA signatures for Ed25519 curve
See Also
ECC Operations - ECC operations
ECC Constants - ECC constants