Skip to content

Instantly share code, notes, and snippets.

@paulmillr
paulmillr / pgp_proof.txt
Last active July 2, 2022 22:49
PGP verification
Proving ownership of
- paulmillr.com/pgp_proof.txt via paulmillr.com/pgp_proof.txt.asc
- twitter.com/paulmillr
- github.com/paulmillr via gist.github.com/paulmillr/cb3ad3b9cd4ac849eb1def3634f93421
- Active key: Paul Miller (PGP 697079DA6878B89B) from 3 Jul 2022
- Revoked key: Paul Miller (PGP 46BEEF337A641ABB) was active from 15 Apr 2020 to 2 Jul 2022
Full pubkey:

Hal Finney's explanation of secp256k1 "efficiently computable endomorphism" parameters used secp256k1 libraries, archived from source.

The same optimization could be applied to any Koblitz curve (e.g. Short Weistrass curve with a=0).


I implemented an optimized ECDSA verify for the secp256k1 curve, based on pages 125-129 of the Guide to Elliptic Curve Cryptography, by Hankerson, Menezes and Vanstone. I own the book but I also found a PDF on a Russian site which is more convenient.

secp256k1 uses the following prime for its x and y coordinates:

@paulmillr
paulmillr / BLS_Signature.md
Last active March 2, 2024 14:44
BLS Signature for Busy People

BLS Signature for Busy People

Summary

  • 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.

@paulmillr
paulmillr / grunt.js
Last active April 26, 2016 14:31
Gulp / grunt
module.exports = function ( grunt ) {
/**
* Load required Grunt tasks. These are installed based on the versions listed
* in `package.json` when you do `npm install` in this directory.
*/
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
routes = require './routes'
# Execute handler on document ready event.
jQuery ->
# Initialise new Chaplin application.
# Specify controller suffix for clarity.
new Chaplin.Application
controllerSuffix: '-controller', pushState: false, routes: routes
@paulmillr
paulmillr / github-languages-stats.json
Last active January 22, 2024 06:06
Most active GitHub users raw data
{
"Total": 910,
"my dms": 1,
"harbor is safe": 1,
"the Galaxy ": 1,
"Practice author": 1,
"Graph Representation Learning - rusty1s": 1,
"the PHP ecosystem": 1,
"software and to ensure that Python code is properly ported to Python 3": 1,
"Vienna - alanhamlett": 1,
@paulmillr
paulmillr / Gruntfile.js
Created September 11, 2012 10:11
yeoman default config
module.exports = function( grunt ) {
'use strict';
//
// Grunt configuration:
//
// https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
//
grunt.initConfig({
// Project configuration
@paulmillr
paulmillr / brunch-heroku-deploy.md
Last active March 29, 2019 23:12
Build & deploy brunch applications on Heroku.
  1. Add to .gitignore:

    node_modules
    public
    
  2. Add to your app dependencies of package.json:

@paulmillr
paulmillr / type-inference.coffee
Created July 17, 2012 17:39
Damas-Hindley-Milner type inference algorithm in LiveScript
# Algorithm W (Damas-Hindley-Milner) in LiveScript.
# By Paul Miller (paulmillr.com), Public domain.
#
# Based on Robert Smallshire's [Python code](http://bit.ly/bbVmmX).
# Which is based on Andrew's [Scala code](http://bit.ly/aztXwD).
# Which is based on Nikita Borisov's [Perl code](http://bit.ly/myq3uA).
# Which is based on Luca Cardelli's [Modula-2 code](http://bit.ly/Hjpvb).
# Something like that.
prelude = require './prelude'
@paulmillr
paulmillr / replace-to-dashes.coffee
Created June 9, 2012 14:33
Add dashes to CoffeeScript source. toString ⇒ to-string. Issue #2370
fs = require 'fs'
# Usage: coffee replace-to-dashes.coffee src/**/*
replaceFile = (path) ->
fs.readFile path, (error, data) ->
return console.log error if error?
result = data
.toString()
.replace /([a-z])([A-Z])([a-z])/g, ($0, $1, $2, $3) ->