Skip to content

Instantly share code, notes, and snippets.

Tjaden Hess tjade273

Block or report user

Report or block tjade273

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tjade273
tjade273 / BLS.sol
Created Mar 8, 2018 — forked from anonymous/BLS.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.21+commit.dfe3193c.js&optimize=false&gist=
View BLS.sol
contract BLS {
uint public nonce;
uint[4] public pubkey;
// sig[0:1] is h^-x, sig[2] is the y-component of h
function forward(uint[3] sig, uint gas, address addr, uint value, bytes data) returns (bool) {
bytes32 msg = keccak256(nonce, gas, addr, value, data);
bool success;
assembly {
let m := mload(0x40)
@tjade273
tjade273 / BailliePSW.sol
Created Feb 14, 2018 — forked from anonymous/BailliePSW.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
View BailliePSW.sol
contract BailliePSW {
function sprp(uint a) pure returns (bool iscomposite) {
}
function modexp() constant returns (bytes32 o){
assembly {
let m := mload(0x40)
mstore(m,1)
mstore(add(m, 0x20),2)
@tjade273
tjade273 / FlipEndian.sol
Created Jan 17, 2018 — forked from anonymous/FlipEndian.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
View FlipEndian.sol
pragma solidity ^0.4.19;
contract FlipEndian {
function flip32_1(bytes32 a) public constant returns (bytes32 b){
assembly {
0
and(div(a, 0x100000000000000000000000000000000000000000000000000000000000000), 0xFF)
or
and(div(a, 0x10000000000000000000000000000000000000000000000000000000000), 0xFF00)
or
View log2.sol
function log2(uint x) returns (uint y){
assembly {
let arg := x
x := sub(x,1)
x := or(x, div(x, 0x02))
x := or(x, div(x, 0x04))
x := or(x, div(x, 0x10))
x := or(x, div(x, 0x100))
x := or(x, div(x, 0x10000))
x := or(x, div(x, 0x100000000))
View keybase.md

Keybase proof

I hereby claim:

  • I am tjade273 on github.
  • I am tjade273 (https://keybase.io/tjade273) on keybase.
  • I have a public key ASDR9HNQsRzpOcLNM6uc4IPWn_ljtln2BCEpx78JBwhNiAo

To claim this, I am signing this object:

View MultiProxy.sol
contract MultiProxy{
//Data schema: [from: 32 bytes, to: 32 bytes, value: 32 bytes, data_length: 32 bytes, data: data_length bytes]
function forward(bytes32[]) external payable {
assembly {
function next_tx (c) -> n {
let data_size := calldataload(add(c, 96))
n := add(c, add(128, mul(div(data_size, 32), 32)))
switch mod(data_size, 32)
case 0 {
View multiply.cpp
#include <gtest/gtest.h>
#include <gadgetlib2/gadget.hpp>
#include "gadgetlib2/adapters.hpp"
#include "gadgetlib2/integration.hpp"
#include "relations/constraint_satisfaction_problems/r1cs/examples/r1cs_examples.hpp"
#include "gadgetlib2/examples/simple_example.hpp"
#include "zk_proof_systems/ppzksnark/r1cs_ppzksnark/examples/run_r1cs_ppzksnark.hpp"
using namespace libsnark;
@tjade273
tjade273 / disasm.js
Last active May 3, 2017 — forked from anonymous/gist:d3bbdc55159879046345
Ethereum OPCODE disassembler
View disasm.js
function disasm(code) {
if (!code)
return code;
var codes = code.match(/(..?)/g);
var dis = "";
for(var i = 1; i < codes.length; i++) {
var opcode = opcodes[codes[i]];
dis += i+". " + codes[i]+": "
if (!opcode) {
You can’t perform that action at this time.