gcpino.github.io G. Corpas Category: Systems & Physics December 2026

Guillermo Corpas — Selected Work & Technical Notes

Abstract

Physicist and software engineer working across systems programming, scientific computing, and machine learning.

1. Projects

Freestanding, zero-allocation implementation of the X-Wing hybrid post-quantum KEM (ML-KEM-768 + X25519), standalone NIST FIPS 203 ML-KEM-768, RFC 7748 X25519, and FIPS 202 SHA-3/SHAKE behind a crypto-agile vtable (~930 LOC).

Arithmetic
Division-free 40-bit Barrett mod 3329 + 5-limb radix-2^51 Curve25519, zero malloc/free
Benchmark
ML-KEM Encaps 55.1 us (133k cyc); X-Wing Encaps 126.0 us, Decaps 109.4 us (x86_64 -O3)
Verified
NIST ACVP FIPS 203, RFC 7748, IETF X-Wing KATs, dudect (|t| = 0.25), Cortex-M4 build
+ benchmark & verification output
$ make all test ct-check bench
[PASS] test_fips202: NIST SHA3-256, SHAKE256, and streaming XOF verified
[PASS] test_x25519:  RFC 7748 Sec 5.2 & 1,000-iter Monte Carlo verified
[PASS] test_mlkem:   NIST ACVP FIPS 203 KeyGen, Encaps, Decaps, Implicit-Reject & KeyCheck
[PASS] test_xwing:   IETF CFRG X-Wing (3/3 KATs) + hybrid tamper independence
[PASS] test_vtable:  Crypto-agile dispatch verified across X-Wing, ML-KEM-768, X25519
[DUDECT] X-Wing Decaps (valid vs reject) : |t| = 0.25 (threshold <= 4.5, N = 40000)
[DUDECT] X25519 Montgomery ladder        : |t| = 0.95 (threshold <= 4.5, N = 40000)

Scheme / Operation          |  pk (B) |  ct (B) |  sk (B) |  Cycles  |  us/op
----------------------------+---------+---------+---------+----------+------
X25519         KeyGen       |      32 |      32 |      32 |    84628 |  34.9
ML-KEM-768     KeyGen       |    1184 |    1088 |    2400 |   114977 |  47.9
ML-KEM-768     Encaps       |    1184 |    1088 |    2400 |   132866 |  55.1
ML-KEM-768     Decaps       |    1184 |    1088 |    2400 |   171625 |  73.3
X-Wing         Encaps       |    1216 |    1120 |      32 |   305008 | 126.0
X-Wing (esk)   Decaps       |    1216 |    1120 |    2464 |   258186 | 109.4

1.2. c-esp[C11]

Freestanding, zero-allocation IPsec ESP data-plane engine. Handles in-place packet encryption, 5-tuple policy matching, 1024-bit anti-replay with 64-bit sequence numbers, and make-before-break key rollover without any OS or heap dependencies.

Crypto
Constant-time ChaCha20-Poly1305 (6.81 cpb) and table-free AES-256-GCM
Footprint
1,944 B context + 516 B policy table, zero malloc/free
Verified
RFC 8439/7634/NIST vectors, dudect (|t| ≤ 1.95), ctgrind, libFuzzer
+ benchmark & verification output
$ make all test symbol-check ct-check benchmark
[PASS] test_rfc_vectors: RFC 8439, RFC 7634 App A, NIST AES-256-GCM
[PASS] test_replay_esn:  RFC 6479 1024-bit window & 64-bit ESN wrap
[PASS] test_rekey_fsm:   SA lifetimes, rollover, and key wipe
[PASS] test_spd:         RFC 4301 5-tuple selector engine
[PASS] Zero heap/OS symbols in build/libcesp.a
[DUDECT] |t| <= 1.95 (threshold <= 4.5)  |  [CTGRIND] 0 secret branches
[BENCH]  1400 B MTU: 6.81 cpb (ChaCha20-Poly1305)

Reorder Jitter | 64-bit Win | 256-bit Win | c-esp 1024-bit
---------------+------------+-------------+---------------
sigma =   0.0  |    0.00%   |    0.00%    |     0.00%
sigma =  32.0  |   13.64%   |    0.00%    |     0.00%
sigma = 128.0  |   68.52%   |   14.80%    |     0.04%
sigma = 384.0  |   88.64%   |   58.94%    |     6.45%

