Skip to content
Jay edited this page Oct 3, 2026 · 1 revision

FAQ

Why implement the cryptography from scratch instead of using OpenSSL?

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.

Is it audited? Can I use it in production?

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.

Why are signatures so slow?

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.

Does it do certificate chain validation?

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.

What formats can it read and write?

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.

Why is ERET_OK zero? if (rc) reads backwards.

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.

Why do output buffers come back with a different size?

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.

Can I add a value to one of the E* enums?

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.

Why are there two big-integer types?

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.

Why does CBigNum::add() change the object I called it on?

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.

Is there Korean documentation?

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.

What is the license?

MIT.

How do I report a bug?

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.

Clone this wiki locally