Skip to content

Instantly share code, notes, and snippets.

View unprovable's full-sized avatar
💭
Rubber ducked...

Mark C. unprovable

💭
Rubber ducked...
View GitHub Profile
@unprovable
unprovable / eml-checker.py
Created May 5, 2026 12:46
Checker for EML expressions
"""
EML expander and evaluator.
EML (Exp-Minus-Log) is the system from Odrzywolek (arXiv:2603.21852) in which
all elementary functions over C are built from the constant 1 and a single
binary operator
E(a, b) = exp(a) - log(b)
where log is the principal branch.
@unprovable
unprovable / Dockerfile
Created January 20, 2025 14:23
Dockerfile for PQC Apache
# You could just use https://github.com/open-quantum-safe/oqs-demos/tree/main/httpd ...
# but if you REALLY want ubuntu flavoured PQC... here's a working version of the script
# on this blog: https://medium.com/be-tech-with-santander/how-to-configure-post-quantum-cryptography-in-your-web-server-fcf79e05e526
# (theirs has a gnarly typo that is fixed below)
# This will PROBABLY BREAK when OpenSSL changes it's format for the default openssl.cnf file, but until then this should be good.
# -M.
# set some versions
ARG OPENSSL_TAG=openssl-3.4.0
@unprovable
unprovable / Breaking_XOR_QC.ipynb
Created November 23, 2021 12:35
Gist for Breaking XOR with Grover on Quantum Computers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
__author__ = "Mark Carney aka @LargeCardinal"
__copyright__ = "The Author"
__license__ = "MIT"
__status__ = "Proof of Concept - NOT FOR PRODUCTION"
import qiskit
from qiskit import IBMQ
import math
import sympy
@unprovable
unprovable / tikz-weihrauch-diagram.tex
Created August 2, 2019 12:30
LaTeX - TikZ Weihrauch Reducibility Commutative Diagram
\begin{center}
\begin{tikzpicture}[scale=2.5]
% reducing to
\node (1) at (0,1) {$\omega^\omega$};
\node (2) at (1.5,1) {$\textbf{U}$};
\node (3) at (0,0) {$\omega^\omega \rangle$};
\node (4) at (1.5,0) {$\textbf{V}$};
% reducing from
\node (A) at (-1.5,1) {$\omega^\omega$};
\node (B) at (-3,1) {$\textbf{X}$};
@unprovable
unprovable / mbedtls_gcm_esp32_example.ino
Last active November 5, 2025 16:43
MBEDTLS AES GCM example
// This is shockingly bad code... but I threw it together in ~4mins...
// because I couldn't find one anywhere and needed it for some ESP32 experimentation...
// See the MBED reference for this:
// https://tls.mbed.org/api/gcm_8h.html
#include "mbedtls/gcm.h"
void setup() {
Serial.begin(115200);
mbedtls_gcm_context aes;
@unprovable
unprovable / test.c
Created November 18, 2017 18:42
Arduino LCG play-set
#include <stdlib.h>
#include <stdio.h>
static int do_rand(unsigned long *ctx)
{
/*
* Compute x = (7^5 * x) mod (2^31 - 1)
* wihout overflowing 31 bits:
* (2^31 - 1) = 127773 * (7^5) + 2836
* From "Random number generators: good ones are hard to find",
@unprovable
unprovable / rand-period-test.c
Created November 17, 2017 17:09
Random Periodicity Test Code for arduino (compiled in Arduino IDE)
long rand_i, rand_j, rand_k;
unsigned long i = 0, j = 0, k = 0;
void setup() {
// put your setup code here, to run once:
rand_i = random();
rand_j = random();
rand_k = random();
Serial.begin(9600);
while (!Serial) {}
@unprovable
unprovable / RC-EntropyPool-testcode.c
Last active October 11, 2017 14:31
RC Entropy Pool - test circuit and code
// RC Entropy source...
// experimental code - NOT FOR USE IN PRODUCTION!!
// --- not proven to be anywhere close to CSPRNG nor TruRNG ---
// by Mark C (@LargeCardinal)
//
// So, a 1.2 to 1nF ceramic cap and 100Ohm resistor are placed in
// parallel across the A6 and GND pins. A fly wire from Digital
// pin 2 then goes to the A6 rail, powering the cap of 1nF and 100Ohm res
//
// In practice, it seems we really don't need the capacitor... maybe
@unprovable
unprovable / screenlog.0
Created October 8, 2017 12:27
Screen log from arduino nano RNG test
Random number test...
16807
282475249
1622650073
984943658
1144108930
470211272
101027544
1457850878
1458777923