Skip to content

Instantly share code, notes, and snippets.


Paul Miller paulmillr

View GitHub Profile
paulmillr / expo.ts
Created Apr 9, 2020
Fast exponent 2_252_minus_3
View expo.ts
function pow_2_252_3_fast(t: bigint) {
const t0 = mod(t * t);
const t1 = mod(t0 ** 4n);
const t2 = mod(t * t1);
const t3 = mod(t0 * t2);
const t5 = mod(t2 * t3 * t3);
let t7 = t5;
for (let i = 0; i < 5; i++) {
t7 *= t7;
t7 %= P;
paulmillr /
Created Mar 31, 2020 — forked from hermanjunge/
BLS Signature for Busy People

BLS Signature for Busy People


  • BLS stands for

    • Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve.
    • Boneh-Lynn-Shacham: A Signature Scheme.
  • Signature Aggregation

    • It is possible to verify n aggregate signatures on the same message with just 2 pairings instead of n+1.
use std::env::args;
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;
use std::thread;
// grep 6 times faster than unix `grep` CLI
fn read_print(filename: String, matcher: String) {
let path = Path::new(&filename);

A simple file encryption tool & format

Filippo Valsorda (@FiloSottile) — Ben Cartwright-Cox (@Benjojo12)

Designed at the Recurse Center during NGW 2019

This is a design for a simple file encryption CLI tool, Go library, and format. It’s meant to replace the use of gpg for encrypting files, backups, streams, etc. It’s called "age", which might be an acronym for Actually Good Encryption, and it’s pronounced like the Japanese 上げ (with a hard g).

paulmillr / great_code.hs
Created May 4, 2012
Cool & pretty readable haskell code
View great_code.hs
data Cargo = Peasant
| Cabbage
| Wolf
| Goat
deriving (Eq, Enum, Show)
type ShoreState = [Cargo]
type Move = [Cargo]
type State = (ShoreState, ShoreState)
paulmillr / less.less
Created Mar 9, 2012
Sass vs Stylus vs LESS
View less.less
.border-radius (@radius) {
-webkit-border-radius: @radius;
-o-border-radius: @radius;
-moz-border-radius: @radius;
-ms-border-radius: @radius;
border-radius: @radius;
.user-list {
// need to use special `.` syntax
paulmillr /
Created Jul 17, 2012
Damas-Hindley-Milner type inference algorithm in LiveScript
# Algorithm W (Damas-Hindley-Milner) in LiveScript.
# By Paul Miller (, Public domain.
# Based on Robert Smallshire's [Python code](
# Which is based on Andrew's [Scala code](
# Which is based on Nikita Borisov's [Perl code](
# Which is based on Luca Cardelli's [Modula-2 code](
# Something like that.
prelude = require './prelude'
paulmillr /
Created Dec 22, 2015
Turn off spy cams in airbnb rentals
# Detect and Disconnect the DropCam and Withings devices some people are using to
# spy on guests in their home, especially in AirBnB rentals. Based on
# This script was named by Adam Harvey (, who also

Keybase proof

I hereby claim:

  • I am paulmillr on github.
  • I am paulmillr ( on keybase.
  • I have a public key whose fingerprint is E0B4 E9E1 A4B9 C96F 889E 6C6F 6128 0CD9 A383 C2E5

To claim this, I am signing this object:

paulmillr /
Created Sep 24, 2011
A plugin for Sublime Text 2 that replaces some symbols with their unicode equivalents.
# encoding: utf-8
import sublime
import sublime_plugin
class UnicodeTransformer(sublime_plugin.EventListener):
"""The transfrormer was tested with CoffeeScript code."""
_just_io = False # Determines if the file was just loaded / saved.
_is_saving = False
You can’t perform that action at this time.