import { type Bounds, type Result, type Tagged } from "@bounded-authority-protocol/verifier"; export declare const V3_REQUEST_PREFIX: Uint8Array; export declare const P256_COORDINATE_BYTES = 32; export declare const RAW_PUBLIC_KEY_BYTES = 65; export declare const RAW_SIGNATURE_BYTES = 64; export interface EcPublicJwk { readonly crv: "P-256"; readonly kty: "EC"; readonly x: string; readonly y: string; } /** The on-curve check the profile owns (REQ3-KEY-point-on-curve): y² ≡ x³ − 3x + b (mod p), 0 ≤ x,y < p. */ export declare function isOnCurveP256(x: Uint8Array, y: Uint8Array): boolean; /** The 65-byte uncompressed SEC1 point `0x04 || x || y` → the EC JWK (REQ3-KEY-uncompressed-sec1; REQ3-HEADER-proof-jwk). */ export declare function ecJwkFromRawPublicKey(raw: Uint8Array): EcPublicJwk; export declare function ecThumbprintPreimage(raw: Uint8Array): Uint8Array; /** RFC 7638 EC thumbprint, raw 32-byte digest. */ export declare function ecThumbprintRaw(raw: Uint8Array): Uint8Array; /** RFC 7638 EC thumbprint, unpadded base64url — the `cnf.jkt` spelling. */ export declare function ecThumbprint(raw: Uint8Array): string; export declare function v3RequestDigest(operation: string, castArguments: Tagged, bounds?: Bounds): Uint8Array; export type V3SelectorInput = "all" | { readonly kind: "all"; } | { readonly kind: "equals"; readonly path: readonly string[]; readonly value: Tagged; } | { readonly kind: "one_of"; readonly path: readonly string[]; readonly values: readonly Tagged[]; } | { readonly kind: "lte"; readonly path: readonly string[]; readonly value: Tagged; } | { readonly kind: "gte"; readonly path: readonly string[]; readonly value: Tagged; }; export interface V3OperationInput { readonly name: string; readonly selectors: readonly V3SelectorInput[]; } export interface GrantProducerV3 { readonly keyId: string; readonly issuer: string; readonly grantId: string; readonly audiences: readonly string[]; readonly issuedAt: number; readonly notBefore: number; readonly expiresAt: number; readonly holderThumbprint: string; readonly operations: readonly V3OperationInput[]; } export interface ProofProducerV3 { readonly holderPublicKey: Uint8Array; readonly proofId: string; readonly method: string; readonly targetUri: string; readonly issuedAt: number; readonly invocationId: string; readonly operation: string; readonly grantCompact: Uint8Array; readonly castArguments: Tagged; readonly nonce?: string; } export interface BoundaryAnchorProducerV3 { readonly anchorId: string; readonly anchoredAt: number; readonly chainId: string; readonly sequence: number; readonly chainHash: Uint8Array; readonly keyId: string; readonly publicKey: Uint8Array; } export interface KeyTransitionProducerV3 { readonly transitionId: string; readonly chainId: string; readonly effectiveAt: number; readonly currentKeyId: string; readonly currentPublicKey: Uint8Array; readonly nextKeyId: string; readonly nextPublicKey: Uint8Array; } export type V3SigningInputKind = "grant" | "proof" | "boundary_anchor" | "key_transition"; export interface V3SigningInput { readonly kind: V3SigningInputKind; readonly protectedSegment: Uint8Array; readonly payloadSegment: Uint8Array; } export declare function grantSigningInput(grant: GrantProducerV3, bounds?: Bounds): Result; export declare function proofSigningInput(proof: ProofProducerV3, bounds?: Bounds): Result; export declare function boundaryAnchorSigningInput(anchor: BoundaryAnchorProducerV3, bounds?: Bounds): Result; export declare function keyTransitionSigningInput(t: KeyTransitionProducerV3, bounds?: Bounds): Result; export declare function assembleCompact(input: V3SigningInput, signature: Uint8Array, bounds?: Bounds): Result;