Micro-toolkit

microcrypt

Firmware sometimes needs small standalone cryptographic primitives.

C99 cryptographic primitives: SHA-256, HMAC-SHA256, AES-128, AES-128-CBC and AES-128-GCM with AEAD, AAD and secure-clearing helpers.

Stablev3.0.1MITC99
Last verified
2026-08-14
Platform scope
Portable C99; integration depends on caller-provided adapters

What it solves

Firmware sometimes needs small standalone cryptographic primitives.

How it works

1Bytes2checked primitive3digest / block output

Use it when

Hash a firmware buffer
Compute and verify HMAC-SHA256
Use AES-128-GCM through its documented AEAD interface

Quick Start

#include "mcrypt.h"
uint8_t digest[MCRYPT_SHA256_DIGEST_SIZE];
mcrypt_status_t s=mcrypt_sha256("abc",3,digest);
/* Expected: s == MCRYPT_OK and digest contains SHA-256("abc"). */

Engineering evidence

  • Repository documents tests, verification information and the v3.0.1 API surface

Known limits

  • No audit, proof, FIPS or side-channel-resistance claim
  • Table-based AES is unsuitable against observable cache/timing/power attackers
  • Follow documented nonce and key requirements