Skip to content

Instantly share code, notes, and snippets.

Avatar

Jared Wasinger jwasinger

View GitHub Profile
View gist:8d08281ed90b81da16968a452a12d3a5
for i in [0..vec.len]:
vec[i] = vec[i] * vec[i]
return sorted(vec)
@jwasinger
jwasinger / standalone_wasm_results.csv
Created Jun 10, 2020
standalone wasm benchmarks (azure vm) - June 9th 2020
View standalone_wasm_results.csv
We can't make this file beautiful and searchable because it's too large.
engine,test_name,elapsed_time,compile_time,exec_time
wagon,bn128_mul-chfast2,0.20844221115112305,0.069442,0.131921
wagon,bn128_mul-chfast2,0.2028026580810547,0.068059,0.129828
wagon,bn128_mul-chfast2,0.2083592414855957,0.0695,0.134094
wagon,bn128_mul-chfast2,0.20242953300476074,0.067839,0.130541
wagon,bn128_mul-chfast2,0.20944571495056152,0.073585,0.13122
wagon,bn128_mul-chfast2,0.2013232707977295,0.06854,0.128242
wagon,bn128_mul-chfast2,0.21543478965759277,0.075039,0.135703
wagon,bn128_mul-chfast2,0.2297804355621338,0.081116,0.143863
@jwasinger
jwasinger / gist:9e38c1c4d52ac0910bf5a0db64883f3d
Created May 21, 2020
evm384 f6m mul synth loop v2 evm bytecode
View gist:9e38c1c4d52ac0910bf5a0db64883f3d
597fabaafffffffffeb9ffff53b1feffab1e24f6b0f6a0d23067bf1285f3844b776481527fd7ac4b43b6a71b4b9ae67f39ea11011a000000000000000000000000000000006020820152604081017f8f2990f3e598f5b1b8f480a3c388306bc023fac151c0104d13ec3aa18159940281527f72d1c8c528a1ce3bcaa280a8e735aa0d0000000000000000000000000000000060608301527f992d7a27906d4cd530b23a7e8c48c0778f8653fbc3332d63db24339d8bc65d7e60808301527fe83b6e91c6550f5aceab102e88e918090000000000000000000000000000000060a08301527f7299907146816f08c4c6a394e91374ed6ff3618a57358cfb124ee6ab4c560e5c60c08301527fac40700b41e2ee8674680728f0c5a6180000000000000000000000000000000060e08301527f0fd77f62b39eb952a0f8d21cec1f93b1d62dd7923aa86882ddf7dd4d3532b0b76101008301527fede8f3fc89fa4a79574067e2d9a9d200000000000000000000000000000000006101208301527f7a69de46b13d8cb4c4833224aaf9ef7ea6a48975ab35c6e123b8539ab84c381a6101408301527f2533401a73c4e79f47d714899d01ac130000000000000000000000000000000061016083015261018082017fa9fa0b0d8156c36a1a9ddacb73ef278f4d149b560e88789f2bfeb9f708b6cc2f81527f988927bfe0186d5bf9cb40cb
View gist:27ea77111577ac1979d23f0750bde571
debug_printMemHex mem_pos: 288 284544
81f9ab902854e25b9885fd18eedded158d323cd1db63aac85667c846d7b32b2cd8f5fc6051a82f5ad57c039da951ed13d3b0186a84d65f84b496962eb845bf44b964a6dd009f7a9c7b5b31c8838bf7ad0c82c8568e5cba769a9865ef8ee6cc1393f29468d61bae4ee78df89e052fd93155a152b851f91c04e29820e971b2756faea7bb1d8cf88726fd98f26f1e55351464189369f3e2d094567d7159784b51602eaed4b93a96c7eaabdb17e21bc0f4b621ab0d9e6c704a29d07c16f10aa83b1829366951d266201e3461e4c8be6f97735790d8176b661ab62e24ca23a18989ad0b933264a916e4da9b1e8e3ceb7ddf13fc60e840573d9d79559e0c8d1f05e17459fe91066b901c99a515eb21ddfc359590d6ab7ebaec0e58a1d2fbaf0ff5a809
debug_memHex done
debug_printMemHex mem_pos: 288 284832
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008fc2328a6235e95c18abc18596f98a84839e593b9938c3e6ff7e206969e887754424c422d3bfc4dfa3a8f7bb06133119faf9234941983eb86272ccd6aaecab023b073792337fe67897873ade3ea4c5c54
View gist:5c0a292b94e29abb71dc6cadf24192e8
code {
function memcpy_384(dst, src)
{
let hi := mload(src)
let lo := mload(add(src, 32))
mstore(dst, hi)
mstore(add(dst, 32), lo)
}
function f2m_add(x_0, x_1, y_0, y_1, r_0, r_1, modulus)
{
View f6m_mult_pseudocode.yul
function f6m_mul(x_offset, y_offset, ret_offset, mod_offset, inv_offset) {
/*
f6m_mul pseudocode:
a = x_offset[0]
b = x_offset[1]
A = y_offset[0]
B = y_offset[1]
aA = a * A
bB = b * B
View f6m_mul_stub.yul
{
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) {
View Verifier.sol
//
// 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
View Dockerfile
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
View mimc_compress.circom
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
You can’t perform that action at this time.