Skip to content

Instantly share code, notes, and snippets.

View recmo's full-sized avatar

Remco Bloemen recmo

View GitHub Profile
(function(){window.renderMath=function(){renderMathInElement(document.body,{delimiters:[{left:'$$',right:'$$',display:true},{left:'$',right:'$',display:false}],throwOnError:false});};if(!window.katex){css=document.createElement('link');css.rel='stylesheet';css.href='https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.css';css.crossorigin='anonymous';script=document.createElement('script');script.src='https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.js';script.async=false;script.crossorigin='anonymous';copyTex=document.createElement('script');copyTex.src='https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/copy-tex.min.js';copyTex.async=false;copyTex.crossorigin='anonymous';autoRender=document.createElement('script');autoRender.src='https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/auto-render.min.js';autoRender.async=false;autoRender.onload=window.renderMath;autoRender.crossorigin='anonymous';document.head.appendChild(css);document.head.appendChild(script);document.head.appendChild(copyTe
DUP2 899407
PUSH1 718627
PUSH2 718557
ADD 686328
JUMPDEST 573198
POP 457984
JUMPI 436369
MSTORE 328876
SWAP1 326765
MLOAD 315104
@recmo
recmo / keccak-aarch64.rs
Last active October 17, 2023 23:17
Rust aarch64 FEAT_SHA3 implementation of keccak_f1600.
#![cfg(all(target_arch = "aarch64", target_feature = "sha3"))]
use core::arch::asm;
const RC: [u64; 24] = [
0x0000000000000001,
0x0000000000008082,
0x800000000000808a,
0x8000000080008000,
0x000000000000808b,
0x0000000080000001,
@recmo
recmo / attestation.txt
Created April 8, 2022 17:11
Attestation
I contributed to the Semaphore Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: semaphore16
Contributor # 250
Hash: c293791b 1806dea5 2b5eb5df 876a8690
1bd6fd3b 642e1193 066254c2 53932eb5
53e990b7 6dd80e26 a5b9e65e f8fd90b7
94a06997 000dc2ad 4e4032f1 a87718fc
@recmo
recmo / book.toml
Created January 21, 2021 16:59
Katex in mdbook
[book]
authors = ["Remco Bloemen"]
language = "en"
multilingual = false
src = "src"
[build]
create-missing = false
[preprocessor.html]
@recmo
recmo / ShardToken.sol
Created January 30, 2019 21:16
ShardToken: Actor Model through Cousin Proofs
contract ShardToken {
address OWNER;
address ROOT;
uint256[] ANCESTRY_PROOF;
address owner;
uint256 next_nonce;
uint256 balance;
@recmo
recmo / MerkleVerifier.sol
Created January 29, 2019 23:24
Merkle multi-queries
contract MerkleVerifier {
function hash_leaf(uint256 value)
internal pure
returns (bytes32 hash)
{
return bytes32(value);
}
function hash_node(bytes32 left, bytes32 right)
@recmo
recmo / lending.sol
Created November 21, 2018 12:38
Lending contracts having state invariants depending on call stack.
// Simple lending contract demostrating complex call-stack
// dependant state invariants.
// @author Remco Bloemen <remco@0xproject.com>
pragma solidity ^0.4.25;
// Simple non-reentrant version. (Or actually, the innermost call is responsible for paying back everyone.)
contract Lending1 {
constructor () public payable {
contract BloomNuke {
function nuke() {
assembly {
log4(0, 0, 0, 1, 2, 3)
log4(0, 0, 4, 5, 6, 7)
log4(0, 0, 8, 10, 11, 12)
log4(0, 0, 13, 14, 15, 16)
log4(0, 0, 17, 18, 19, 20)
log4(0, 0, 21, 22, 23, 24)
log4(0, 0, 25, 27, 28, 29)
@recmo
recmo / StructuredHashes.sol
Created March 6, 2018 00:26
Hashing algorithms
pragma solidity 0.4.20;
contract StructuredHashes {
struct Order {
address maker;
address taker;
address makerToken;
address takerToken;
address feeRecipient;