Skip to main content

verify_insert

Function verify_insert 

Source
pub fn verify_insert(
    registry: &SignerRegistry,
    fields: &InsertSignatureFields<'_>,
    canonical_payload: &[u8],
) -> Result<(), SignedWriteError>
Expand description

Top-level insert-time verification.

  1. Both columns must be present (else MissingSignatureFields).
  2. signer_pubkey must be exactly 32 bytes and a valid Ed25519 point encoding (else MalformedSignerPubkey).
  3. signature must be exactly 64 bytes (else MalformedSignature).
  4. signer_pubkey must be in the registry’s current allowed set (else UnknownSigner or RevokedSigner depending on history).
  5. The signature must verify against signer_pubkey over canonical_payload (else InvalidSignature).

canonical_payload is the engine’s content-hash encoding of the row WITHOUT the reserved signer_pubkey / signature columns — the same bytes the client signed.