1.3. spsc[Rust]

Dependency-free, lock-free single-producer single-consumer ring buffer with zero hot-path allocation. Separates head and tail onto distinct 64-byte cache lines and caches peer indices to avoid unnecessary atomic loads.

Throughput
498.1 Mops/s (2.01 ns/op), 8.8x vs std::sync::mpsc::sync_channel
Design
Acquire/Release atomics, power-of-two bitmask, 2M-item stress test
+ benchmark output
$ cargo run --release --example bench
5,000,000 items, capacity 1024, 1 producer, 1 consumer:
  spsc (try_push/try_pop)          2.01 ns/op   498.1 Mops/s
  mpsc::sync_channel (send/recv)  17.75 ns/op    56.3 Mops/s

$ cargo test --release
stress test: 2,000,000 items across 2 threads (FIFO + checksum)... ok

Minimal neural-network inference runtime in pure C11 with no BLAS or external libraries. Exports trained PyTorch models into a compact binary format (.cinf) and runs forward passes inside a single pre-allocated arena.

Layers
Linear, Conv2D, MaxPool2D, Flatten, ReLU, Sigmoid, stable Softmax
Parity
< 1e-5 abs vs PyTorch (bit-exact pooling/flatten), 0 forward allocs
+ test suite output
$ make test
test_linear           [tol 1e-5]: OK
test_conv2d           [tol 1e-5]: OK
test_maxpool2d        [bit-exact]: OK
test_flatten          [bit-exact]: OK
test_relu             [tol 1e-6]: OK
test_softmax          [tol 1e-6]: OK
test_end_to_end       [tol 1e-5]: OK
test_no_alloc_forward [0 bytes]: OK
ALL TESTS PASSED (8/8)

Single-header C library (325 LOC) implementing three pre-allocated memory strategies over a 64-byte aligned slab: a bump arena, an O(1) fixed-size pool, and a first-fit coalescing heap.

Benchmark
Pool 3.46 ns/op vs 9.86 ns/op glibc; 16 B heap 7.22 ns/op vs 12.43 ns/op
Tests
38/38 passing (alignment, exhaustion, coalescing, double-free, NULL)
+ benchmark & test output
$ make bench
small alloc/free (16 B, 200k iters):   balloc 7.22 ns/op   | glibc 12.43 ns/op
mixed sizes (8-256 B, random free):    balloc 34.09 ns/op  | glibc 55.94 ns/op
fixed-size pool (64 B x 1024):         balloc 3.46 ns/op   | glibc  9.86 ns/op

$ make test
[arena] 11/11  |  [pool] 10/10  |  [heap] 17/17  ->  All tests PASSED

1.6. vault[C11]

Persistent key-value store (~605 LOC) with an FNV-1a hash table, POSIX read-write locks, append-only write-ahead log for crash recovery, snapshots, and a non-blocking Linux epoll TCP server.

Storage
1024-bucket chained hash table, WAL startup replay, snapshots
Protocol
Edge-triggered epoll TCP server + CLI (SET, GET, DEL, EXISTS, KEYS)
+ integration test output
$ make test
[vault] listening on port 9999
PASS: SET
PASS: GET
PASS: EXISTS
PASS: DEL

1.7. PINN[Python]

Physics-informed neural network solving the 1D heat equation (du/dt = alpha * d2u/dx2) without training data, by minimizing the PDE residual directly through PyTorch autograd.

Model
3x32 Tanh MLP on (x, t) in [0, 1]^2, IC sin(pi*x), BC u = 0
Accuracy
1.6e-3 relative L2 error vs exact Fourier solution (80x80 grid)
+ comparison plot vs analytical solution
PINN solution of the 1D heat equation compared with the analytical solution
Fig 1. Predicted field (left), exact Fourier solution (center), pointwise error (right).

2. About

I studied Physics and work as a software engineer focused on low-level systems, numerical modeling, and scientific machine learning.

I prefer small, self-contained tools built from first principles: predictable memory layouts, zero unnecessary dependencies, and verification against analytical solutions or standard test vectors.

3. Contact