re
Paste
Login
JavaScript needs to be enabled for the correct display of the page.
-- Copyright (c) 2024 PatriikPlays -- -- This work is licensed under the terms of the MIT license. -- For a copy, see <https://opensource.org/licenses/MIT>. -- -- SGPS client 95db091fa7d3e4b90d86087e88a7074f9f95e0e3 (https://github.com/PatriikPlays/sgps), built at 2026-05-04T21:35:38Z -- This program uses ccryptolib <unknown> (https://github.com/migeyel/ccryptolib), which is licensed under the MIT license local e=type(package)=="table"and type(package.preload)=="table"and package.preload or{}local t=require if type(t)~= "function"then local a={}local o={}t=function(i)local n=o[i]if n~=nil then if n==a then error( "loop or previous error loading module '"..i.."'",2)end return n end o[i]=a local s=e[i]if s then n=s(i)else error( "cannot load '"..i.."'",2)end if n==nil then n=true end o[i]=n return n end end e["sgps"]=function(...)local a=t( "ccryptolib.ed25519")local o=t("cc.expect").expect CHANNEL_SGPS=65524 local i=1 local function n(m)if#m~=64 then return false,"key_length_invalid"end local f=""for w=1,32 do local y=tonumber(m:sub(w*2-1,w*2),16)if not y then return false, "key_malformed"end f=f..string.char(y)end return f end local s={n("43ea42e07d5c4adf6b11ba8646f89235f3483fa625b5be14457fb66029ae91c5" ),n("61fc6c0f66d21bf6371e1bc26461d50b833ab60f57a2ec87305e0b07fdce1d76")}local function h(m,f,w)local p=f.vPosition-m. vPosition local v=w.vPosition-m.vPosition if math.abs(p:normalize():dot(v:normalize()))>0.999 then return nil end local b=p:length()local g=p:normalize()local k=g:dot(v)local q=(v-g*k):normalize()local z=q:dot(v)local _=g:cross(q)local E=m. distance local T=f.distance local A=w.distance local O=(E*E-T*T+b*b)/(2*b)local I=(E*E-A*A-O*O+(O-k)*(O-k)+z*z)/(2*z) local N=m.vPosition+g*O+q*I local S=E*E-O*O-I*I if S>0 then local y=math.sqrt(S)local j=N+_*y local x=N-_*y local H,R=j: round(0.01),x:round(0.01)if H.x~=R.x or H.y~=R.y or H.z~=R.z then return H,R else return H end end return N:round(0.01) end local function r(m,f,w)local y=math.abs((m-w.vPosition):length()-w.distance)local p=math.abs((f-w.vPosition):length( )-w.distance)if math.abs(y-p)<0.01 then return m,f elseif y<p then return m:round(0.01)else return f:round(0.01)end end local function d(m,f)for w,y in ipairs(m)do if y==f then return true end end end local function l()for m,f in ipairs(rs. getSides())do if peripheral.getType(f)=="modem"and peripheral.call(f,"isWireless")then return f end end end local function u(m,f)if m then print(f)end end local function c(m,f,w,y)m=m or 2 o(1,m,"number")o(2,f,"boolean","nil")o(3,w, "table")local p=peripheral.find("cryptographic_accelerator")if y and not p then error( "No Cryotographic Accelerator, but forceCryptoAccel is enabled")end local v=l()if not v then u(f, "Failed to find wireless modem")return nil end local b=peripheral.wrap(v)local g=b.isOpen(CHANNEL_SGPS)if not g then b. open(CHANNEL_SGPS)end u(f and not g,"Opened SGPS channel")u(f and g,"SGPS channel already open")u(f, "Transmitting SGPS ping")local k=""for _=1,32 do k=k..string.char(math.random(0,255))end b.transmit(CHANNEL_SGPS, CHANNEL_SGPS,string.pack(">bc32",i,k))local q={}local j,x=nil,nil local z=os.startTimer(m)while true do local _,E,T,A,O, I=os.pullEvent()if _=="modem_message"then local N,S,H,R,D=E,T,A,O,I if N==v and S==CHANNEL_SGPS and H==CHANNEL_SGPS and D and type(R)=="string"then local L,_=pcall(function()local U,C,M,F=string.unpack(">bs2c64c32",R)if U~=i then return end if not d(w,F)then return end local W,Y,P,V,B,G=string.unpack(">iiic32Ls1",C)if os.epoch("utc")-B>15000 then return end if os.epoch("utc")-B<-2500 then return end if V~=k then return end if p then if not p.verify(C,M,F)then return end else if not a.verify(F,C,M)then return end end do local K={vPosition=vector.new(W,Y,P),distance=D}u(f,K.distance.. " metres from "..tostring(K.vPosition))if K.distance==0 then j,x=K.vPosition,nil else local Q=math.min(3,#q+1)for J,X in pairs(q)do if(X.vPosition-K.vPosition):length()<1 then Q=J return true end end q[Q]=K if#q>=3 then if not j then j,x=h(q [1],q[2],q[3])else j,x=r(j,x,q[3])end end end if j and not x then return true end end end)if L and _ then break end end elseif _=="timer"then if E==z then break end end end if not g then b.close(CHANNEL_SGPS)end if j and x then if f then print("Ambiguous position")print("Could be "..j.x..","..j.y..","..j.z.." or "..x.x..","..x.y..","..x.z)end return nil elseif j then u(f,"Position is "..j.x..","..j.y..","..j.z)return j.x,j.y,j.z else u(f,"Could not determine position") return nil end end return{locate=c,parseStringifiedKey=n,DEFAULT_PUBLIC_KEYS=s}end e["ccryptolib.x25519c"]=function(...) local a=t"cc.expect".expect local o=t"ccryptolib.internal.util".lassert local i=t"ccryptolib.internal.fq"local n=t "ccryptolib.internal.fp"local s=t"ccryptolib.internal.curve25519"local h=t"ccryptolib.internal.sha512"local r=t "ccryptolib.random"local function d(y)a(1,y,"string")o(#y==32,"secret key length must be 32",2)local d=r.random(32) local p=i.decodeClamped(y)local v=i.decodeClamped(d)local b=i.sub(p,v)return i.encode(b)..d end local function l(y)a(1,y ,"string")o(#y==32,"secret key length must be 32",2)return d(h.digest(y):sub(1,32))end local function u(y)a(1,y,"string" )o(#y==64,"masked secret key length must be 64",2)local p=r.random(32)local v=i.decode(y:sub(1,32))local b=i. decodeClamped(y:sub(33))local g=i.decodeClamped(p)local k=i.add(v,i.sub(b,g))return i.encode(k)..p end local function c( y)a(1,y,"string")o(#y==64,"masked secret key length must be 64",2)return y:sub(33)end local function m(y,p)local v=i. decode(y:sub(1,32))local b=i.decodeClamped(y:sub(33))local g,k,q=s.prac(p,i.makeRuleset(i.eighth(b),i.eighth(v)))if not g then local C=n.encode(n.num(0))return C,C end local j=s.dadd(q,g,k)local x,z=p[1],p[2]local _,E=j[1],j[2]local T,A=g[1 ],g[2]x,z=n.mul(x,z),n.square(z)_,E=n.mul(_,E),n.square(E)T,A=n.mul(T,A),n.square(A)local O=n.square(x)local I=n.square( z)local N=n.mul(x,z)local S=n.kmul(N,486662)local H=n.mul(x,n.add(O,n.carry(n.add(S,I))))local R=n.sqrtDiv(n.num(1),n. mul(n.mul(E,A),H))if not R then local C=n.encode(n.num(0))return C,C end local D=n.mul(n.square(R),H)local L=n.mul(D,A) local U=n.mul(D,E)return n.encode(n.mul(_,L)),n.encode(n.mul(T,U))end local function f(y)a(1,y,"string")o(#y==64, "masked secret key length must be 64",2)return(m(y,s.G))end local function w(y,p)a(1,y,"string")o(#y==64, "masked secret key length must be 64",2)a(2,p,"string")o(#p==32,"public key length must be 32",2)return m(y,s.decode(p)) end return{mask=d,remask=u,publicKey=f,ephemeralSk=c,exchange=w}end e["ccryptolib.x25519"]=function(...)local a=t "cc.expect".expect local o=t"ccryptolib.internal.util".lassert local i=t"ccryptolib.internal.util"local n=t "ccryptolib.internal.curve25519"local function s(r)a(1,r,"string")assert(#r==32,"secret key length must be 32")return n. encode(n.scale(n.mulG(i.bits(r))))end local function h(r,d)a(1,r,"string")o(#r==32,"secret key length must be 32",2)a(2, d,"string")o(#d==32,"public key length must be 32",2)return n.encode(n.scale(n.ladder8(n.decode(d),i.bits8(r))))end return{publicKey=s,exchange=h}end e["ccryptolib.util"]=function(...)local a=t"cc.expect".expect local o=t "ccryptolib.random"local i=t"ccryptolib.poly1305"local function n(r)a(1,r,"string")return("%02x"):rep(#r):format(r:byte( 1,-1))end local function s(r)a(1,r,"string")local d={}local l=0 for u in r:gmatch("%x%x")do l=l+1 d[l]=tonumber(u,16)end if 2*l==#r then return string.char(table.unpack(d))end end local function h(r,d)a(1,r,"string")a(2,d,"string")if#r~=#d then return false end local l=o.random(32)return i.mac(l,r)==i.mac(l,d)end return{toHex=n,fromHex=s,compare=h}end e[ "ccryptolib.sha256"]=function(...)local a=t"cc.expect".expect local o=t"ccryptolib.internal.util".lassert local i=t "ccryptolib.internal.packing"local n=bit32.lrotate local s=bit32.rshift local h=bit32.bxor local r=bit32.bnot local d= bit32.band local l=unpack or table.unpack local u,c=i.compilePack(">I8")local m,f=i.compilePack( ">I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4")local w=i.compileUnpack(f)local y,p=i.compilePack(">I4I4I4I4I4I4I4I4")local v=i. compileUnpack(p)local function b(_,E)local T={}local A=2 for O=1,_ do T[O]=h(A^E%1*2^32)repeat A=A+1 until 2^A%A==2 end return T end local g=b(64,1/3)local k=b(8,1/2)local function q(_,E)local k,T,A,O,I,N,S,H=l(_)local g=g for W=17,64 do local Y=E[W-15]local P=E[W-2]local V=h(n(Y,25),n(Y,14),s(Y,3))local B=h(n(P,15),n(P,13),s(P,10))E[W]=E[W-16]+V+E[W-7]+B end local R,D,L,U,C,M,F,_=k,T,A,O,I,N,S,H for W=1,64 do local Y=h(n(C,26),n(C,21),n(C,7))local P=h(d(C,M),d(r(C),F)) local V=_+Y+P+g[W]+E[W]local B=h(n(R,30),n(R,19),n(R,10))local G=h(d(R,D),d(R,L),d(D,L))local K=B+G _=F F=M M=C C=U+V U= L L=D D=R R=V+K end return{(k+R)%2^32,(T+D)%2^32,(A+L)%2^32,(O+U)%2^32,(I+C)%2^32,(N+M)%2^32,(S+F)%2^32,(H+_)%2^32}end local function j(_)a(1,_,"string")local E=#_*8 local T=-(#_+9)%64 _=_.."\x80"..("\0"):rep(T)..u(c,E)local A=k for O=1,#_ ,64 do A=q(A,{w(f,_,O)})end return y(p,l(A))end local x=50 local function z(_,E,T,A)a(1,_,"string")a(2,E,"string")a(3,T, "number")o(T%1==0,"iteration number must be an integer",2)o(T>0,"iteration number must be positive",2)a(4,A,"function", "nil")if#_>64 then _=j(_)end _={w(f,_..("\0"):rep(64),1)}local O={}local I={}for U=1,16 do O[U]=h(_[U],0x36363636)I[U]=h( _[U],0x5c5c5c5c)end local N=q(k,O)local S=q(k,I)local H={2^31,0,0,0,0,0,0,0x300}local R=m(f,l(O))local D={v(p,j(R..E.. "\0\0\0\1"),1)}for U=1,8 do D[U+8]=H[U]end D=q(S,D)local L={l(D)}for U=2,T do for C=1,8 do D[C+8]=H[C]end D=q(N,D)for C= 1,8 do D[C+8]=H[C]end D=q(S,D)for C=1,8 do L[C]=h(L[C],D[C])end if A and U%x==0 then A(U)end end return y(p,l(L))end return{digest=j,pbkdf2=z}end e["ccryptolib.random"]=function(...)local a=t"cc.expect".expect local o=t "ccryptolib.blake3"local i=t"ccryptolib.chacha20"local n=t"ccryptolib.internal.util"local s=n.lassert local h={ "ccryptolib 2023-04-11T19:43Z random.lua initialization context",os.epoch("utc"),os.day(),os.time(),math.random(0,2^24-1 ),math.random(0,2^24-1),tostring({}),tostring({})}local r=o.digest(table.concat(h,"|"))local d=false local function l(w) a(1,w,"string")r=o.digestKeyed(r,w)d=true end local function u()return d end local function c()assert(os.epoch("utc")~=0 )local w=assert(load("local e=os.epoch return{"..("e'utc',"):rep(256).."}"))do local v=w()while v[256]-v[1]>1 do v=w() end end local y={}for v=1,512 do local b=w()while b[256]==b[1]do b=w()end for g=1,256 do if b[g]~=b[1]then y[v]=g-1 break end end end local p={}for v=0,255 do p[v]=0 end for v=1,#y do p[y[v]]=p[y[v]]+1 end for v=0,255 do assert(p[v]<20) end l(string.char(table.unpack(y)))end local function m(w)a(1,w,"string")r=o.digestKeyed(r,w)end local function f(w)a(1, w,"number")s(d,"attempt to use an uninitialized random generator",2)local y=("\0"):rep(math.max(w,0)+32)local p=("\0"): rep(12)local v=i.crypt(r,p,y,8,0)r=v:sub(1,32)return v:sub(33)end return{init=l,isInit=u,initWithTiming=c,mix=m,random=f }end e["ccryptolib.poly1305"]=function(...)local a=t"cc.expect".expect local o=t"ccryptolib.internal.util".lassert local i=t"ccryptolib.internal.packing"local n,s=i.compileUnpack("<I4I4I4I4")local h=i.compilePack(s)local function r(d,l )a(1,d,"string")o(#d==32,"key length must be 32",2)a(2,l,"string")local u=#l-15 if#l%16~=0 or#l==0 then l=l.."\1"l=l..( "\0"):rep(-#l%16)end local c,m,f,w=n(s,d,1)c=c%2^28 m=(m-m%4)%2^28*2^32 f=(f-f%4)%2^28*2^64 w=(w-w%4)%2^28*2^96 local y= c%2^18 local p=c-y local v=m%2^50 local b=m-v local g=f%2^82 local k=f-g local q=w%2^112 local j=w-q local x=5/2^130*m local z=5/2^130*f local _=5/2^130*w local E=x%2^-80 local T=x-E local A=z%2^-48 local O=z-A local I=_%2^-16 local N=_-I local S,H,R,D,L,U,C,M=0,0,0,0,0,0,0,0 for es=1,#l,16 do local eh,er,ed,el=n(s,l,es)local eu=S+H+eh local ec=R+D+er*2^32 local em=L+U+ed*2^64 local ef=C+M+el*2^96 if es<=u then ef=ef+2^128 end S=eu*y+ec*I+em*A+ef*E H=eu*p+ec*N+em*O+ef*T R=eu *v+ec*y+em*I+ef*A D=eu*b+ec*p+em*N+ef*O L=eu*g+ec*v+em*y+ef*I U=eu*k+ec*b+em*p+ef*N C=eu*q+ec*g+em*v+ef*y M=eu*j+ec*k+em *b+ef*p local ew=S+3*2^69-3*2^69 S=S-ew H=H+ew local ey=H+3*2^83-3*2^83 H=H-ey R=R+ey local ep=R+3*2^101-3*2^101 R=R-ep D=D+ep local ev=D+3*2^115-3*2^115 D=D-ev L=L+ev local eb=L+3*2^133-3*2^133 L=L-eb U=U+eb local eg=U+3*2^147-3*2^147 U=U- eg C=C+eg local ek=C+3*2^163-3*2^163 C=C-ek M=M+ek local eq=M+3*2^181-3*2^181 M=M-eq S=S+5/2^130*eq end local F=S%2^16 H =S-F+H local W=H%2^32 R=H-W+R local Y=R%2^48 D=R-Y+D local P=D%2^64 L=D-P+L local V=L%2^80 U=L-V+U local B=U%2^96 C=U-B+ C local G=C%2^112 M=C-G+M local K=M%2^130 S=F+5/2^130*(M-K)F=S%2^16 W=S-F+W if K==0x3ffff*2^112 and G==0xffff*2^96 and B ==0xffff*2^80 and V==0xffff*2^64 and P==0xffff*2^48 and Y==0xffff*2^32 and W==0xffff*2^16 and F>=0xfffb then K,G,B,V,P,Y ,W,F=0,0,0,0,0,0,0,F-0xfffb end local Q,J,E,T=n(s,d,17)local X=Q+F+W local Z=X%2^32 local ee=X-Z+J*2^32+Y+P local et=ee% 2^64 local ea=ee-et+E*2^64+V+B local eo=ea%2^96 local ei=ea-eo+T*2^96+G+K local en=ei%2^128 return h(s,Z,et/2^32,eo/2^64 ,en/2^96)end return{mac=r}end e["ccryptolib.internal.util"]=function(...)local function a(s,h,r)if not s then error(h,r+ 1)end return s end local function o(s,h,r)local d={}local l=1 local u=0 local c=1 for m=1,#s do u=u+s[m]*c c=c*h while c >=r do local f=u%r u=(u-f)/r c=c/r d[l]=f l=l+1 end end if c>0 then d[l]=u end return d end local function i(s)local h={ s:byte(1,32)}local r={}for d=1,32 do local l=h[d]for u=-7,0 do local c=l%2 r[8*d+u]=c l=(l-c)/2 end end r[1]=0 r[2]=0 r[ 3]=0 r[255]=1 r[256]=0 return r end local function n(s)return{unpack(i(s),4)}end return{lassert=a,rebaseLE=o,bits=i, bits8=n}end e["ccryptolib.internal.sha512"]=function(...)local a=t"cc.expect".expect local o=t "ccryptolib.internal.packing"local i=bit32.lshift local n=bit32.rshift local s=bit32.bxor local h=bit32.bnot local r= bit32.band local d,l=o.compilePack(">I16")local u,c=o.compilePack(">I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4")local m,f=o. compileUnpack(">I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4")local function w(v,b)local g=b%2^32 v= v+(b-g)/2^32 return v%2^32,g end local y={0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5, 0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242 ,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1, 0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0x0fc19dc6,0x8b8cd5b5,0x240ca1cc ,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152, 0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725 ,0x06ca6351,0xe003826f,0x14292967,0x0a0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed, 0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1 ,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x0654be30,0xd192e819,0xd6ef5218,0xd6990624, 0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99 ,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3, 0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb ,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6, 0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x06f067aa,0x72176fba,0x0a637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b ,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6, 0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817}local function p(v)a(1,v,"string")local b=#v*8 local g =-(#v+17)%128 v=v.."\x80"..("\0"):rep(g)..d(l,b)local k,q=0x6a09e667,0xf3bcc908 local j,x=0xbb67ae85,0x84caa73b local z, _=0x3c6ef372,0xfe94f82b local E,T=0xa54ff53a,0x5f1d36f1 local A,O=0x510e527f,0xade682d1 local I,N=0x9b05688c,0x2b3e6c1f local S,H=0x1f83d9ab,0xfb41bd6b local R,D=0x5be0cd19,0x137e2179 for L=1,#v,128 do local U={m(f,v,L)}for ea=33,160,2 do local eo,ei=U[ea-30],U[ea-29]local en=n(eo,1)+i(ei,31)local es=n(ei,1)+i(eo,31)local eh=n(eo,8)+i(ei,24)local er=n(ei,8) +i(eo,24)local ed=n(eo,7)local el=n(ei,7)+i(eo,25)local eu,ec=U[ea-4],U[ea-3]local em=n(eu,19)+i(ec,13)local ef=n(ec,19) +i(eu,13)local ew=n(eu,29)+i(ec,3)local ey=n(ec,29)+i(eu,3)local ep=n(eu,6)local ev=n(ec,6)+i(eu,26)local eb,eg=U[ea-32] +s(en,eh,ed)+U[ea-14]+s(em,ey,ep),U[ea-31]+s(es,er,el)+U[ea-13]+s(ef,ew,ev)U[ea],U[ea+1]=w(eb,eg)end local C,M=k,q local F,W=j,x local Y,P=z,_ local V,B=E,T local G,K=A,O local Q,J=I,N local X,Z=S,H local ee,et=R,D for ea=1,160,2 do local eo=n(G,14)+i(K,18)local ei=n(K,14)+i(G,18)local en=n(G,18)+i(K,14)local es=n(K,18)+i(G,14)local eh=n(G,9)+i(K,23) local er=n(K,9)+i(G,23)local ed=s(eo,en,er)local el=s(ei,es,eh)local eu=s(r(G,Q),r(h(G),X))local ec=s(r(K,J),r(h(K),Z)) local em=ee+ed+eu+y[ea]+U[ea]local ef=et+el+ec+y[ea+1]+U[ea+1]local ew=n(C,28)+i(M,4)local ey=n(M,28)+i(C,4)local ep=n(C ,2)+i(M,30)local ev=n(M,2)+i(C,30)local eb=n(C,7)+i(M,25)local eg=n(M,7)+i(C,25)local ek=s(ew,ev,eg)local eq=s(ey,ep,eb) local ej=s(r(C,F),r(C,Y),r(F,Y))local ex=s(r(M,W),r(M,P),r(W,P))local ez=ek+ej local e_=eq+ex ee=X et=Z X=Q Z=J Q=G J=K G,K=w(V+em,B+ef)V=Y B=P Y=F P=W F=C W=M C,M=w(em+ez,ef+e_)end k,q=w(k+C,q+M)j,x=w(j+F,x+W)z,_=w(z+Y,_+P)E,T=w(E+V,T+B)A, O=w(A+G,O+K)I,N=w(I+Q,N+J)S,H=w(S+X,H+Z)R,D=w(R+ee,D+et)end return u(c,k,q,j,x,z,_,E,T,A,O,I,N,S,H,R,D)end return{digest =p}end e["ccryptolib.internal.packing"]=function(...)local a=string.format local function o(n,s)local h= "local C=string.char return function(_,"local r=0 for l=1,#n do h=h..a("n%d,",l)r=r+n[l]end h=h:sub(1,-2)..")local "for l=1,r do h=h..a("b%d,",l)end h=h:sub(1,-2).." "local d=1 for l=1,#n do for u=1,n[l]-1 do h=h..a( "b%d=n%d%%2^8 n%d=(n%d-b%d)*2^-8 ",d,l,l,l,d)d=d+1 end d=d+1 end h=h.."return C("d=1 if not s then for l=1,#n do for u=1 ,n[l]-1 do h=h..a("b%d,",d)d=d+1 end h=h..a("n%d%%2^8,",l)d=d+1 end else for l=1,#n do h=h..a("n%d%%2^8,",l)d=d+n[l]-2 for u=1,n[l]-1 do h=h..a("b%d,",d)d=d-1 end d=d+n[l]+1 end end h=h:sub(1,-2)..")end"return load(h)()end local function i( n,s)local h="local B=string.byte return function(_,s,i)local "local r=1 if not s then for d=1,#n do for l=1,n[d]do h=h.. a("b%d,",r)r=r+1 end end else for d=1,#n do r=r+n[d]-1 for l=1,n[d]do h=h..a("b%d,",r)r=r-1 end r=r+n[d]+1 end end h=h: sub(1,-2)..a("=B(s,i,i+%d)return ",r-2)r=1 for d=1,#n do h=h..a("b%d",r)r=r+1 for l=2,n[d]do h=h..a("+b%d*2^%d",r,8*l-8) r=r+1 end h=h..","end h=h..a("i+%d end",r-1)return load(h)()end if not string.pack or pcall(string.dump,string.pack)then local function n(a,l)local u=assert(a:match("^([><])I[I%d]+$"),"invalid format string")local c={}for m in a:gmatch( "I([%d]+)")do local f=tonumber(m)or 4 assert(f>0 and f<=16,"integral size out of limits")c[#c+1]=f end return l(c,u==">" )end local s={}local h={}local function r(a)if not s[a]then s[a]=n(a,o)end return s[a],a end local function d(a)if not h [a]then h[a]=n(a,i)end return h[a],a end return{compilePack=r,compileUnpack=d}else local function n(a)return string.pack ,a end local function s(a)return string.unpack,a end return{compilePack=n,compileUnpack=s}end end e[ "ccryptolib.internal.mp"]=function(...)local a=unpack or table.unpack local function o(p)local v,b,g,k,q,j,x,z,_,E,T=a(p )local A=v+3*2^75-3*2^75 b=b+A*2^-24 local O=b+3*2^75-3*2^75 g=g+O*2^-24 local I=g+3*2^75-3*2^75 k=k+I*2^-24 local N=k+3 *2^75-3*2^75 q=q+N*2^-24 local S=q+3*2^75-3*2^75 j=j+S*2^-24 local H=j+3*2^75-3*2^75 x=x+H*2^-24 local R=x+3*2^75-3*2^75 z=z+R*2^-24 local D=z+3*2^75-3*2^75 _=_+D*2^-24 local L=_+3*2^75-3*2^75 E=E+L*2^-24 local U=E+3*2^75-3*2^75 T=T+U*2^-24 local C=T+3*2^75-3*2^75 return{v-A,b-O,g-I,k-N,q-S,j-H,x-R,z-D,_-L,E-U,T-C},C*2^-24 end local function i(p)local v,b,g,k ,q,j,x,z,_,E,T=a(p)local A=v%2^24 b=b+(v-A)*2^-24 local O=b%2^24 g=g+(b-O)*2^-24 local I=g%2^24 k=k+(g-I)*2^-24 local N= k%2^24 q=q+(k-N)*2^-24 local S=q%2^24 j=j+(q-S)*2^-24 local H=j%2^24 x=x+(j-H)*2^-24 local R=x%2^24 z=z+(x-R)*2^-24 local D=z%2^24 _=_+(z-D)*2^-24 local L=_%2^24 E=E+(_-L)*2^-24 local U=E%2^24 T=T+(E-U)*2^-24 local C=T%2^24 local M=(T-C )*2^-24 return{A,O,I,N,S,H,R,D,L,U,C},M end local function n(p,v)local b,g,k,q,j,x,z,_,E,T,A=a(p)local O,I,N,S,H,R,D,L,U ,C,M=a(v)return{b+O,g+I,k+N,q+S,j+H,x+R,z+D,_+L,E+U,T+C,A+M}end local function s(p,v)local b,g,k,q,j,x,z,_,E,T,A=a(p) local O,I,N,S,H,R,D,L,U,C,M=a(v)return{b-O,g-I,k-N,q-S,j-H,x-R,z-D,_-L,E-U,T-C,A-M}end local function h(p,v)local b,g,k, q,j,x,z,_,E,T,A=a(p)local O,I,N,S,H,R,D,L,U,C,M=a(v)return i{b*O,g*O+b*I,k*O+g*I+b*N,q*O+k*I+g*N+b*S,j*O+q*I+k*N+g*S+b*H ,x*O+j*I+q*N+k*S+g*H+b*R,z*O+x*I+j*N+q*S+k*H+g*R+b*D,_*O+z*I+x*N+j*S+q*H+k*R+g*D+b*L,E*O+_*I+z*N+x*S+j*H+q*R+k*D+g*L+b*U ,T*O+E*I+_*N+z*S+x*H+j*R+q*D+k*L+g*U+b*C,A*O+T*I+E*N+_*S+z*H+x*R+j*D+q*L+k*U+g*C+b*M}end local function r(p,v)local b,g= h(p,v)local k,q,j,x,z,_,E,T,A,O,I=a(p)local k,N,S,H,R,D,L,U,C,M,F=a(v)return b,(i{g+I*N+O*S+A*H+T*R+E*D+_*L+z*U+x*C+j*M+ q*F,I*S+O*H+A*R+T*D+E*L+_*U+z*C+x*M+j*F,I*H+O*R+A*D+T*L+E*U+_*C+z*M+x*F,I*R+O*D+A*L+T*U+E*C+_*M+z*F,I*D+O*L+A*U+T*C+E*M+ _*F,I*L+O*U+A*C+T*M+E*F,I*U+O*C+A*M+T*F,I*C+O*M+A*F,I*M+O*F,I*F,0})end local function d(p,v,b,g)local k,q=i(n(p,b)) local j=n(v,g)j[1]=j[1]+q return k,i(j)end local function l(p)local v,b,g,k,q,j,x,z,_,E,T=a(p)return(o{v*0.5+b*2^23,g*2^ 23,k*2^23,q*2^23,j*2^23,x*2^23,z*2^23,_*2^23,E*2^23,T*2^23,0})end local function u(p)local v,b,g,k,q,j,x,z,_,E,T=a(p) local A=v*0xaaaaaa local O=b*0xaaaaaa+A local I=g*0xaaaaaa+O local N=k*0xaaaaaa+I local S=q*0xaaaaaa+N local H=j* 0xaaaaaa+S local R=x*0xaaaaaa+H local D=z*0xaaaaaa+R local L=_*0xaaaaaa+D local U=E*0xaaaaaa+L local C=T*0xaaaaaa+U return(o{v+A,b+O,g+I,k+N,q+S,j+H,x+R,z+D,_+L,E+U,T+C})end local function c(p)return p[1]%2 end local function m(p)local v,b,g,k,q,j,x,z,_,E,T=a(p)return(v+b+g+k+q+j+x+z+_+E+T)%3 end local function f(p)local v,b,g,k,q,j,x,z,_,E,T=a(p)return v+b*2^24+g*2^48+k*2^72+q*2^96+j*2^120+x*2^144+z*2^168+_*2^192+E*2^216+T*2^240 end local function w(p,v)return f(s(p,v)) end local function y(p)return{p,0,0,0,0,0,0,0,0,0,0}end return{carry=i,carryWeak=o,add=n,sub=s,dwadd=d,lmul=h,mul=r,half =l,third=u,mod2=c,mod3=m,approx=f,cmp=w,num=y}end e["ccryptolib.internal.fq"]=function(...)local a=t "ccryptolib.internal.mp"local o=t"ccryptolib.internal.util"local i=t"ccryptolib.internal.packing"local n=unpack or table .unpack local s,h=i.compilePack("<I3I3I3I3I3I3I3I3I3I3I2")local r=i.compileUnpack(h)local d,l=i.compileUnpack( "<I3I3I3I3I3I3I3I3I3I3I3")local u,c=i.compileUnpack("<I3I3I3I3I3I3I3I3I3I3I1")local m={16110573,06494812,14047250, 10680220,14612958,00000020,00000000,00000000,00000000,00000000,00004096}local f={05537307,01942290,16765621,16628356, 10618610,07072433,03735459,01369940,15276086,13038191,13409718}local w={11711996,01747860,08326961,03814718,01859974, 13327461,16105061,07590423,04050668,08138906,00000283}local y={5110253,3039345,2503500,11779568,15416472,16766550, 16777215,16777215,16777215,16777215,4095}local p=a.num(0)local function v(N)local S=a.sub(N,m)if a.approx(S)<0 then return(a.carry(N))end return(a.carry(S))end local function b(N,S)return v(a.add(N,S))end local function g(N)return v(a. sub(m,N))end local function k(N,S)return b(N,g(S))end local function q(N,S)local H,R=a.mul(N,S)local D,L=a.mul(a.lmul(H, f),m)local U,C=a.dwadd(H,R,D,L)return v(C)end local function j(N)return q(N,w)end local function x(N)local S,H=a.mul(a. lmul(N,f),m)local R,D=a.dwadd(N,p,S,H)return v(D)end local function z(N)return s(h,n(x(N)))end local function _(N)local S={r(h,N,1)}S[12]=nil return j(S)end local function E(N)local S={d(l,N,1)}S[12]=nil local H={u(c,N,34)}H[12]=nil return b(j(S),j(j(H)))end local function T(N)local S={r(h,N,1)}S[12]=nil S[1]=bit32.band(S[1],0xfffff8)S[11]=bit32.band(S[11], 0x7fff)S[11]=bit32.bor(S[11],0x4000)return j(S)end local function A(N)return q(N,y)end local function O(N)local S=o. rebaseLE(x(N),2^24,2)for H=254,289 do S[H]=nil end return S end local function I(N,S)local H=x(N)local R=x(S)local D=a. sub(H,R)local L=a.mod2(H)local U=a.mod2(R)local C=a.mod3(H)local M=a.mod3(R)local F=a.approx(R)local W=a.approx(D)local Y={[0]=0,2,1}local P={}while W~=0 do if W<0 then P[#P+1]=0 H,R=R,H L,U=U,L C,M=M,C F=a.approx(R)D=a.sub(H,R)W=-W elseif 4*W<F and C==Y[M]then P[#P+1]=1 H,R=a.third(a.add(H,D)),a.third(a.sub(R,D))L,U=U,L C,M=a.mod3(H),a.mod3(R)F=a.approx(R) elseif 4*W<F and L==U and C==M then P[#P+1]=2 H=a.half(D)L=a.mod2(H)C=Y[(C-M)%3]D=a.sub(H,R)W=a.approx(D)elseif W<3*F then P[#P+1]=3 H=a.carryWeak(D)L=(L-U)%2 C=(C-M)%3 D=a.sub(H,R)W=a.approx(D)elseif L==U then P[#P+1]=2 H=a.half(D)L=a. mod2(H)C=Y[(C-M)%3]D=a.sub(H,R)W=a.approx(D)elseif L==0 then P[#P+1]=5 H=a.half(H)L=a.mod2(H)C=Y[C]D=a.sub(H,R)W=a. approx(D)elseif C==0 then P[#P+1]=6 H=a.carryWeak(a.sub(a.third(H),R))L=(L-U)%2 C=a.mod3(H)D=a.sub(H,R)W=a.approx(D) elseif C==Y[M]then P[#P+1]=7 H=a.third(a.sub(D,R))C=a.mod3(H)D=a.sub(H,R)W=a.approx(D)elseif C==M then P[#P+1]=8 H=a. third(D)L=(L-U)%2 C=a.mod3(H)D=a.sub(H,R)W=a.approx(D)else P[#P+1]=9 R=a.half(R)U=a.mod2(R)M=Y[M]F=a.approx(R)D=a.sub(H, R)W=a.approx(D)end end local V=o.rebaseLE(H,2^24,2)while V[#V]==0 do V[#V]=nil end return{V,P}end return{add=b,sub=k,mul =q,encode=z,decode=_,decodeWide=E,decodeClamped=T,eighth=A,bits=O,makeRuleset=I}end e["ccryptolib.internal.fp"]= function(...)local a=t"ccryptolib.internal.packing"local o=unpack or table.unpack local i,n=a.compileUnpack( "<I3I3I2I3I3I2I3I3I2I3I3I2")local s={0958640*2^0,0826664*2^22,1613251*2^43,1041528*2^64,0013673*2^85,0387171*2^107, 1824679*2^128,0313839*2^149,0709440*2^170,0122635*2^192,0262782*2^213,0712905*2^234}local function h(j)return{j,0,0,0,0, 0,0,0,0,0,0,0}end local function r(j)local x,z,_,E,T,A,O,I,N,S,H,R=o(j)return{-x,-z,-_,-E,-T,-A,-O,-I,-N,-S,-H,-R}end local function d(j,x)local z,_,E,T,A,O,I,N,S,H,R,D=o(j)local L,U,C,M,F,W,Y,P,V,B,G,K=o(x)return{z+L,_+U,E+C,T+M,A+F,O+W, I+Y,N+P,S+V,H+B,R+G,D+K}end local function l(j,x)local z,_,E,T,A,O,I,N,S,H,R,D=o(j)local L,U,C,M,F,W,Y,P,V,B,G,K=o(x) return{z-L,_-U,E-C,T-M,A-F,O-W,I-Y,N-P,S-V,H-B,R-G,D-K}end local function u(j)local x,z,_,E,T,A,O,I,N,S,H,R=o(j)local D, L,U,C,M,F,W,Y,P,V,B,G G=R+3*2^306-3*2^306 x=x+19/2^255*G D=x+3*2^73-3*2^73 z=z+D L=z+3*2^94-3*2^94 _=_+L U=_+3*2^115-3*2 ^115 E=E+U C=E+3*2^136-3*2^136 T=T+C M=T+3*2^158-3*2^158 A=A+M F=A+3*2^179-3*2^179 O=O+F W=O+3*2^200-3*2^200 I=I+W Y=I+3 *2^221-3*2^221 N=N+Y P=N+3*2^243-3*2^243 S=S+P V=S+3*2^264-3*2^264 H=H+V B=H+3*2^285-3*2^285 R=R-G+B G=R+3*2^306-3*2^306 return{x-D+19/2^255*G,z-L,_-U,E-C,T-M,A-F,O-W,I-Y,N-P,S-V,H-B,R-G}end local function c(j)local x,z,_,E,T,A,O,I,N,S,H,R=o( j)local D,L,U,C,M,F,W,Y,P,V,B,G D=x%2^22 z=x-D+z L=z%2^43 _=z-L+_ U=_%2^64 E=_-U+E C=E%2^85 T=E-C+T M=T%2^107 A=T-M+A F= A%2^128 O=A-F+O W=O%2^149 I=O-W+I Y=I%2^170 N=I-Y+N P=N%2^192 S=N-P+S V=S%2^213 H=S-V+H B=H%2^234 R=H-B+R G=R%2^255 D=D+ 19/2^255*(R-G)if G/2^234==2^21-1 and B/2^213==2^21-1 and V/2^192==2^21-1 and P/2^170==2^22-1 and Y/2^149==2^21-1 and W/2 ^128==2^21-1 and F/2^107==2^21-1 and M/2^85==2^22-1 and C/2^64==2^21-1 and U/2^43==2^21-1 and L/2^22==2^21-1 and D>=2^22 -19 then return{19-2^22+D,0,0,0,0,0,0,0,0,0,0,0}else return{D,L,U,C,M,F,W,Y,P,V,B,G}end end local function m(j,x)local z =c(l(j,x))for _=1,12 do if z[_]~=0 then return false end end return true end local function f(j,x)local z,_,E,T,A,O,I,N, S,H,R,D=o(j)local L,U,C,M,F,W,Y,P,V,B,G,K=o(x)local Q,J,X,Z,ee,et,ea,eo,ei,en,es,eh Q=D*U+R*C+H*M+S*F+N*W+I*Y+O*P+A*V+T* B+E*G+_*K J=D*C+R*M+H*F+S*W+N*Y+I*P+O*V+A*B+T*G+E*K X=D*M+R*F+H*W+S*Y+N*P+I*V+O*B+A*G+T*K Z=D*F+R*W+H*Y+S*P+N*V+I*B+O*G+ A*K ee=D*W+R*Y+H*P+S*V+N*B+I*G+O*K et=D*Y+R*P+H*V+S*B+N*G+I*K ea=D*P+R*V+H*B+S*G+N*K eo=D*V+R*B+H*G+S*K ei=D*B+R*G+H*K en=D*G+R*K es=D*K Q=Q*(19/2^255)+z*L J=J*(19/2^255)+_*L+z*U X=X*(19/2^255)+E*L+_*U+z*C Z=Z*(19/2^255)+T*L+E*U+_*C+z*M ee =ee*(19/2^255)+A*L+T*U+E*C+_*M+z*F et=et*(19/2^255)+O*L+A*U+T*C+E*M+_*F+z*W ea=ea*(19/2^255)+I*L+O*U+A*C+T*M+E*F+_*W+z*Y eo=eo*(19/2^255)+N*L+I*U+O*C+A*M+T*F+E*W+_*Y+z*P ei=ei*(19/2^255)+S*L+N*U+I*C+O*M+A*F+T*W+E*Y+_*P+z*V en=en*(19/2^255)+H *L+S*U+N*C+I*M+O*F+A*W+T*Y+E*P+_*V+z*B es=es*(19/2^255)+R*L+H*U+S*C+N*M+I*F+O*W+A*Y+T*P+E*V+_*B+z*G eh=D*L+R*U+H*C+S*M+N *F+I*W+O*Y+A*P+T*V+E*B+_*G+z*K R=es+3*2^285-3*2^285 eh=eh+R D=eh+3*2^306-3*2^306 Q=Q+19/2^255*D z=Q+3*2^73-3*2^73 J=J+z _=J+3*2^94-3*2^94 X=X+_ E=X+3*2^115-3*2^115 Z=Z+E T=Z+3*2^136-3*2^136 ee=ee+T A=ee+3*2^158-3*2^158 et=et+A O=et+3*2^179- 3*2^179 ea=ea+O I=ea+3*2^200-3*2^200 eo=eo+I N=eo+3*2^221-3*2^221 ei=ei+N S=ei+3*2^243-3*2^243 en=en+S H=en+3*2^264-3*2^ 264 es=es-R+H R=es+3*2^285-3*2^285 eh=eh-D+R D=eh+3*2^306-3*2^306 return{Q-z+19/2^255*D,J-_,X-E,Z-T,ee-A,et-O,ea-I,eo-N, ei-S,en-H,es-R,eh-D}end local function w(j)local x,z,_,E,T,A,O,I,N,S,H,R=o(j)local D,L,U,C,M,F,W,Y,P,V,B local G,K,Q,J,X ,Z,ee,et,ea,eo,ei,en D=x+x L=z+z U=_+_ C=E+E M=T+T F=A+A W=O+O Y=I+I P=N+N V=S+S B=H+H G=R*L+H*U+S*C+N*M+I*F+O*O K=R*U+H *C+S*M+N*F+I*W Q=R*C+H*M+S*F+N*W+I*I J=R*M+H*F+S*W+N*Y X=R*F+H*W+S*Y+N*N Z=R*W+H*Y+S*P ee=R*Y+H*P+S*S et=R*P+H*V ea=R*V+ H*H eo=R*B ei=R*R G=G*(19/2^255)+x*x K=K*(19/2^255)+z*D Q=Q*(19/2^255)+_*D+z*z J=J*(19/2^255)+E*D+_*L X=X*(19/2^255)+T*D +E*L+_*_ Z=Z*(19/2^255)+A*D+T*L+E*U ee=ee*(19/2^255)+O*D+A*L+T*U+E*E et=et*(19/2^255)+I*D+O*L+A*U+T*C ea=ea*(19/2^255)+N *D+I*L+O*U+A*C+T*T eo=eo*(19/2^255)+S*D+N*L+I*U+O*C+A*M ei=ei*(19/2^255)+H*D+S*L+N*U+I*C+O*M+A*A en=R*D+H*L+S*U+N*C+I*M+ O*F H=ei+3*2^285-3*2^285 en=en+H R=en+3*2^306-3*2^306 G=G+19/2^255*R x=G+3*2^73-3*2^73 K=K+x z=K+3*2^94-3*2^94 Q=Q+z _=Q +3*2^115-3*2^115 J=J+_ E=J+3*2^136-3*2^136 X=X+E T=X+3*2^158-3*2^158 Z=Z+T A=Z+3*2^179-3*2^179 ee=ee+A O=ee+3*2^200-3*2^ 200 et=et+O I=et+3*2^221-3*2^221 ea=ea+I N=ea+3*2^243-3*2^243 eo=eo+N S=eo+3*2^264-3*2^264 ei=ei-H+S H=ei+3*2^285-3*2^ 285 en=en-R+H R=en+3*2^306-3*2^306 return{G-x+19/2^255*R,K-z,Q-_,J-E,X-T,Z-A,ee-O,et-I,ea-N,eo-S,ei-H,en-R}end local function y(j,x)local z,_,E,T,A,O,I,N,S,H,R,D=o(j)local L,U,C,M,F,W,Y,P,V,B,G,K z=z*x _=_*x E=E*x T=T*x A=A*x O=O*x I=I*x N=N*x S=S*x H=H*x R=R*x D=D*x K=D+3*2^306-3*2^306 z=z+19/2^255*K L=z+3*2^73-3*2^73 _=_+L U=_+3*2^94-3*2^94 E=E+U C=E+3*2 ^115-3*2^115 T=T+C M=T+3*2^136-3*2^136 A=A+M F=A+3*2^158-3*2^158 O=O+F W=O+3*2^179-3*2^179 I=I+W Y=I+3*2^200-3*2^200 N=N +Y P=N+3*2^221-3*2^221 S=S+P V=S+3*2^243-3*2^243 H=H+V B=H+3*2^264-3*2^264 R=R+B G=R+3*2^285-3*2^285 D=D-K+G K=D+3*2^306 -3*2^306 return{z-L+19/2^255*K,_-U,E-C,T-M,A-F,O-W,I-Y,N-P,S-V,H-B,R-G,D-K}end local function p(j,x)for z=1,x do j=w(j) end return j end local function v(j)local x=w(j)local z=f(j,p(x,2))local _=f(z,x)local E=f(w(_),z)local T=f(p(E,5),E) local A=f(p(T,10),T)local O=f(p(A,20),A)local I=f(p(O,10),T)local N=f(p(I,50),I)local S=f(p(N,100),N)local H=f(p(S,50),I )return f(p(H,5),_)end local function b(j,x)j=u(j)local z=w(x)local _=f(x,z)local E=w(_)local T=f(x,E)local A=f(j,T) local O=f(w(A),A)local I=f(p(O,2),O)local N=f(p(I,4),I)local S=f(p(N,8),N)local H=f(p(S,2),O)local R=f(p(S,16),S)local D =f(p(R,18),H)local L=f(p(D,50),D)local U=f(p(L,100),L)local C=f(p(U,50),D)local M=f(p(C,2),A)local F=f(j,_)local W=f(F,M )local Y=w(W)local P=f(x,Y)if not m(P,j)then W=f(W,s)Y=w(W)P=f(x,Y)end if m(P,j)then return W else return nil end end local function g(j)j=c(j)local x,z,_,E,T,A,O,I,N,S,H,R=o(j)local D={}local L=x local function U(C)for M=1,C do local F=L %256 D[#D+1]=F L=(L-F)/256 end end U(2)L=L+z/2^16 U(3)L=L+_/2^40 U(3)L=L+E/2^64 U(2)L=L+T/2^80 U(3)L=L+A/2^104 U(3)L=L+O /2^128 U(2)L=L+I/2^144 U(3)L=L+N/2^168 U(3)L=L+S/2^192 U(2)L=L+H/2^208 U(3)L=L+R/2^232 U(3)return string.char(o(D))end local function k(j)local x,z,_,E,T,A,O,I,N,S,H,R=i(n,j,1)R=R%2^15 return u{x,z*2^24,_*2^48,E*2^64,T*2^88,A*2^112,O*2^128 ,I*2^152,N*2^176,S*2^192,H*2^216,R*2^240}end local function q(j)local x=c(j)local z,_,E,T,A,O,I,N,S,H,R,D=o(x)return z+_ +E+T+A+O+I+N+S+H+R+D==0 end return{num=h,neg=r,add=d,sub=l,kmul=y,mul=f,canonicalize=c,square=w,carry=u,invert=v,sqrtDiv =b,encode=g,decode=k,eqz=q}end e["ccryptolib.internal.edwards25519"]=function(...)local a=t"ccryptolib.internal.fp" local o=unpack or table.unpack local i=a.mul(a.num(-121665),a.invert(a.num(121666)))local n=a.kmul(i,2)local s={a.num(0) ,a.num(1),a.num(1),a.num(0)}local h=nil local function r(j)local x,z,_=o(j)local E=a.square(x)local T=a.square(z)local A =a.square(_)local O=a.add(A,A)local I=a.add(E,T)local N=a.add(x,z)local S=a.square(N)local H=a.carry(a.sub(S,I))local R= a.sub(T,E)local D=a.carry(a.sub(O,R))local L=a.mul(H,D)local U=a.mul(R,I)local C=a.mul(D,R)local M=a.mul(H,I)return{L,U, C,M}end local function d(j,x)local z,_,E,T=o(j)local A,O,I,N=o(x)local S=a.sub(_,z)local H=a.mul(S,O)local R=a.add(_,z) local D=a.mul(R,A)local L=a.mul(T,N)local U=a.mul(E,I)local C=a.sub(D,H)local M=a.sub(U,L)local F=a.add(U,L)local W=a. add(D,H)local Y=a.mul(C,M)local P=a.mul(F,W)local V=a.mul(M,F)local B=a.mul(C,W)return{Y,P,V,B}end local function l(j,x) local z,_,E,T=o(j)local A,O,I,N=o(x)local S=a.sub(_,z)local H=a.mul(S,A)local R=a.add(_,z)local D=a.mul(R,O)local L=a. mul(T,N)local U=a.mul(E,I)local C=a.sub(D,H)local M=a.add(U,L)local F=a.sub(U,L)local W=a.add(D,H)local Y=a.mul(C,M) local P=a.mul(F,W)local V=a.mul(M,F)local B=a.mul(C,W)return{Y,P,V,B}end local function u(j)local x,z,_,E=o(j)local T=a. add(z,x)local A=a.sub(z,x)local O=a.add(_,_)local I=a.mul(E,n)return{T,A,O,I}end local function c(j)local x,z,_=o(j) local E=a.invert(_)local T=a.mul(x,E)local A=a.mul(z,E)local O=a.num(1)local I=a.mul(T,A)return{T,A,O,I}end local function m(j)j=c(j)local x,z=o(j)local _=a.encode(z)local E=a.canonicalize(x)[1]%2 return _:sub(1,-2)..string.char(_: byte(-1)+E*128)end local function f(j)local x=a.decode(j)local z=a.square(x)local _=a.sub(z,a.num(1))local E=a.mul(z,i) local T=a.add(E,a.num(1))local A=a.sqrtDiv(_,T)if not A then return nil end local O=a.canonicalize(A)[1]%2 if O~=bit32. extract(j:byte(-1),7)then A=a.carry(a.neg(A))end local I=a.num(1)local N=a.mul(A,x)return{A,x,I,N}end h=f( "Xfffffffffffffffffffffffffffffff")local function w(j,x)local z=2^x local _=z/2 local E={}local T=0 local A=1 for O=1,#j do T=T+j[O]*A A=A*2 while O==#j and T>0 or A>z do local I=T%z if I>=_ then I=I-z end T=(T-I)/z A=A/z E[#E+1]=I end end return E end local function y(j,x)local z={}for _=1,math.ceil(256/x)do local E={u(j)}for T=2,2^x/2 do j=d(j,E[1])E[T]=u( j)end z[_]=E j=r(j)end return z end local p=5 local v=y(h,p)local function b(j,x)local z=2^x local _=z/2 local E={} local T=0 local A=1 for O=1,#j do T=T+j[O]*A A=A*2 while O==#j and T>0 or A>z do if T%2==0 then T=T/2 A=A/2 E[#E+1]=0 else local I=T%z if I>=_ then I=I-z end T=T-I E[#E+1]=I end end end while E[#E]==0 do E[#E]=nil end return E end local function g(j,x)local z=r(j)local _={u(j)}for E=3,2^x,2 do _[E]=u(d(z,_[E-2]))end return _ end local function k(j)local x =w(j,p)local z=s for _=1,#x do local E=x[_]if E>0 then z=d(z,v[_][E])elseif E<0 then z=l(z,v[_][-E])end end return z end local function q(j,x)local z=b(x,5)local _=g(j,5)local E=s for T=#z,1,-1 do local A=z[T]if A==0 then E=r(E)elseif A>0 then E=d(E,_[A])else E=l(E,_[-A])end end return E end return{double=r,add=d,sub=l,niels=u,scale=c,encode=m,decode=f,mulG =k,mul=q}end e["ccryptolib.internal.curve25519"]=function(...)local a=t"ccryptolib.internal.fp"local o=t "ccryptolib.internal.edwards25519"local i=t"ccryptolib.random"local function n(y)local p,v=y[1],y[2]local g=a.add(p,v) local k=a.square(g)local q=a.sub(p,v)local j=a.square(q)local x=a.sub(k,j)local z=a.mul(k,j)local _=a.mul(x,a.add(j,a. kmul(x,121666)))return{z,_}end local function s(y,p,v)local g,k=y[1],y[2]local q,j=p[1],p[2]local x,z=v[1],v[2]local _=a .add(q,j)local E=a.sub(q,j)local T=a.add(x,z)local A=a.sub(x,z)local O=a.mul(A,_)local I=a.mul(T,E)local N=a.mul(k,a. square(a.add(O,I)))local S=a.mul(g,a.square(a.sub(O,I)))return{N,S}end local function h(y,p,v)local g,k=y[1],y[2]local q ,j=p[1],p[2]local x,z=v[1],v[2]local _=a.add(q,j)local E=a.square(_)local T=a.sub(q,j)local A=a.square(T)local O=a.sub(E ,A)local I=a.add(x,z)local N=a.sub(x,z)local S=a.mul(N,_)local H=a.mul(I,T)local R=a.mul(k,a.square(a.add(S,H)))local D= a.mul(g,a.square(a.sub(S,H)))local L=a.mul(E,A)local U=a.mul(O,a.add(A,a.kmul(O,121666)))return{L,U},{R,D}end local function r(y,p)local v={a.num(1),a.num(0)}local b=y for g=#p,1,-1 do if p[g]==0 then v,b=h(y,v,b)else b,v=h(y,b,v)end end return v end local function d(y,p)local v=a.decode(i.random(32))y={a.mul(y[1],v),a.mul(y[2],v)}return n(n(n(r(y,p))) )end local function l(y)return{a.mul(y[1],a.invert(y[2])),a.num(1)}end local function u(y)return a.encode(y[1])end local function c(y)return{a.decode(y),a.num(1)}end local function m(y)local p=a.decode(y)local v=a.carry(a.add(a.num(1),p)) local b=a.carry(a.sub(a.num(1),p))if a.eqz(b)then return{a.num(0),a.num(1)}else return{v,b}end end local function f(y) local p=o.mulG(y)local v,b=p[2],p[3]local g=a.carry(a.add(v,b))local k=a.carry(a.sub(b,v))return{g,k}end local function w(y,p)local v=a.decode(i.random(32))local b={a.mul(y[1],v),a.mul(y[2],v)}local b=n(n(n(b)))if a.eqz(b[2])then return end b=r(b,p[1])local g=p[2]if#g==0 then return end local k,q local j=g[#g]if j==2 then local x=n(b)b,k,q=s(b,x,b),b,x elseif j==3 or j==5 then b,k,q=n(b),b,b elseif j==6 then local x=n(b)local z=s(b,x,b)b,k,q=n(z),b,s(b,z,x)elseif j==7 then local x=n(b)local z=s(b,x,b)local _=n(x)b,k,q=s(z,_,b),b,_ elseif j==8 then local x=n(b)local z=s(b,x,b)b,k,q=n(x),b,z else b,k,q=b,n(b),b end for x=#g-1,1,-1 do local j=g[x]if j==0 then b,k=k,b elseif j==1 then local z=s(q,b,k)b,k=s(k,z,b ),s(b,z,k)elseif j==2 then b,q=s(k,s(q,b,k),b),n(b)elseif j==3 then b,q=s(q,b,k),b elseif j==5 then b,q=n(b),s(k,b,q) elseif j==6 then local z=s(q,b,k)local _=n(z)b,q=s(z,_,z),s(s(b,z,k),_,b)elseif j==7 then local z=s(q,b,k)local _=s(k,z, b)b,q=s(b,_,z),s(z,_,b)elseif j==8 then local z=n(b)b,q=s(q,z,s(q,b,k)),s(b,z,b)else k,q=n(k),s(b,q,k)end end return b,k ,q end return{G={a.num(9),a.num(1)},dadd=s,scale=l,encode=u,decode=c,decodeEd=m,ladder8=d,mulG=f,prac=w}end e[ "ccryptolib.ed25519"]=function(...)local a=t"cc.expect".expect local o=t"ccryptolib.internal.util".lassert local i=t "ccryptolib.internal.fq"local n=t"ccryptolib.internal.sha512"local s=t"ccryptolib.internal.edwards25519"local h=t "ccryptolib.random"local function r(u)a(1,u,"string")assert(#u==32,"secret key length must be 32")local c=n.digest(u) local m=i.decodeClamped(c:sub(1,32))return s.encode(s.mulG(i.bits(m)))end local function d(u,c,m)a(1,u,"string")o(#u==32 ,"secret key length must be 32",2)a(2,c,"string")o(#c==32,"public key length must be 32",2)a(3,m,"string")local f=n. digest(u)local w=i.decodeClamped(f:sub(1,32))local y=i.decodeWide(h.random(64))local p=s.mulG(i.bits(y))local v=s.encode( p)local b=i.decodeWide(n.digest(v..c..m))local g=i.decodeWide(h.random(64))local k=i.sub(i.add(y,i.mul(i.add(w,g),b)),i. mul(g,b))local q=i.encode(k)return v..q end local function l(u,c,m)a(1,u,"string")o(#u==32, "public key length must be 32",2)a(2,c,"string")a(3,m,"string")o(#m==64,"signature length must be 64",2)local f=s.decode( u)if not f then return false end local w=m:sub(1,32)local y=m:sub(33)local p=i.decodeWide(n.digest(w..u..c))local v=s. mulG(i.bits(i.decode(y)))local b=s.mul(f,i.bits(p))local g=s.sub(v,s.niels(b))return s.encode(g)==w end return{publicKey =r,sign=d,verify=l}end e["ccryptolib.chacha20"]=function(...)local a=t"cc.expect".expect local o=t "ccryptolib.internal.util".lassert local i=t"ccryptolib.internal.packing"local n=bit32.bxor local s=bit32.lrotate local h,r=i.compileUnpack("<I4I4I4I4I4I4I4I4")local d,l=i.compileUnpack("<I4I4I4")local u,c=i.compilePack( "<I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4")local m=i.compileUnpack(c)local function f(w,y,p,v,b)a(1,w,"string")o(#w==32, "key length must be 32",2)a(2,y,"string")o(#y==12,"nonce length must be 12",2)a(3,p,"string")v=a(4,v,"number","nil")or 20 o(v%2==0,"round number must be even",2)o(v>=8,"round number must be no smaller than 8",2)o(v<=20, "round number must be no larger than 20",2)b=a(5,b,"number","nil")or 1 o(b%1==0,"offset must be an integer",2)o(b>=0, "offset must be nonnegative",2)o(#p+64*b<=2^38,"offset too large",2)local g,k,q,j=0x61707865,0x3320646e,0x79622d32, 0x6b206574 local x,z,_,E,T,A,O,I=h(r,w,1)local N,S,H,R=b,d(l,y,1)local D=p..("\0"):rep(-#p%64)local L={}local U=1 for C= 1,#D/64 do local M,F,W,Y=g,k,q,j local P,V,B,G=x,z,_,E local K,Q,J,X=T,A,O,I local Z,ee,et,ea=N,S,H,R for eb=1,v,2 do M= M+P Z=s(n(Z,M),16)K=K+Z P=s(n(P,K),12)M=M+P Z=s(n(Z,M),8)K=K+Z P=s(n(P,K),7)F=F+V ee=s(n(ee,F),16)Q=Q+ee V=s(n(V,Q),12)F =F+V ee=s(n(ee,F),8)Q=Q+ee V=s(n(V,Q),7)W=W+B et=s(n(et,W),16)J=J+et B=s(n(B,J),12)W=W+B et=s(n(et,W),8)J=J+et B=s(n(B,J ),7)Y=Y+G ea=s(n(ea,Y),16)X=X+ea G=s(n(G,X),12)Y=Y+G ea=s(n(ea,Y),8)X=X+ea G=s(n(G,X),7)M=M+V ea=s(n(ea,M),16)J=J+ea V=s( n(V,J),12)M=M+V ea=s(n(ea,M),8)J=J+ea V=s(n(V,J),7)F=F+B Z=s(n(Z,F),16)X=X+Z B=s(n(B,X),12)F=F+B Z=s(n(Z,F),8)X=X+Z B=s( n(B,X),7)W=W+G ee=s(n(ee,W),16)K=K+ee G=s(n(G,K),12)W=W+G ee=s(n(ee,W),8)K=K+ee G=s(n(G,K),7)Y=Y+P et=s(n(et,Y),16)Q=Q+ et P=s(n(P,Q),12)Y=Y+P et=s(n(et,Y),8)Q=Q+et P=s(n(P,Q),7)end local eo,ei,en,es,eh,er,ed,el local eu,ec,em,ef,ew,ey,ep, ev eo,ei,en,es,eh,er,ed,el,eu,ec,em,ef,ew,ey,ep,ev,U=m(c,D,U)L[C]=u(c,n(eo,M+g),n(ei,F+k),n(en,W+q),n(es,Y+j),n(eh,P+x), n(er,V+z),n(ed,B+_),n(el,G+E),n(eu,K+T),n(ec,Q+A),n(em,J+O),n(ef,X+I),n(ew,Z+N),n(ey,ee+S),n(ep,et+H),n(ev,ea+R))N=N+1 end return table.concat(L):sub(1,#p)end return{crypt=f}end e["ccryptolib.blake3"]=function(...)local a=t"cc.expect". expect local o=t"ccryptolib.internal.util".lassert local i=t"ccryptolib.internal.packing"local n=unpack or table.unpack local s=bit32.bxor local h=bit32.lrotate local r,d=i.compilePack("<I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4")local l=i. compileUnpack(d)local u,c=i.compileUnpack("<I4I4I4I4I4I4I4I4")local m=0x01 local f=0x02 local w=0x04 local y=0x08 local p=0x10 local v=0x20 local b=0x40 local g={0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab, 0x5be0cd19}local function k(E,T,A,O,I,N)local S,H,R,D,L,U,C,M=n(E)local F,W,Y,P=S,H,R,D local V,B,G,K=L,U,C,M local Q,J, X,Z=0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a local ee=A%2^32 local et=(A-ee)*2^-32 local ea,eo,ei,en,es,eh,er,ed,el, eu,ec,em,ef,ew,ey,ep=n(T)local ev for eb=1,7 do F=F+V+ea ee=h(s(ee,F),16)Q=Q+ee V=h(s(V,Q),20)F=F+V+eo ee=h(s(ee,F),24)Q =Q+ee V=h(s(V,Q),25)W=W+B+ei et=h(s(et,W),16)J=J+et B=h(s(B,J),20)W=W+B+en et=h(s(et,W),24)J=J+et B=h(s(B,J),25)Y=Y+G+es O=h(s(O,Y),16)X=X+O G=h(s(G,X),20)Y=Y+G+eh O=h(s(O,Y),24)X=X+O G=h(s(G,X),25)P=P+K+er I=h(s(I,P),16)Z=Z+I K=h(s(K,Z),20) P=P+K+ed I=h(s(I,P),24)Z=Z+I K=h(s(K,Z),25)F=F+B+el I=h(s(I,F),16)X=X+I B=h(s(B,X),20)F=F+B+eu I=h(s(I,F),24)X=X+I B=h(s( B,X),25)W=W+G+ec ee=h(s(ee,W),16)Z=Z+ee G=h(s(G,Z),20)W=W+G+em ee=h(s(ee,W),24)Z=Z+ee G=h(s(G,Z),25)Y=Y+K+ef et=h(s(et,Y ),16)Q=Q+et K=h(s(K,Q),20)Y=Y+K+ew et=h(s(et,Y),24)Q=Q+et K=h(s(K,Q),25)P=P+V+ey O=h(s(O,P),16)J=J+O V=h(s(V,J),20)P=P+V +ep O=h(s(O,P),24)J=J+O V=h(s(V,J),25)if eb~=7 then ev=ei ei=en en=ec ec=ef ef=eu eu=em em=eh eh=ea ea=ev ev=er er=es es =ed ed=ew ew=ey ey=ep ep=el el=eo eo=ev end end if N then return{s(F,Q),s(W,J),s(Y,X),s(P,Z),s(V,ee),s(B,et),s(G,O),s(K, I),s(Q,S),s(J,H),s(X,R),s(Z,D),s(ee,L),s(et,U),s(O,C),s(I,M)}else return{s(F,Q),s(W,J),s(Y,X),s(P,Z),s(V,ee),s(B,et),s(G ,O),s(K,I)}end end local function q(E,T)for A=1,8 do E[A+8]=T[A]end return E end local function j(E,T,A,O)local I={} local N=E local S=0 local H=0 local R=m local D=0 for V=1,#A-64,64 do local B={l(d,A,V)}local G=T+R+D N=k(N,B,S,64,G)R=0 H=H+1 if H==15 then D=f elseif H==16 then local K=N local Q=S+1 while Q%2==0 do local B=q(table.remove(I),K)K=k(E,B,0,64 ,T+w)Q=Q/2 end table.insert(I,K)N=E S=S+1 H=0 R=m D=0 end end local L=#A==0 and 0 or(#A-1)%64+1 local U=A:sub(-L)..("\0" ):rep(64)local C={l(d,U,1)}local M,F,W,Y if S>0 then local V=T+R+f local B=k(N,C,S,L,V)for G=#I,2,-1 do local K=q(I[G],B )B=k(E,K,0,64,T+w)end M=E F=q(I[1],B)W=64 Y=T+y+w else M=N F=C W=L Y=T+R+f+y end local P={}for V=0,O/64 do local B=k(M,F ,V,W,Y,true)P[V+1]=r(d,n(B))end return table.concat(P):sub(1,O)end local function x(E,T)a(1,E,"string")T=a(2,T,"number", "nil")or 32 o(T%1==0,"desired output length must be an integer",2)o(T>=1,"desired output length must be positive",2) return j(g,0,E,T)end local function z(E,T,A)a(1,E,"string")o(#E==32,"key length must be 32",2)a(2,T,"string")A=a(3,A, "number","nil")or 32 o(A%1==0,"desired output length must be an integer",2)o(A>=1, "desired output length must be positive",2)return j({u(c,E,1)},p,T,A)end local function _(E)a(1,E,"string")local T={u(c, j(g,v,E,32),1)}return function(A,O)a(1,A,"string")O=a(2,O,"number","nil")or 32 o(O%1==0, "desired output length must be an integer",2)o(O>=1,"desired output length must be positive",2)return j(T,b,A,O)end end return{digest=x,digestKeyed=z,deriveKey=_}end e["ccryptolib.aead"]=function(...)local a=t"cc.expect".expect local o=t "ccryptolib.internal.util".lassert local i=t"ccryptolib.internal.packing"local n=t"ccryptolib.chacha20"local s=t "ccryptolib.poly1305"local h,r=i.compilePack("<I8")local d,l=i.compileUnpack("<I4I4I4I4")local u=bit32.bxor local function c(f,w,y,p,v)a(1,f,"string")o(#f==32,"key length must be 32",2)a(2,w,"string")o(#w==12,"nonce length must be 12" ,2)a(3,y,"string")a(4,p,"string")v=a(5,v,"number","nil")or 20 o(v%2==0,"round number must be even",2)o(v>=8, "round number must be no smaller than 8",2)o(v<=20,"round number must be no larger than 20",2)local b=("\0"):rep(64)..y local g=n.crypt(f,w,b,v,0)local k=g:sub(1,32)local q=g:sub(65)local j=("\0"):rep(-#p%16)local x=("\0"):rep(-#q%16)local z=h("<I8",#p)local _=h("<I8",#q)local E=p..j..q..x..z.._ local T=s.mac(k,E)return q,T end local function m(f,w,y,p,v,b)a( 1,f,"string")o(#f==32,"key length must be 32",2)a(2,w,"string")o(#w==12,"nonce length must be 12",2)a(3,y,"string")o(#y ==16,"tag length must be 16",2)a(4,p,"string")a(5,v,"string")b=a(6,b,"number","nil")or 20 o(b%2==0, "round number must be even",2)o(b>=8,"round number must be no smaller than 8",2)o(b<=20, "round number must be no larger than 20",2)local g=n.crypt(f,w,("\0"):rep(32),b,0)local k=("\0"):rep(-#v%16)local q=( "\0"):rep(-#p%16)local j=h(r,#v)local x=h(r,#p)local z=v..k..p..q..j..x local _,E,T,A=d(l,y,1)local O,I,N,S=d(l,s.mac(g, z),1)local H=u(_,O)+u(E,I)+u(T,N)+u(A,S)if H~=0 then return nil end return n.crypt(f,w,p,b)end return{encrypt=c,decrypt= m}end e["Howlfile"]=function(...)local a=os.date("!%Y-%m-%dT%H:%M:%SZ")local function o(l)local u=l local c,m=pcall( function()local f=fs.open(fs.combine(u,"HEAD"),"r")local w=f.readAll()f.close()local y=w:match("ref: refs/heads/(.+)"): gsub("[\r\n]+$","")local p=fs.combine(u,"refs/heads/"..y)local f,v=fs.open(p,"r")local b=f.readAll()f.close()return b: gsub("[\r\n]+$","")end)if not c then return"<unknown>"end return m end local function i(l)return o(fs.combine(l, "../.git/"))end local function n(l)return o(fs.combine(l,"../.git/modules/client/ccryptolib/"))end local s=t "howl.tasks.Task"local h=t"howl.lib.assert"local r=t"howl.tasks.Runner"Options:Default("trace")Tasks:clean()Tasks:minify "minify"{input="build/sgps.lua",output="build/sgps.min.lua"}Tasks:require"main"{startup="sgps.lua",output= "build/sgps.lua"}local d=s:subclass("sgps.client.InfoTask"):addOptions({"comments"})function d:initialize(l,u,c)s. initialize(self,u,c)self:description"Add comments on the top of a file"end function d:setup(l,u)s.setup(self,l,u)if type( self.options.comments)~="table"then l.logger:error("Task '%s': Invalid option 'comments', expected table, got %s",self. name,type(self.options.comments))else for c,m in ipairs(self.options.comments)do local f=m[1]local w=m[2]if not(type(f) =="string"or type(f)=="function")then l.logger:error("Task '%s': Invalid comment in comment #%d, expected string|function, got %s" ,self.name,c,type(f))end if type(w)~="table"then l.logger:error("Task '%s': Invalid files in comment #%d, expected string, got %s" ,self.name,c,type(w))else for y,p in ipairs(w)do if type(p)~="string"then l.logger:error( "Task '%s': Invalid comment #%d - invalid file #%d, expected string, got %s",self.name,c,y,type(p))end end end end end end function d:runAction(l)for u,c in ipairs(self.options.comments)do local m=c[1]if type(m)=="function"then local f,w= pcall(m,l)if not f then l.logger:error("Info task '%s': failed to execute comment generator fn #%d: %s",self.name,u,w) elseif type(w)=="string"then m=w else l.logger:error("Info task '%s': invalid return type from comment generator fn #%d: expected string, got %s" ,self.name,u,type(w))end end if type(m)=="string"then for f,w in ipairs(c[2])do l.logger:verbose(string.format( "Info task '%s': doing comment #%d for file #%d (%s)",self.name,u,f,w))w=fs.combine(l.root,w)local y do local p,v=fs. open(w,"r")if p then y=p.readAll()p.close()else l.logger:error("Info task '%s': failed to open file with 'r': %s",self. name,v)end end if y then local p,v=fs.open(w,"w")if p then p.write(m.."\n"..y)p.close()else l.logger:error( "Info task '%s': failed to open file with 'w': %s",self.name,v)end end end end end end r:include({infoTask=function(l,u, c,m)return l:injectTask(d(l.env,u,c,m))end})Tasks:infoTask"info"{comments={{function(l)return table.concat({ "-- Copyright (c) 2024 PatriikPlays","-- ","-- This work is licensed under the terms of the MIT license.", "-- For a copy, see <https://opensource.org/licenses/MIT>.","-- ",string.format("-- SGPS client %s (https://github.com/PatriikPlays/sgps), built at %s" ,i(l.root),a),string.format("-- This program uses ccryptolib %s (https://github.com/migeyel/ccryptolib), which is licensed under the MIT license" ,n(l.root))},"\n")end,{"build/sgps.lua","build/sgps.min.lua"}}}}Tasks:Task"build"{"clean","minify","info"}:Description( "Main build task")Tasks:Default"build"end return e["sgps"](...)
Syntax
Auto Detect
Apache Access Log
Apache config
Arduino
ARM Assembly
AsciiDoc
AutoHotkey
Bash
BASIC
Brainfuck
C
Clojure
CMake
CoffeeScript
C++
C#
CSS
D
Dart
Delphi
Diff
Django
DNS Zone
Dockerfile
Batch file (DOS)
dsconfig
Dust
Erlang
Excel formulae
Fortran
F#
G-code (ISO 6983)
GLSL
GML
Go
Gradle
Groovy
Handlebars
Haskell
Haxe
HTML
HTMLbars
HTTP
INI
Java
Javascript
JSON
Julia
Kotlin
Lasso
LaTeX
Leaf
Less
Lisp
Lua
Makefile
Markdown
Mathematica
Matlab
MoonScript
Nginx config
Objective-C
OpenSCAD
Perl
PostgreSQL
php
PHP template
Plain text
PowerShell
.properties
Python
Q
QML
R
Ruby
Rust
Scala
Scheme
SCSS
Shell Session
SQL
Swift
TypeScript
Visual Basic .NET
VBScript
VBScript in HTML
VHDL
Vim Script
Intel x86 Assembly
XML
YAML
Exposure
Public
Unlisted
Folder
No folder
Create Paste
Create as guest