Skip to content

Commit

Permalink
add 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Nov 15, 2023
1 parent 92d349f commit 46bb899
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 52 deletions.
8 changes: 4 additions & 4 deletions circuits-circom/contracts/venmo_registration_verifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ contract Groth16Verifier {
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
uint256 constant gammay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;
uint256 constant deltax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
uint256 constant deltax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
uint256 constant deltay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
uint256 constant deltay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;
uint256 constant deltax1 = 12006194618653324330619797325561692185103396486467733121574833560223777226351;
uint256 constant deltax2 = 10275640949676580114201318329089520303504033027756471013178457200812927551299;
uint256 constant deltay1 = 12136231695504973090923334559104216217418357111893421900290805157591122549076;
uint256 constant deltay2 = 2418077081491544016604888756651038315978101879826004594427259819354270314840;


uint256 constant IC0x = 19838440496576873508202595947517628313617788891112459343485705915087906694446;
Expand Down
96 changes: 48 additions & 48 deletions circuits-circom/contracts/venmo_send_verifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,52 +37,52 @@ contract Groth16Verifier {
uint256 constant gammax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
uint256 constant gammay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
uint256 constant gammay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;
uint256 constant deltax1 = 11559732032986387107991004021392285783925812861821192530917403151452391805634;
uint256 constant deltax2 = 10857046999023057135944570762232829481370756359578518086990519993285655852781;
uint256 constant deltay1 = 4082367875863433681332203403145435568316851327593401208105741076214120093531;
uint256 constant deltay2 = 8495653923123431417604973247489272438418190587263600148770280649306958101930;

uint256 constant deltax1 = 7537613082883539239998105689980695625949864158911233083307240523481447029201;
uint256 constant deltax2 = 18425422419094349166845299166446400283955610392693002196033474730898100891393;
uint256 constant deltay1 = 9734737963690957740179121580228276788359472364486142941618892845265550985341;
uint256 constant deltay2 = 19424219928877642960622596960718531292261548324721236723020030007333427710256;


uint256 constant IC0x = 6902718247877772411363845861177050309258223353503700050311359326150519336692;
uint256 constant IC0y = 15825279453398516401265572637576445394013091560186110937875220954546679110159;

uint256 constant IC1x = 2335804858433576387747825582160359354916267733138827948973385608187184828569;
uint256 constant IC1y = 5736008506642285963655345198014496364551739958976504633673791816202163044118;

uint256 constant IC2x = 6269455652562704144793722062373279568471767955901279627797463015040136088132;
uint256 constant IC2y = 2097530588191744967177200393826023428699458382295316095274264671302200006698;

uint256 constant IC3x = 9822862276973085434476438868692851322487547916783049654593145248962644277643;
uint256 constant IC3y = 13358026137961492797393341724052128319258593462853360012627607362475815103442;

uint256 constant IC4x = 14719148997270446956997289375593821114034084437550001883662517657000734282586;
uint256 constant IC4y = 1998224198671702911531451107100115167770885039941574729645701907241412776308;

uint256 constant IC5x = 359894349223066781310974365307972581164914770698407647854073977658157147230;
uint256 constant IC5y = 4226113369443688791926415338604034925838584747992607214489363181365627308608;

uint256 constant IC6x = 8131352830647874407773009521188360590887607801163495436549679220199551501178;
uint256 constant IC6y = 2496366191763335194055513493653718797330181861495912467368843578731618007027;

uint256 constant IC7x = 5324791436169324680862288927376094103624123876195563861346513574577173643567;
uint256 constant IC7y = 10539632294755752334066059856447171990510491871168341570429569842426314117653;

uint256 constant IC8x = 21398838651908546916551334433437076903885176753396417385115556979686206468251;
uint256 constant IC8y = 2283165388441295638775771203114643615346617529992451266709724264297809953544;

uint256 constant IC9x = 16450282086321400334368283708403499847573182040077819178856321188442820130414;
uint256 constant IC9y = 20227982940527385555692156484806747209260038014579804010296344969319860246613;

uint256 constant IC10x = 1416849092724586759478061558363222409117668509275228664731118821895695167480;
uint256 constant IC10y = 14279591006307641048883156401797861581231631415414897920853119376578010808716;

uint256 constant IC11x = 10972046352748637769234591589921324542843146653569482848432798172628944437256;
uint256 constant IC11y = 13951850916181885013998871924877530212665252857591601803360542322172843954667;

uint256 constant IC12x = 10475342243781351585273160940612655577727791739250775206756870040352542452664;
uint256 constant IC12y = 5139068014462344879213636708300130277178459139177464895691208627008733872682;


// Memory data
uint16 constant pVk = 0;
uint16 constant pPairing = 128;
Expand All @@ -97,7 +97,7 @@ contract Groth16Verifier {
return(0, 0x20)
}
}

// G1 function to multiply a G1 value(x,y) to value in an address
function g1_mulAccC(pR, x, y, s) {
let success
Expand Down Expand Up @@ -132,31 +132,31 @@ contract Groth16Verifier {
mstore(add(_pVk, 32), IC0y)

// Compute the linear combination vk_x

g1_mulAccC(_pVk, IC1x, IC1y, calldataload(add(pubSignals, 0)))

g1_mulAccC(_pVk, IC2x, IC2y, calldataload(add(pubSignals, 32)))

g1_mulAccC(_pVk, IC3x, IC3y, calldataload(add(pubSignals, 64)))

g1_mulAccC(_pVk, IC4x, IC4y, calldataload(add(pubSignals, 96)))

g1_mulAccC(_pVk, IC5x, IC5y, calldataload(add(pubSignals, 128)))

g1_mulAccC(_pVk, IC6x, IC6y, calldataload(add(pubSignals, 160)))

g1_mulAccC(_pVk, IC7x, IC7y, calldataload(add(pubSignals, 192)))

g1_mulAccC(_pVk, IC8x, IC8y, calldataload(add(pubSignals, 224)))

g1_mulAccC(_pVk, IC9x, IC9y, calldataload(add(pubSignals, 256)))

g1_mulAccC(_pVk, IC10x, IC10y, calldataload(add(pubSignals, 288)))

g1_mulAccC(_pVk, IC11x, IC11y, calldataload(add(pubSignals, 320)))

g1_mulAccC(_pVk, IC12x, IC12y, calldataload(add(pubSignals, 352)))


// -A
mstore(_pPairing, calldataload(pA))
Expand Down Expand Up @@ -209,33 +209,33 @@ contract Groth16Verifier {
mstore(0x40, add(pMem, pLastMem))

// Validate that all evaluations ∈ F

checkField(calldataload(add(_pubSignals, 0)))

checkField(calldataload(add(_pubSignals, 32)))

checkField(calldataload(add(_pubSignals, 64)))

checkField(calldataload(add(_pubSignals, 96)))

checkField(calldataload(add(_pubSignals, 128)))

checkField(calldataload(add(_pubSignals, 160)))

checkField(calldataload(add(_pubSignals, 192)))

checkField(calldataload(add(_pubSignals, 224)))

checkField(calldataload(add(_pubSignals, 256)))

checkField(calldataload(add(_pubSignals, 288)))

checkField(calldataload(add(_pubSignals, 320)))

checkField(calldataload(add(_pubSignals, 352)))

checkField(calldataload(add(_pubSignals, 384)))


// Validate all evaluations
let isValid := checkPairing(_pA, _pB, _pC, _pubSignals, pMem)
Expand All @@ -244,4 +244,4 @@ contract Groth16Verifier {
return(0, 0x20)
}
}
}
}

0 comments on commit 46bb899

Please sign in to comment.