This gist is currently under re-development after my most recent round of interview prep and will be re-posted with major edits soon.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ethereum helper methods | |
# source this in your .bashrc or .zshrc file with `. ~/.ethrc` | |
# --- Solidity sandbox --- | |
# https://github.com/maurelian/solidity-sandbox | |
scratch() { | |
dir=$(pwd) | |
cd ~/Documents/projects/solidity-sandbox || exit | |
bash newTest.sh $1 | |
cd "$dir" || exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a pedagogical implementation of curve25519 with ec-kcdsa | |
# coded by doctorevil to validate nxt's port of Matthijs van Duin's implementation | |
# warning: this implementation is not timing attack resistant | |
# ec arithmetic equations from http://hyperelliptic.org/EFD/g1p/auto-montgom.html | |
from hashlib import sha256 | |
from ecdsa.numbertheory import square_root_mod_prime, SquareRootError, inverse_mod | |
CURVE_P = 2**255 - 19 | |
CURVE_A = 486662 |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Two space soft indents (fake tabs) OR tabs... BUT NEVER BOTH - DO NOT MIX | |
2. Whitespace, Parens, Braces, Linebreaks | |
if/else/for/while/try always have spaces, braces and multiple lines. | |
-------------------------------------------------------------------- | |