# security -- Crypto Primitives

Compact cryptographic primitives used by the secLink wrapper: 1024-bit
Diffie-Hellman key exchange (RFC 2409 Group 2), XTEA block cipher in CTR
mode for session encryption, and an XTEA-CTR-based DRBG for session key
and IV generation.  No external dependencies.

## Documentation

Full reference is in the combined serial stack doc:
`../serial.dhs` (the `security` section).  It compiles into the DVX
System Reference -- open via the Help Viewer app, or read
`docs/dvx_system_reference.html` after `make`.

Topics covered: DH handshake API, XTEA-CTR encrypt/decrypt, DRBG seeding
and reseeding, remote-key validation range, threat model.

## Source Files

- `security.h`   -- public API (DH, XTEA-CTR, DRBG)
- `security.c`   -- implementation (bignum, Montgomery modexp, XTEA)

## Build

`make -C src/libs/kpunch/serial/security` (invoked by the top-level
`make` via the serial subdirectory).
