How apple/corecrypto works
corecrypto is a low-level cryptographic library used by Apple security frameworks and intended for varied environments, not a direct app-facing API. A typical use begins when a framework requests a cryptographic operation; the corresponding module performs it and returns bytes, keys, or a verification result. The repository includes symmetric and asymmetric cryptography, hashing, derivation and randomness, encoding, post-quantum algorithms, and FIPS self-tests. The README documents these capabilities and intended use; sampled source is limited, so detailed calls between algorithm modules are not inferred.
Main entry points: cc.h Core interfaces · fipspost_post.c FIPS self-tests · cc/src Runtime utilities · ccaes/src AES modes
Components 21
Core runtime
- Core interfaces
cc/corecrypto/cc.h - Runtime utilities
cc/src
Symmetric crypto
- AES modes
ccaes/src - ChaCha20-Poly1305
ccchacha20poly1305/src/ccchacha20poly1305.c - Other ciphers
ccblowfish/src
Public-key crypto
- Elliptic curves
ccec/src - Diffie-Hellman
ccdh/src - RSA
ccrsa/src - ECIES
ccecies/src - HPKE
cchpke/src/cchpke.c - Key encapsulation
cckem/src - ML-DSA
ccmldsa/src - ML-KEM
ccmlkem/src - Homomorphic encryption
cche/src
Crypto foundations
- Hash and digest
ccdigest/src - MAC and KDF
cchmac/src - Random generation
cckprng/src - Encoding and ASN.1
ccder/src
Validation and assurance
- FIPS self-tests
cc_fips/src/fipspost_post.c - Algorithm POSTs
cc_fips/src
Other components
- Security frameworks
Connections 19
- Security frameworks → Core interfaces: requests operation
- Core interfaces → AES modes: dispatches crypto
- Core interfaces → ChaCha20-Poly1305: dispatches crypto
- Core interfaces → Other ciphers: dispatches crypto
- Core interfaces → Elliptic curves: dispatches crypto
- Core interfaces → Diffie-Hellman: dispatches crypto
- Core interfaces → RSA: dispatches crypto
- Core interfaces → ECIES: dispatches crypto
- Core interfaces → HPKE: dispatches crypto
- Core interfaces → Key encapsulation: dispatches crypto
- Core interfaces → ML-DSA: dispatches crypto
- Core interfaces → ML-KEM: dispatches crypto
- Core interfaces → Hash and digest: dispatches crypto
- Core interfaces → MAC and KDF: dispatches crypto
- Core interfaces → Random generation: dispatches crypto
- Core interfaces → Encoding and ASN.1: dispatches crypto
- Core interfaces → Homomorphic encryption: dispatches crypto
- Core interfaces → Runtime utilities: uses runtime
- FIPS self-tests → Algorithm POSTs: runs checks