This directory contains implementations of crypto primitives for use in Chromium. Most of these are either:
There is very little actual cryptographic code in //crypto - it is mostly wrappers.
This directory is actively being refactored as of 2025-06. SeePLAN.md.
Many interfaces in this directory are deprecated and being changed or removed; check the comment at the top of the header file before using them.
vector<uint8_t>
,array<uint8_t>
, andspan<uint8_t>
rather thanstring
andstring_view
.keypair::PrivateKey::ToPrivateKeyInfo()
, which returns aPKCS#8 PrivateKeyInfo structure serialized as a byte vector. To unserialize keys in this format, usekeypair::PrivateKey::FromPrivateKeyInfo()
.keypair::PublicKey::ToSubjectPublicKeyInfo()
orkeypair::PrivateKey::ToSubjectPublicKeyInfo()
, which return aX.509 SubjectPublicKeyInfo structure serialized as a byte vector. To unserialize public keys in this format, usekeypair::PublicKey::FromPublicKeyInfo()
.vector<uint8_t>
,array<uint8_t>
, orspan<uint8_t>
directly.