Repository navigation
FAQ
Because the point of the project is the implementation. It is a from-scratch X.509, ASN.1 and cryptography library, and a wrapper around someone else's primitives would not be that.
The practical consequence is the next question's answer, and you should read it before choosing this library for anything.
It is not audited. Parts are constant-time by construction and document themselves as such; parts explicitly are not, and also say so. The Integration Guide has the inventory.
It is also still early-stage — version 1.0.1, with interfaces that may change. Judge it accordingly. It is honest about what it does and does not do, which is more than the audit status alone tells you, but neither is a substitute for a review by someone who is not the author.
Because every field operation on the prime and binary curves goes through
CBigNum's schoolbook long division, and nothing caches the per-modulus
reduction constants that would avoid it. Ed25519 verification takes about
35 ms where an optimized implementation takes 50–100 µs.
The control that proves the diagnosis is X25519 in the same build: 246 µs,
because it runs on a dedicated Fe25519 field type rather than on CBigNum.
Ed25519 has since been migrated the same way. The remaining curves have not.
docs/roadmap.md
sets out the three tiers of the fix.
Hashing, symmetric ciphers and the AEADs are unaffected — those have hardware-accelerated paths and are not where the time goes.
No, and the distinction matters. CCertCollection::buildChain() orders
certificates by who issued whom, and verifyLinks() additionally checks each
link's signature. Neither is path validation.
A path validator also checks validity periods, basicConstraints (cA and
pathLenConstraint), keyUsage, extendedKeyUsage, name constraints, policy
constraints and revocation, and decides whether the root is one you trust. None
of that happens in this library yet. An ordered chain says "these certificates
claim to form a chain", which is what a container format needs to store and
what a validator needs as input.
If you need validation today, you have to write that layer yourself on top of these pieces.
Certificates (DER and PEM), CRLs, OCSP requests and responses (RFC 6960),
PKCS#10 certificate-signing requests, and certificate collections through
IChainFormat — PEM today, with PKCS#12/PFX being built.
It does, and that is a real hazard. ERET_OK = 0, so a truthiness test on an
ERetCode is inverted. Compare against ERET_OK explicitly, every time.
Because an output SByteSpan carries capacity in and length out: the
callee narrows .size to what it actually wrote. Carry the narrowed size
forward; the sizeof of your buffer is not the length of the result. This is
the single most common way to produce a signature that verifies against
nothing.
Append it, never insert it. The enumerators cross a shared-object boundary, so
inserting one renumbers every value after it and a consumer compiled against
the old header silently means something different by the same number.
EHashers carries a comment saying exactly this — EHASH_MD4 sits at the end
rather than next to EHASH_MD5, where it would read better and break the ABI.
CBigNum is general-purpose modular arithmetic. Fe25519 is arithmetic in the
single field 2^255−19, which is what makes it fast enough to be usable.
They are deliberately not interconvertible, because Edwards curves work with two different moduli — the field prime and the group order L — and a bug that uses one where the other belongs is invisible in the result. Keeping them as separate types means that mistake does not compile.
By design: the arithmetic methods mutate *this and return a reference so they
can be chained. Copy first if you still need the original. The same applies to
CGf2m.
Yes. Most documents have a <name>.ko.md beside them — README.ko.md,
specs/recipes.ko.md, and so on. English is the source of truth and the two
move together; identifiers are never translated.
MIT.
Open an issue at github.com/jay94ks/libcertpp.
The most useful bug reports against this library have been the ones that brought a published test vector or a real certificate the library gets wrong. This project's recurring failure mode is being self-consistent and wrong — round-tripping its own output proves nothing about interoperability — so anything that comes from outside the library is worth far more than a report that its own pieces disagree.