interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / crypto / README.md

61 lines · 3372 bytes Raw Blame History Source

native/crypto: in-house AES-256, POLYVAL, AES-256-GCM-SIV in C

A C (gnu11) port of crates/aienos-crypto: AES-256 encryption (FIPS 197), POLYVAL and AEAD_AES_256_GCM_SIV (RFC 8452), plus HMAC-SHA-256 with a 32-byte key. SHA-256 is the existing in-house copy in native/argus/sha256.c; there is no second SHA-256 here. No outside library. The library objects use no heap, no clock and no I/O (checked by make lib-checks with nm -u).

API: one header, aienos_crypto.h. Library: out/libaienos_crypto.a (includes the SHA-256 object).

Test

make -C native/crypto test        # lib-checks + known-answer + negative tests
make -C native/crypto sanitize    # same tests under ASan + UBSan
make -C native/crypto mutants     # optional: each GUARD rule removed must fail the tests
make -C native/crypto clean

OUT=<dir relative to native/crypto> moves build output. The test's last line is AIENOS_CRYPTO_NATIVE: PASS (exit 0) or AIENOS_CRYPTO_NATIVE: FAIL (exit 1).

Vectors are hard-coded in tests/crypto_test.c: all 24 RFC 8452 Appendix C.2 AES-256-GCM-SIV vectors and both C.3 counter-wrap vectors (each checked for record keys, POLYVAL result, tag and sealed output, then opened, opened in place, and tampered), RFC 8452 Section 7 and Appendix A POLYVAL examples, the FIPS 197 AES-256 block and full S-box, FIPS 180-2 SHA-256 examples, RFC 4231 HMAC cases 1 and 2, and every vector in the Rust crate's unit tests.

Behaviour worth knowing

Limitations