httk.core.crypto¶
Ed25519 signing with an optional accelerated backend.
These signing primitives are used by project identity and trust.
All private keys accepted and returned by this module are standard 32-byte
Ed25519 seeds. The stdlib implementation follows RFC 8032 and is kept as a
portable fallback; cryptography is used automatically when installed.
Functions¶
|
Return whether backend can perform Ed25519 operations. |
Generate a standard 32-byte Ed25519 private seed. |
|
|
Derive the public key for a private seed. |
|
Return an RFC 8032 Ed25519 signature for |
|
Return whether |
Module Contents¶
- httk.core.crypto.ed25519_backend_available(backend='cryptography')[source]¶
Return whether backend can perform Ed25519 operations.
- Parameters:
backend (str) – Backend name:
"cryptography","pure", or"stdlib".- Returns:
Whether the selected backend is available.
- Raises:
ValueError – If
backendis not a supported backend name.- Return type:
- httk.core.crypto.ed25519_generate_seed()[source]¶
Generate a standard 32-byte Ed25519 private seed.
- Returns:
A newly generated private seed.
- Return type:
- httk.core.crypto.ed25519_public_key(seed, *, backend=None)[source]¶
Derive the public key for a private seed.
- Parameters:
- Returns:
The 32-byte Ed25519 public key.
- Raises:
ValueError – If
seedis not exactly 32 bytes orbackendis unsupported.ImportError – If the requested
cryptographybackend is unavailable.
- Return type:
- httk.core.crypto.ed25519_sign(seed, message, *, backend=None)[source]¶
Return an RFC 8032 Ed25519 signature for
message.- Parameters:
- Returns:
The 64-byte Ed25519 signature.
- Raises:
ValueError – If
seedis not exactly 32 bytes orbackendis unsupported.ImportError – If the requested
cryptographybackend is unavailable.
- Return type:
- httk.core.crypto.ed25519_verify(public_key, message, signature, *, backend=None)[source]¶
Return whether
signatureis valid, treating malformed input as false.- Parameters:
- Returns:
Whether the signature verifies for the public key and message.
- Raises:
ValueError – If
backendis unsupported.ImportError – If the requested
cryptographybackend is unavailable.
- Return type: