Repository navigation
crypto: formats on codecs - one encode and decode for every key and signature format, mandatory verification policies, low S members, a typed x-only key - #20
Merged
Conversation
added 30 commits
November 30, 2026 17:02
…; the namespaces formats, signing_schemes and verification_policies are declared
…are rejoined, the signing_schemes docs agree
…n policy (low_s_only, any_s, canonical) each scheme declares; Ed25519's strict goes
… arity before the policies
…ehashed_signer::verify takes the policy, one row of policies per scheme, the guide's lookup sentence
… recoverable one flipping its recovery id; the free normalize_low_s and is_low_s go
…e members' briefs in llms.txt, the recoverable members in the allocation and Ethereum tests, text wraps
…' armor, one list, the verbs with crypto's check and the in-place PEM decode, proven on a toy type
…eir templates after the globals
…reasons and the default form tested on the toy, the DER buffer's wipe found by its address
…her call's address; forms_without_default's fix needs the default form listed, not first
… base58 dudect exception noted beside its program and in the testing page; choose_between's docstring says only the second input is read through a volatile
…nd pem over them; encode_spki, decode_spki, encode_pkcs8, decode_pkcs8 and their sizes go
…erence asks; the formats page's code span closed
added 27 commits
December 1, 2026 18:51
…rdering, verify, tweak_add and verify_tweak; the key pair, the public key and MuSig2 give it; the free tweak_xonly and the span verify go
… order of bytes without a nested conditional, the timing coverage of the x-only key in three functions, a Jamfile comment rewrapped
… check_policy's message, member and free (verify_xonly_any_s); MSVC twins of the x-only key's message tests; MuSig2's aggregate point read once; async_verify_named_backend passes a typed x-only key; verify_tweak's parity 2 and the x-only key's == pinned
…efault, the x-only key's raw, DER on the ECDSA signature; encode_spki and the size constants go The public key's raw (uncompressed by default, compressed, and raw(xonly) to encode only, its decode refused with xonly_into_public_key) and spki (88 bytes by default, a stored compressed SPKI of 56 still decoding, design R1); the x-only key's raw; the key pair's raw and pkcs8, secret, their key pair's context from the default memory resource, so that their decodes are not noexcept (the in-place PEM decode follows the inner value codec's noexcept and wipes its buffer on every path, an exception's included); the ECDSA signature's raw and der (libsecp256k1's strict DER, BIP66); the recoverable and the Schnorr signatures' raw, der refused with their reasons. Members on public_key, xonly_public_key and basic_keypair; public_key::encoded<N> is serialized<N>; curve_of_v of xonly_public_key. Removed: encode_spki, decode_spki, encode_pkcs8, decode_pkcs8, max_spki_size, max_pkcs8_size, spki_compressed_size, spki_uncompressed_size, to_der, from_der, max_der_size. Tests, node's crypto module as an oracle under Emscripten, seven fuzz targets, three message tests with their MSVC twins, timing coverage, constant-time paths, examples and pages on the new names.
… and the public key's coverage split, a resource pointer const, the fuzz Jamfile's comment rewrapped
…ry resource of the caller's (keypair::decode(format, input, resource), raw, pkcs8 and pem(pkcs8), one detail decode with the value codecs); a pem(pkcs8) decode whose resource throws wipes its buffers on the unwinding, pinned; DER's invalid_signature before a short span at the value codec; same_as_named in fuzz/target.hpp and one default-resource setter in test/support; each pair's refusal in secp256k1.adoc; secp256k1_der_size derived
…ng PEM; the private formats refused on an asynchronous backend, checked on every curve
…mor needing no backend; the formats tests' own WebCrypto stand-in goes, formats_asynchronous_test covering it; user_globals' stale libsodium utils include, the unused libsodium-base64 source and a seam comment's armour example go
…ames, the formats table generated from the one list
… test's checks split, the tags' own names, a trailing initializer kept on one line, the typo's verdict out of the call chain
…d with no unbound name
…the PEM bound's alone; P-256's points decompressed by crypto on BearSSL, a refused point invalid_encoding in spki; every removed name with its replacement; the formats chapter's pitfalls under their own heading and its title naming raw and DER; the WIF decode's wasip2 finding; a high-S peer signature normalized; the table test encodes a sample per pair, DER's shortest and each PEM's RFC 7468 size; the uploaded key's example
…ks in a function of their own, auto for the sample, a character overload
…bel whatever armor a hand-built pem_t holds; the noexcept, policy and verifying-key comments current
…rt (moved-from key pair, PEM variants and labels, DER framing and signatures, default forms, one block resource, one constant-time path, the text same_as_named); P-256 gains secp256k1's DER checks
… above n, the base58 dudect texts checked, a member noexcept(false) on an allocating foreign format, a comment rewrapped
…why not, and generate.py checks it and user_globals_test's include list
…ly types, can_verify's and prehashed_signer's policy; errors complete; README current; the uploaded-key use case wired; the WIF text compared in constant time
…split, a reserve, the foreign format's linkage stated
…d declared by their message tests, generate.py bounds a twin's path on the CI; X25519's PKCS#8 v2 case takes the key pair's public key; a stray comment dropped
…h its P-521 correction
…ecision of 2026-12-02); its ECDSA nonce leak stated as upstream's
…e bits2int fix submitted upstream
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
crypto's change formats (proposals: libraries/crypto/openspec/changes/formats), Tasks 1-14 of its plan.
prehashedincrypto::signing_schemes;crypto::verification_policies::low_s_only,any_s,canonical, a mandatory policy on every verify, async_verify and recover (a missing or wrong policy stops the build naming the accepted ones);is_low_s()/low_s()as members of the ECDSA signatures;curves::secp256k1::xonly_public_keyas a type.crypto::formats::raw(with the point forms compressed, uncompressed, xonly),spki,pkcs8,der,pem(...)over codecs' armor, registered as codecs value codecs for Ed25519, X25519, P-256 and secp256k1;crypto::encode/crypto::decodeand the members, with crypto's compile-time check and an in-place PEM decode; max_encoded_size and max_decode_input_size (owner decision 23); private results are codecs' secret types, wiped.strict, the freenormalize_low_s/is_low_s,encode_spki/decode_spki/encode_pkcs8/decode_pkcs8, the size constants,to_der/from_der, the freetweak_xonly, the spanverifyof schnorr,pem.hpp/crypto::pem/pem-default.Verification, all local, all green (constant-time lane included): five local lanes, Mac dudect, docs and tools tests, Linux constant-time / fuzz / c-suites, both full lints, MSVC 14.3 and 14.5 x64 debug, arm64 14.5 timing set (table: proposals' reference/STATUS.md). No CI ran: the owner's one CI on main comes at the end.
🤖 Generated with Claude Code