Skip to content

Instantly share code, notes, and snippets.

View jwasinger's full-sized avatar
💭
👍

jwasinger

💭
👍
View GitHub Profile
{
function addmod384(x_offset, y_offset, mod_offset) {
/* stub for future evm opcode */
}
function submod384(x_offset, y_offset, mod_offset) {
/* stub for future evm opcode */
}
function mulmodmont384(x_offset, y_offset, mod_offset, inv_offset) {
//
// Copyright 2017 Christian Reitwiessner
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTW
FROM ubuntu:19.04
# System deps
RUN apt-get clean
RUN apt-get update
RUN apt-get install -y software-properties-common git sudo build-essential wget curl nano \
autoconf automake libtool make ninja-build unzip zlib1g-dev texinfo libssl-dev
RUN sudo apt-get clean autoclean
RUN sudo apt-get autoremove -y
template MiMCFeistel(nrounds) {
signal input xL_in;
signal input xR_in;
signal input k;
signal output xL_out;
signal output xR_out;
signal output t[nrounds];
// doesn't contain the first and last round constants, which are always zero
@jwasinger
jwasinger / instructions.md
Created May 3, 2019 23:31
Instructions to reproduce Solidity test failures when using truffle example with Geth
@jwasinger
jwasinger / instructions.md
Last active April 30, 2019 22:42
Instructions to Reproduce Truffle bug with Geth
This file has been truncated, but you can view the full file.
#include <math.h>
#include <string.h>
#include "ecadd_benchmark.h"
#define UNLIKELY(x) __builtin_expect(!!(x), 0)
#define LIKELY(x) __builtin_expect(!!(x), 1)
#define TRAP(x) (wasm_rt_trap(WASM_RT_TRAP_##x), 0)
#define FUNC_PROLOGUE \
@jwasinger
jwasinger / instructions.md
Last active January 23, 2019 13:27
Instructions for compiling ecadd benchmark to native using wasm2c
> ( git clone https://github.com/jwasinger/ewasm-precompiles -b ecadd-benchmark && cd ewasm-precompiles && cargo build --target wasm32-unknown-unknown )
> git clone https://github.com/webassembly/wabt
> cd wabt/wasm2c && cp /path/to/ewasm-precompiles/target/wasm32-unknown-unknown/debug/ecadd_benchmark.wasm .
> ( build wabt )
> wasm2c ecadd_benchmark.wasm -o ecadd_benchmark.c
  1. In the same folder, create a file main.c:
@jwasinger
jwasinger / gist:0e522eb7e1cce6b45c3ac103054e184c
Created December 11, 2018 12:46
ed25519 benchmark test cases
7557f01a255ac98a325a1bfaae484ba11b01368e299c3b8d9370180750823bead94430b019f29bc78bdd2a9cbe796c9b633ad5cbe4ac804ac118563790e4c657a978c89e1b83c4a2f337a77b10351d0e184089fecf0ea8870614570306edd4a9ece7cdbc3378978bf4a4f85c0252ebb51cf00b2a4fc23833c6a1f6875503ae08
a955f8731e5c47a921b9b59d35163c3ce1c6dbcd595ce8dbc560211d93658e1f6dccbc119f1f5a3444694e47ff6f43ed7a8e436db31841d5268959a812b9dee5055b27f3ac35c40eb0dadb4359a6bb46ebcb1acb5fdd0a78c6dec07808ee3e188937e2f5657e5582a88a04888c89be98d3aa1b89ad31d2aca4f13a994ddb1f02
456bdd2b7919e38aacc168b55236a54014f0bcd8db201c1b479a6578b0d4b47d70d13909d88843a4d2c59f1a6a1f68dc1e749a2af97b55220c50e1341d62cd824e5d79b4439e7d7ba97f9226c2e765b663a95fdcab699f18b2fd8784ba316ef4103a9d08d49422df99a8262aa8a88a6efce399c0e124a75b863a32d375e84806
0f581b9406e0a989e3da01b634aac88a6b5560f86f0568ee024dbff83e2f6ed83543138df02e945c4d21e02f980542c4e75e0d405da07b15d4abf0207f908f2134ed60f2fae2c201bcc89a515d61317cf767be84f4e5d6066142c9cd3f1d3a841fe7298fae216667aad1e834c65bf23046b3a3d53986222c23c24a5e017ad
@jwasinger
jwasinger / instructions.md
Last active December 12, 2018 16:05
parity deploy clique setup

Prereqs

  • have geth binary in your path
  • have parity binary in your path
  • have npm, nodejs installed

Setup

git clone https://github.com/jwasinger/parity-deploy -b clique