snarkjs/build/snarkjs.min.js

2 lines
1.2 MiB
JavaScript
Raw Normal View History

2021-01-17 18:44:43 +01:00
var snarkjs=function(A){"use strict";const I=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];function g(A,I){return I&&10!=I?16==I?"0x"==A.slice(0,2)?BigInt(A):BigInt("0x"+A):void 0:BigInt(A)}const Q=g;function C(A,I){return BigInt(A)<<BigInt(I)}function B(A,I){return BigInt(A)>>BigInt(I)}const E=C,i=B;var t=Object.freeze({__proto__:null,fromString:g,e:Q,fromArray:function(A,I){let g=0n;I=BigInt(I);for(let Q=0;Q<A.length;Q++)g=g*I+BigInt(A[Q]);return g},bitLength:function(A){const g=A.toString(16);return 4*(g.length-1)+I[parseInt(g[0],16)]},isNegative:function(A){return BigInt(A)<0n},isZero:function(A){return!A},shiftLeft:C,shiftRight:B,shl:E,shr:i,isOdd:function(A){return 1n==(1n&BigInt(A))},naf:function(A){let I=BigInt(A);const g=[];for(;I;){if(1n&I){const A=2-Number(I%4n);g.push(A),I-=BigInt(A)}else g.push(0);I>>=1n}return g},bits:function(A){let I=BigInt(A);const g=[];for(;I;)1n&I?g.push(1):g.push(0),I>>=1n;return g},toNumber:function(A){if(A>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("Number too big");return Number(A)},toArray:function(A,I){const g=[];let Q=BigInt(A);for(I=BigInt(I);Q;)g.unshift(Number(Q%I)),Q/=I;return g},add:function(A,I){return BigInt(A)+BigInt(I)},sub:function(A,I){return BigInt(A)-BigInt(I)},neg:function(A){return-BigInt(A)},mul:function(A,I){return BigInt(A)*BigInt(I)},square:function(A){return BigInt(A)*BigInt(A)},pow:function(A,I){return BigInt(A)**BigInt(I)},exp:function(A,I){return BigInt(A)**BigInt(I)},abs:function(A){return BigInt(A)>=0?BigInt(A):-BigInt(A)},div:function(A,I){return BigInt(A)/BigInt(I)},mod:function(A,I){return BigInt(A)%BigInt(I)},eq:function(A,I){return BigInt(A)==BigInt(I)},neq:function(A,I){return BigInt(A)!=BigInt(I)},lt:function(A,I){return BigInt(A)<BigInt(I)},gt:function(A,I){return BigInt(A)>BigInt(I)},leq:function(A,I){return BigInt(A)<=BigInt(I)},geq:function(A,I){return BigInt(A)>=BigInt(I)},band:function(A,I){return BigInt(A)&BigInt(I)},bor:function(A,I){return BigInt(A)|BigInt(I)},bxor:function(A,I){return BigInt(A)^BigInt(I)},land:function(A,I){return BigInt(A)&&BigInt(I)},lor:function(A,I){return BigInt(A)||BigInt(I)},lnot:function(A){return!BigInt(A)}}),h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function D(A){if(A.__esModule)return A;var I=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(A).forEach((function(g){var Q=Object.getOwnPropertyDescriptor(A,g);Object.defineProperty(I,g,Q.get?Q:{enumerable:!0,get:function(){return A[g]}})})),I}function n(A){var I={exports:{}};return A(I,I.exports),I.exports}var e=n((function(A){var I=function(A){var g=1e7,Q=9007199254740992,C=e(Q),B="0123456789abcdefghijklmnopqrstuvwxyz",E="function"==typeof BigInt;function i(A,I,g,Q){return void 0===A?i[0]:void 0!==I&&(10!=+I||g)?Z(A,I,g,Q):O(A)}function t(A,I){this.value=A,this.sign=I,this.isSmall=!1}function h(A){this.value=A,this.sign=A<0,this.isSmall=!0}function D(A){this.value=A}function n(A){return-Q<A&&A<Q}function e(A){return A<1e7?[A]:A<1e14?[A%1e7,Math.floor(A/1e7)]:[A%1e7,Math.floor(A/1e7)%1e7,Math.floor(A/1e14)]}function w(A){o(A);var I=A.length;if(I<4&&l(A,C)<0)switch(I){case 0:return 0;case 1:return A[0];case 2:return A[0]+A[1]*g;default:return A[0]+(A[1]+A[2]*g)*g}return A}function o(A){for(var I=A.length;0===A[--I];);A.length=I+1}function f(A){for(var I=new Array(A),g=-1;++g<A;)I[g]=0;return I}function s(A){return A>0?Math.floor(A):Math.ceil(A)}function r(A,I){var Q,C,B=A.length,E=I.length,i=new Array(B),t=0,h=g;for(C=0;C<E;C++)t=(Q=A[C]+I[C]+t)>=h?1:0,i[C]=Q-t*h;for(;C<B;)t=(Q=A[C]+t)===h?1:0,i[C++]=Q-t*h;return t>0&&i.push(t),i}function a(A,I){return A.length>=I.length?r(A,I):r(I,A)}function y(A,I){var Q,C,B=A.length,E=new Array(B),i=g;for(C=0;C<B;C++)Q=A[C]-i+I,I=Math.floor(Q/i),E[C]=Q-I*i,I+=1;for(;I>0;)E[C++]=I%i,I=Math.floor(I/i);return E}function F(A,I){var Q,C,B=A.length,E=I.length,i=new Array(B),t=0,h=g;for(Q=0;Q<E;Q++)(C=A[Q]-t-I[Q])<0?(C+=h,t=1):t=0,i[Q]=C;for(Q=E;Q<B;Q++){if(!((C=A[Q]-t)<0)){i[Q++]=C;break}C+=h,i[Q]=C}for(;Q<B;Q++)i[Q]=A[