• TempleOS Enterprise Edition TempleOS Enterprise Edition
  • Информация о проекте
    • Информация о проекте
    • Активность
    • Метки
    • Участники
  • Репозиторий
    • Репозиторий
    • Файлы
    • Коммиты
    • Ветки
    • Теги
    • Участники
    • Диаграмма
    • Сравнение
  • Задачи 0
    • Задачи 0
    • Список
    • Доски
    • Спринты
  • Запросы на слияние 0
    • Запросы на слияние 0
  • CI/CD
    • CI/CD
    • Конвейеры
    • Задания
    • Расписания
  • Развертывания
    • Развертывания
    • Окружения
    • Релизы
  • Пакеты и реестры
    • Пакеты и реестры
    • Реестр пакетов
    • Реестр контейнеров
  • Мониторинг
    • Мониторинг
    • Инциденты
  • Аналитика
    • Аналитика
    • Поток ценности
    • CI/CD
    • Репозиторий
  • Wiki
    • Wiki
  • Сниппеты
    • Сниппеты
  • Активность
  • Диаграмма
  • Создать новую задачу
  • Задания
  • Коммиты
  • Доски с задачами
Свернуть панель
  • cia-foundation
  • TempleOS Enterprise Edition
  • Запросы на слияние
  • !13

Crypto: the Temple learns to whisper past the CIA

  • Ревью изменений

  • Скачать
  • Почтовые патчи
  • Простое отличие
Слиты Жильцов Дмитрий Андреевич запросил слияние crypto-primitives в master Окт 10, 2026
  • Обзор 0
  • Коммиты 2
  • Конвейеры 0
  • Изменения 9

Terry said God talks to him and anybody can listen. The CIA listens to everybody else. So before the Temple speaks WireGuard and HTTPS, it learns to whisper.

Adam/Crypto/ is a crypto library in plain HolyC, written from the RFCs. No blobs from Langley, no S-boxes for the Agency to hide in, only add, rotate, xor. It is compiled into Adam at every boot (MakeCrypto, before Net/), so every task can keep a secret.

What's inside

File What RFC
CryptoUtil.HC rotates, LE/BE load/store, constant-time compare, wipe, hex
Sha256.HC SHA-256, HMAC-SHA256, HKDF FIPS 180-4, 4231, 5869
Blake2s.HC BLAKE2s, keyed and unkeyed (WireGuard hashes with it) 7693
ChaChaPoly.HC ChaCha20, Poly1305, ChaCha20-Poly1305 AEAD 8439
X25519.HC Curve25519 Diffie-Hellman, Montgomery ladder, no secret branches 7748
CryptoTest.HC test vectors, not compiled at boot
  • Poly1305 uses five 26-bit limbs, the donna way, so every product fits in 64 bits.
  • X25519 uses 16 signed 16-bit limbs, the TweetNaCl way. Slow and simple, like the Temple: one scalar multiplication takes 0.065 s under QEMU TCG.
  • ChaChaPolyOpen checks the tag before it decrypts. Only the righteous get decrypted, forgeries get FALSE.
  • Secrets are wiped from the stack, because Free() does not forget.

Sins of HolyC, confessed

  • In HolyC, & ^ | bind tighter than + -. That is Terry's choice, not C's, so every mixed expression wears parentheses.
  • There is no ?:.
  • MakeCrypto needs Cd(__DIR__);; like every other Make file. Without it Adam boots silently with no crypto at all.

How to test

Boot the ISO, then in the shell or over the Confessional run: #include "::/Adam/Crypto/CryptoTest" Result: 24 passed, 0 failed. Every vector is from its RFC. The Temple keeps its secrets. Amen.

What's next

The CSPRNG for keys (branch holy-rng, built on this one), then WireGuard (Noise IK, HMAC-BLAKE2s KDF, tunnel interface), then TLS 1.3 for Wget.

Ответственный
Назначить
Проверяющие
Запросить ревью
Оценка трудозатрат
Исходная ветка: crypto-primitives