Skip to content

Instantly share code, notes, and snippets.

@briansmith
briansmith / install-rust-aarch64-apple-darwin.sh
Created Nov 20, 2020
Bootstrap a working native aarch64-apple-darwin Rust toolchain
View install-rust-aarch64-apple-darwin.sh
#!/bin/bash
# "Bash Strict Mode with logging"
set -eux -o pipefail
IFS=$'\n\t'
case $(uname -p) in
arm)
;;
*)
@briansmith
briansmith / how-to-generate-and-use-private-keys-with-openssl-tool.md
Last active Dec 3, 2020
How to generate & use private keys using the OpenSSL command line tool
View how-to-generate-and-use-private-keys-with-openssl-tool.md

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.

OpenSSL has a variety of commands that can be used to operate on private key files, some of which are specific to RSA (e.g. openssl rsa and openssl genrsa) or which have other limitations. Here we always use

View SECG-Curve-Seeds.txt
https://bitcointalk.org/index.php?topic=289795.msg3183975#msg3183975
https://bitcointalk.org/index.php?topic=289795.msg3191346#msg3191346
https://bitcointalk.org/index.php?topic=289795.msg3200275#msg3200275
SECG 1.0: http://www.secg.org/SEC2-Ver-1.0.pdf
ASCII "MinghuaQu"
1. secp112r1 00F50B028E|4D696E676875615175|290472783FB1
2. secp112r2 002757A111|4D696E676875615175|5316C05E0BD4
----| |
3. secp128r1 000E0D|4D696E676875615175|0CC03A4473D03679
View 2^((nBits `div` 2) - 100) apart
In[121]:= p = NextPrime[RandomInteger[{2^2047, 2^2048}]]
Out[121]= \
2472858022210415099164045402553368874951528885035736322800760410002954\
4038243222193098931418739578329762267040841916783150979034128645102130\
0253513299160810798121444406865510009715543992322555089967015541632378\
0710135209985817236443936777772937122422269799403563157416882656645382\
0161318776579572843028782784167357793642890306031876148210563553196737\
6550335038180588177627102411796625979142817323054655605301722206159897\
4290495880080776782541535829627114438988359115159634994645719944873859\
View example-crypto-bench-results.txt
Running target/release/crypto_bench_fastpbkdf2-33c7a66054d7f888
running 3 tests
test pbkdf2::hmac_sha1 ... bench: 18,086,881 ns/iter (+/- 192,553)
test pbkdf2::hmac_sha256 ... bench: 46,551,859 ns/iter (+/- 412,079)
test pbkdf2::hmac_sha512 ... bench: 59,626,892 ns/iter (+/- 2,230,720)
test result: ok. 0 passed; 0 failed; 0 ignored; 3 measured
Running target/release/crypto_bench_octavo-a3a92e776155ebd1
View onename
Verifying that +briansmith is my blockchain ID. https://onename.com/briansmith
View multiplication.txt
Copyright 2015 Brian Smith.
One Way to do Multi-precision Multiplication
============================================
You can’t perform that action at this time.