/** * Encode a 32-byte P-256 secret scalar as DER `ECPrivateKey` per * RFC 5915 §3. Output length is exactly 51 bytes; version is 1, the * named-curve OID for secp256r1 (`1.2.840.10045.3.1.7`, * SP 800-186 §3.2.1.3) is included in `parameters [0]`, and the * `publicKey [1]` field is omitted. * * Byte-stable: same input scalar produces byte-identical output. No * canonicalisation pass needed because every field has a single legal * DER encoding under the strict-DER rules of X.690 §10. * * @throws TypeError if `scalar` is not a Uint8Array * @throws RangeError if `scalar.length !== 32` */ export declare function encodeEcPrivateKey(scalar: Uint8Array): Uint8Array; /** * Decode a DER `ECPrivateKey` (RFC 5915 §3) and return the 32-byte * raw P-256 secret scalar. * * Strict-DER per X.690 §10 (Restrictions on the BER). Rejects the * cases enumerated in the file-level header. Accepts (and ignores) * an optional `publicKey [1]` field per RFC 5915 §3 lenient input; * the scalar is the only return value. * * Any curve OID inside `parameters [0]` other than secp256r1 * (`1.2.840.10045.3.1.7`) is rejected. Decoders that need other * curves must use a different parser; this library is P-256 only. * * @throws TypeError if `der` is not a Uint8Array * @throws Error on any DER syntax violation or unsupported parameter */ export declare function decodeEcPrivateKey(der: Uint8Array): Uint8Array;