Skip to content

Instantly share code, notes, and snippets.

View weikengchen's full-sized avatar

Weikeng Chen weikengchen

View GitHub Profile
### Keybase proof
I hereby claim:
* I am weikengchen on github.
* I am weikeng (https://keybase.io/weikeng) on keybase.
* I have a public key ASCgfFzbxEvMi3jIWHVDcKxfywmRTOQRRj2aPwyONNqHHgo
To claim this, I am signing this object:
@weikengchen
weikengchen / oblivcc.sh
Created April 3, 2018 07:22
oblivcc without direct cilly
#!/bin/bash
OCCPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )"
OCLIB=$OCCPATH/src/ext/oblivc
COMPILE_ONLY=0
CCARGS=""
AFTERARGS=""
CILLYARGS=""
OCSRC=()
GCRYPT="-lgcrypt"
if [ "$OBLIVC_BITS" = "no" ]; then
@weikengchen
weikengchen / processObliv.ml
Created April 5, 2018 02:19
processObliv.ml that supports C labels
open OblivUtils
open Pretty
open Printf
open Cil
open Feature
module E = Errormsg
module H = Hashtbl
let rec checkOblivType t = match t with
shellcode =
"\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07" +
"\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d" +
"\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80" +
"\xe8\xdc\xff\xff\xff\x2f\x62\x69\x6e\x2f\x73\x68"
@weikengchen
weikengchen / gen_circuit.cpp
Last active June 25, 2019 20:53
Test circuit generator
#include "emp-tool/emp-tool.h"
using namespace emp;
void mult(){
Integer a(32, 0, ALICE);
Integer b(32, 0, BOB);
Integer c = a*b;
c.reveal<string>();
}
@weikengchen
weikengchen / demo.cpp
Created June 25, 2019 20:56
Demonstration application for AG-2PC
#include <emp-tool/emp-tool.h>
#include "test/single_execution.h"
using namespace std;
using namespace emp;
int main(int argc, char** argv) {
int port, party;
parse_party_and_port(argv, &party, &port);
NetIO* io = new NetIO(party==ALICE ? nullptr:IP, port);
@weikengchen
weikengchen / demo.cpp
Created June 25, 2019 20:56
Demonstration application for AG-2PC
#include <emp-tool/emp-tool.h>
#include "test/single_execution.h"
using namespace std;
using namespace emp;
int main(int argc, char** argv) {
int port, party;
parse_party_and_port(argv, &party, &port);
NetIO* io = new NetIO(party==ALICE ? nullptr:IP, port);
@weikengchen
weikengchen / maci-v1-trusted-setup-ceremony_attestation.log
Created October 21, 2023 03:34
Attestation for Maci v1 Trusted Setup Ceremony MPC Phase 2 Trusted Setup ceremony
Hey, I'm weikengchen-14937807 and I have contributed to the Maci v1 Trusted Setup Ceremony.
The following are my contribution signatures:
Circuit # 1 (processmessages_6-8-2-3)
Contributor # 39
Contribution Hash: 2032a997 6ca70cec 61e4e6a9 1abfb63c
1555f9e9 5c6dbe2b 324a1d96 80b2d247
d04c6a99 573b17d3 22b242dc 6d828396
839895ad 01b5143c 2b62c339 25fbe309
@weikengchen
weikengchen / profiler-output.txt
Last active December 13, 2023 02:55
profiler-output.txt
Total: 13774441 cycles, 11144089 instructions
···· Load the bootstrapping key: 3297 cycles, 15 instructions
········ Cycle: 23393 => 26676: sw a1, 0(a0) at 0x200904 that writes to 0x1fc3c8 and marks pages 0x1fc000, 0xd00fc00, 0xd680400 as dirty takes 3283 cycles
···· Load the ciphertext to be bootstrapped: 11 cycles, 11 instructions
···· Perform trivial encryption and rotation: 126203 cycles, 66129 instructions
········ Cycle: 26928 => 28023: addi sp, sp, -2032 at 0x201c18, due to jalr ra, ra, 616 at 0x2009b4, that marks pages 0x201c00 as dirty takes 1095 cycles
········ Cycle: 28023 => 30212: sw sp, 2028(ra) at 0x201c1c that writes to 0x1f03bc and marks pages 0x1f0000, 0xd00f800 as dirty takes 2189 cycles
········ Cycle: 30225 => 32414: sb a0, 0(a1) at 0x200b6c that writes to 0x1ee3b0 and marks pages 0x1ee000, 0xd00f400 as dirty takes 2189 cycles
········ Cycle: 32484 => 33579: sw a3, 24(a1) at 0x200c48 that writes to 0x1ee400 and marks pages 0x1ee400 as dirty takes 1095 cycles
········ Cycle: 33930 => 35025
@weikengchen
weikengchen / article-1-profiler-output.txt
Created December 15, 2023 00:44
article-1-profiler-output.txt
Total: 159726565 cycles, 151686471 instructions
···· Load the bootstrapping key: 3297 cycles, 15 instructions
········ Cycle: 23432 => 26715: sw a1, 0(a0) at 0x2008c4 that writes to 0x1fc3c8 and marks pages 0x1fc000, 0xd00fc00, 0xd680400 as dirty takes 3283 cycles
···· Load the ciphertext to be bootstrapped: 11 cycles, 11 instructions
···· Perform trivial encryption and rotation: 123982 cycles, 66096 instructions
········ Cycle: 26978 => 28073: sb a3, -1(a1) at 0x201fcc that writes to 0x1fe3c7 and marks pages 0x1fe000 as dirty takes 1095 cycles
········ Cycle: 28134 => 29229: sw a3, 0(a1) at 0x202084, due to bltu a4, -40(a2) at 0x2020ac, that writes to 0x1fc400 and marks pages 0x1fc400 as dirty takes 1095 cycles
········ Cycle: 29580 => 30675: sw a3, 0(a1) at 0x202084, due to bltu a4, -40(a2) at 0x2020ac, that writes to 0x1fc800 and marks pages 0x1fc800 as dirty takes 1095 cycles
········ Cycle: 31026 => 32121: sw a3, 0(a1) at 0x202084, due to bltu a4, -40(a2) at 0x2020ac, that writes to 0x1fcc00 and marks pa