Skip to main content

Module tt_signature

Module tt_signature 

Source

ModulesΒ§

P256SignatureWithPreHash_flags πŸ”’

StructsΒ§

ClientDataJson πŸ”’
Minimal struct to deserialize only the fields we need from clientDataJSON. serde_json will ignore unknown fields and only parse type and challenge.
KeychainSignature
Keychain signature wrapping another signature with a user address. This allows an access key to sign on behalf of a root account.
P256SignatureWithPreHash
P256 signature with pre-hash flag
P256SignatureWithPreHashFlags
Fieldset that facilitates compacting the parent type. Used bytes: 1 | Unused bits: 7
WebAuthnSignature
WebAuthn signature with authenticator data
WebAuthnSignatureFlags
Placeholder struct for when there is no need for a fieldset. Doesn’t actually write or read any data.

EnumsΒ§

KeychainVersion
Keychain signature version.
KeychainVersionError
Keychain version validation error.
PrimitiveSignature
Primitive signature types that can be used standalone or within a Keychain signature. This enum contains only the base signature types: Secp256k1, P256, and WebAuthn. It does NOT support Keychain signatures to prevent recursion.
TempoSignature
AA transaction signature supporting multiple signature schemes

ConstantsΒ§

AT πŸ”’
ED πŸ”’
MIN_AUTH_DATA_LEN πŸ”’
P256N_HALF
Half of the P256 curve order (n/2).
P256_ORDER
The P256 (secp256r1/prime256v1) curve order n.
SIGNATURE_TYPE_KEYCHAIN
SIGNATURE_TYPE_KEYCHAIN_V2
SIGNATURE_TYPE_P256
Signature type identifiers Note: Secp256k1 has no identifier - detected by length (65 bytes)
SIGNATURE_TYPE_WEBAUTHN
UP πŸ”’
WebAuthn authenticator data flags (byte 32) ref: https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data
UV πŸ”’

FunctionsΒ§

derive_p256_address
Derives a P256 address from public key coordinates
normalize_p256_s
Normalize P256 signature s value to low-s form.
serialize_once_lock πŸ”’ serde
Helper function to serialize a OnceLock as an Option if it’s initialized.
verify_p256_signature_internal πŸ”’
Verifies a P256 signature using the provided components
verify_webauthn_data_internal πŸ”’
Parses and validates WebAuthn data, returning the message hash for P256 verification. ref: https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data