storage-solution/tiny_ra_library.lua

97 lines
16 KiB
Lua
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local function crypto()
local function a()local b,c=table.insert,table.concat;local function d(e,f,g,h,i)local j,k,l,m=e[f],e[g],e[h],e[i]local n;j=(j+k)%0x100000000;n=bit32.bxor(m,j)m=bit32.band(bit32.bor(bit32.lshift(n,16),bit32.rshift(n,16)),0xffffffff)l=(l+m)%0x100000000;n=bit32.bxor(k,l)k=bit32.band(bit32.bor(bit32.lshift(n,12),bit32.rshift(n,20)),0xffffffff)j=(j+k)%0x100000000;n=bit32.bxor(m,j)m=bit32.band(bit32.bor(bit32.lshift(n,8),bit32.rshift(n,24)),0xffffffff)l=(l+m)%0x100000000;n=bit32.bxor(k,l)k=bit32.band(bit32.bor(bit32.lshift(n,7),bit32.rshift(n,25)),0xffffffff)e[f],e[g],e[h],e[i]=j,k,l,m;return e end;local o={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}local p={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}local q=function(r,s,t)local e=o;local u=p;e[1],e[2],e[3],e[4]=0x61707865,0x3320646e,0x79622d32,0x6b206574;for v=1,8 do e[v+4]=r[v]end;e[13]=s;for v=1,3 do e[v+13]=t[v]end;for v=1,16 do u[v]=e[v]end;for w=1,10 do d(u,1,5,9,13)d(u,2,6,10,14)d(u,3,7,11,15)d(u,4,8,12,16)d(u,1,6,11,16)d(u,2,7,12,13)d(u,3,8,9,14)d(u,4,5,10,15)end;for v=1,16 do e[v]=bit32.band(e[v]+u[v],0xffffffff)end;return e end;local x="<I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4"local function y(r,s,t,z,A)local B=#z-A+1;if B<64 then local C=string.sub(z,A)z=C..string.rep('\0',64-B)A=1 end;assert(#z>=64)local D=table.pack(string.unpack(x,z,A))local E=q(r,s,t)for v=1,16 do D[v]=bit32.bxor(D[v],E[v])end;local F=string.pack(x,table.unpack(D))if B<64 then F=string.sub(F,1,B)end;return F end;local G=function(r,s,t,z)assert(s+math.floor(#z/64)+1<0xffffffff,"block counter must fit an uint32")assert(#r==32,"#key must be 32")assert(#t==12,"#nonce must be 12")local H=table.pack(string.unpack("<I4I4I4I4I4I4I4I4",r))local I=table.pack(string.unpack("<I4I4I4",t))local n={}local A=1;while A<=#z do b(n,y(H,s,I,z,A))A=A+64;s=s+1 end;local J=c(n)return J end;local function K(r,L)local H=table.pack(string.unpack("<I4I4I4I4I4I4I4I4",r))local I=table.pack(string.unpack("<I4I4I4I4",L))local e={}e[1],e[2],e[3],e[4]=0x61707865,0x3320646e,0x79622d32,0x6b206574;for v=1,8 do e[v+4]=H[v]end;for v=1,4 do e[v+12]=I[v]end;for w=1,10 do d(e,1,5,9,13)d(e,2,6,10,14)d(e,3,7,11,15)d(e,4,8,12,16)d(e,1,6,11,16)d(e,2,7,12,13)d(e,3,8,9,14)d(e,4,5,10,15)end;local M=string.pack("<I4I4I4I4I4I4I4I4",e[1],e[2],e[3],e[4],e[13],e[14],e[15],e[16])return M end;local function N(r,s,t,z)assert(#r==32,"#key must be 32")assert(#t==24,"#nonce must be 24")local M=K(r,t:sub(1,16))local O='\0\0\0\0'..t:sub(17)return G(M,s,O,z)end;return{chacha20_encrypt=G,chacha20_decrypt=G,encrypt=G,decrypt=G,hchacha20=K,xchacha20_encrypt=N,xchacha20_decrypt=N,key_size=32,nonce_size=12,xnonce_size=24}end;local function P()local Q=string.unpack;local bit32=bit32;local function R(S)local e={r={bit32.band(Q('<I4',S,1),0x3ffffff),bit32.band(bit32.rshift(Q('<I4',S,4),2),0x3ffff03),bit32.band(bit32.rshift(Q('<I4',S,7),4),0x3ffc0ff),bit32.band(bit32.rshift(Q('<I4',S,10),6),0x3f03fff),bit32.band(bit32.rshift(Q('<I4',S,13),8),0x00fffff)},h={0,0,0,0,0},pad={Q('<I4',S,17),Q('<I4',S,21),Q('<I4',S,25),Q('<I4',S,29)},buffer="",leftover=0,final=false}return e end;local function T(e,U)local V=#U;local W=1;local X=e.final and 0 or 0x01000000;local Y=e.r[1]local Z=e.r[2]local _=e.r[3]local a0=e.r[4]local a1=e.r[5]local a2=Z*5;local a3=_*5;local a4=a0*5;local a5=a1*5;local a6=e.h[1]local a7=e.h[2]local a8=e.h[3]local a9=e.h[4]local aa=e.h[5]local ab,ac,ad,ae,af,l;while V>=16 do a6=a6+bit32.band(Q('<I4',U,W),0x3ffffff)a7=a7+bit32.band(bit32.rshift(Q('<I4',U,W+3),2),0x3ffffff)a8=a8+bit32.band(bit32.rshift(Q('<I4',U,W+6),4),0x3ffffff)a9=a9+bit32.band(bit32.rshift(Q('<I4',U,W+9),6),0x3ffffff)aa=aa+bit32.bor(bit32.rshift(Q('<I4',U,W+12),8),X)ab=a6*Y+a7*a5+a8*a4+a9*a3+aa*a2;ac=a6*Z+a7*Y+a8*a5+a9*a4+aa*a3;ad=a6*_+a7*Z+a8*Y+a9*a5+aa*a4;ae=a6*a0+a7*_+a8*Z+a9*Y+aa*a5;af=a6*a1+a7*a0+a8*_+a9*Z+aa*Y;l=bit32.band(bit32.rshift(ab,26),0xffffffff)a6=bit32.band(ab,0x3ffffff)ac=ac+l;l=bit32.band(bit32.rshift(ac,26),0xffffffff)a7=bit32.band(ac,0x3ffffff)ad=ad+l;l=bit32.band(bit32.rshift(ad,26),0xffffffff)a8=bit32.band(ad,0x3ffffff)ae=ae+l;l=bit32.band(bit32.rshift(ae,26),0xffffffff)a9=bit32.band(ae,0x3ffffff)af=af+l;l=bit32.band(bit32.rshift(af,26),0xffffffff)aa=bit32.band(af,0x3ffffff)a6=a6+l*5;l=bit32.rshift(a6,26)a6=bit32.band(a6,0x3ffffff)a7=a7+l;W=W+16;V=V-16 end;e.h[1]=a6;e.h[2]=a7;e.h[3]=a8;e.h[4]=a9;e.h[5]=aa;e.bytes=V;e.midx=W;return e end;local function ag(e,U)e.bytes,e.midx=#U,1;if e.bytes>=16 then T(e,U)end;if e.bytes==0 then else local ah=string.sub(U,e.midx)..'\x01'..string.rep('\0',16-e.bytes-1)assert(#ah==16)e.final=true;T(e,ah)end;return e end;local function ai(e)local l,aj;local ak;local a6=e.h[1]local a7=e.h[2]local a8=e.h[3]local a9=e.h[4]local aa=e.h[5]l=bit32.rshift(a7,26)a7=bit32.band(a7,0x3ffffff)a8=a8+l;l=bit32.rshift(a8,26)a8=bit32.band(a8,0x3ffffff)a9=a9+l;l=bit32.rshift(a9,26)a9=bit32.band(a9,0x3ffffff)aa=aa+l;l=bit32.rshift(aa,26)aa=bit32.band(aa,0x3ffffff)a6=a6+l*5;l=bit32.rshift(a6,26)a6=bit32.band(a6,0x3ffffff)a7=a7+l;local al=a6+5;l=bit32.rshift(al,26)al=bit32.band(al,0x3ffffff)local am=a7+l;l=bit32.rshift(am,26)am=bit32.band(am,0x3ffffff)local an=a8+l;l=bit32.rshift(an,26)an=bit32.band(an,0x3ffffff)local ao=a9+l;l=bit32.rshift(ao,26)ao=bit32.band(ao,0x3ffffff)local ap=bit32.band(aa+l-0x4000000,0xffffffff)aj=bit32.band(bit32.rshift(ap,31)-1,0xffffffff)al=bit32.band(al,aj)am=bit32.band(am,aj)an=bit32.band(an,aj)ao=bit32.band(ao,aj)ap=bit32.band(ap,aj)aj=bit32.band(bit32.bnot(aj),0xffffffff)a6=bit32.bor(bit32.band(a6,aj),al)a7=bit32.bor(bit32.band(a7,aj),am)a8=bit32.bor(bit32.band(a8,aj),an)a9=bit32.bor(bit32.band(a9,aj),ao)aa=bit32.bor(bit32.band(aa,aj),ap)a6=bit32.band(bit32.bor(a6,bit32.lshift(a7,26)),0xffffffff)a7=bit32.band(bit32.bor(bit32.rshift(a7,6),bit32.lshift(a8,20)),0xffffffff)a8=bit32.band(bit32.bor(bit32.rshift(a8,12),bit32.lshift(a9,14)),0xffffffff)a9=bit32.band(bit32.bor(bit32.rshift(a9,18),bit32.lshift(aa,8)),0xffffffff)ak=a6+e.pad[1]a6=bit32.band(ak,0xffffffff)ak=a7+e.pad[2]+bit32.rshift(ak,32)a7=bit32.band(ak,0xffffffff)ak=a8+e.pad[3]+bit32.rshift(ak,32)a8=bit32.band(ak,0xffffffff)ak=a9+e.pad[4]+bit32.rshift(ak,32)a9=bit32.band(ak,0xffffffff)local aq=string.pack('<I4I4I4I4',a6,a7,a8,a9)return aq end;local function ar(U,S)assert(#S==32)local e=R(S)ag(e,U)local aq=ai(e)return aq end;local function as(U,S,aq)local at=ar(U,S)return at==aq end;return{init=R,update=ag,finish=ai,auth=ar,verify=as}end;local function au()local av=a()local aw=P()local ax=function(r,t)local s=0;local U=string.rep('\0',64)local ay=av.encrypt(r,s,t,U)return ay:sub(1,32)end;local az=function(aA)return#aA%16==0 and""or('\0'):rep(16-#aA%16)end;local b=table.insert;local aB=function(aC,r,aD,aE,aF)local aG={}local t=aE..aD;local aH=ax(r,t)local aI=av.encrypt(r,1,t,aF)b(aG,aC)b(aG,az(aC))b(aG,aI)b(aG,az(aI))b(aG,string.pack('<I8',#aC))b(aG,string.pack('<I8',#aI))local aJ=table.concat(aG)local aK=aw.auth(aJ,aH)return aI,aK end;local function aL(aC,r,aD,aE,aI,aK)local aG={}local t=aE..aD;local aH=ax(r,t)b(aG,aC)b(aG,az(aC))b(aG,aI)b(aG,az(aI))b(aG,string.pack('<I8',#aC))b(aG,string.pack('<I8',#aI))local aJ=table.concat(aG)local aq=aw.auth(aJ,aH)if aq==aK then local aF=av.encrypt(r,1,t,aI)return aF else return nil,"auth failed"end end;return{poly_keygen=ax,encrypt=aB,decrypt=aL}end;local aM=string.gsub;sha256=loadstring(aM(aM(aM(aM(aM(aM(aM(aM('Sa=XbandSb=XbxWSc=XlshiftSd=unpackSe=2^32SYf(g,h)Si=g/2^hSj=i%1Ui-j+j*eVSYk(l,m)Sn=l/2^mUn-n%1VSo={0x6a09e667Tbb67ae85T3c6ef372Ta54ff53aT510e527fT9b05688cT1f83d9abT5be0cd19}Sp={0x428a2f98T71374491Tb5c0fbcfTe9b5dba5T3956c25bT59f111f1T923f82a4Tab1c5ed5Td807aa98T12835b01T243185beT550c7dc3T72be5d74T80deb1feT9bdc06a7Tc19bf174Te49b69c1Tefbe4786T0fc19dc6T240ca1ccT2de92c6fT4a7484aaT5cb0a9dcT76f988daT983e5152Ta831c66dTb00327c8Tbf597fc7Tc6e00bf3Td5a79147T06ca6351T14292967T27b70a85T2e1b2138T4d2c6dfcT53380d13T650a7354T766a0abbT81c2c92eT92722c85Ta2bfe8a1Ta81a664bTc24b8b70Tc76c51a3Td192e819Td6990624Tf40e3585T106aa070T19a4c116T1e376c08T2748774cT34b0bcb5T391c0cb3T4ed8aa4aT5b9cca4fT682e6ff3T748f82eeT78a5636fT84c87814T8cc70208T90befffaTa4506cebTbef9a3f7Tc67178f2}SYq(r,q)if e-1-r[1]<q then r[2]=r[2]+1;r[1]=q-(e-1-r[1])-1 else r[1]=r[1]+qVUrVSYs(t)Su=#t;t[#t+1]=0x80;while#t%64~=56Zt[#t+1]=0VSv=q({0,0},u*8)fWw=2,1,-1Zt[#t+1]=a(k(a(v[w]TFF000000),24)TFF)t[#t+1]=a(k(a(v[w]TFF0000),16)TFF)t[#t+1]=a(k(a(v[w]TFF00),8)TFF)t[#t+1]=a(v[w]TFF)VUtVSYx(y,w)Uc(y[w]W0,24)+c(y[w+1]W0,16)+c(y[w+2]W0,8)+(y[w+3]W0)VSYz(t,w,A)SB={}fWC=1,16ZB[C]=x(t,w+(C-1)*4)VfWC=17,64ZSD=B[C-15]SE=b(b(f(B[C-15],7),f(B[C-15],18)),k(B[C-15],3))SF=b(b(f(B[C-2],17),f(B[C-2],19)),k(B[C-2],10))B[C]=(B[C-16]+E+B[C-7]+F)%eVSG,h,H,I,J,j,K,L=d(A)fWC=1,64ZSM=b(b(f(J,6),f(J,11)),f(J,25))SN=b(a(J,j),a(Xbnot(J),K))SO=(L+M+N+p[C]+B[C])%eSP=b(b(f(G,2),f(G,13)),f(G,22))SQ=b(b(a(G,h),a(G,H)),a(h,H))SR=(P+Q)%e;L,K,j,J,I,H,h,G=K,j,J,(I+O)%e,H,h,G,(O+R)%eVA[1]=(A[1]+G)%e;A[2]=(A[2]+h)%e;A[3]=(A[3]+H)%e;A[4]=(A[4]+I)%e;A[5]=(A[5]+J)%e;A[6]=(A[6]+j)%e;A[7]=(A[7]+K)%e;A[8]=(A[8]+L)%eUAVUY(t)t=t W""t=type(t)=="string"and{t:byte(1,-1)}Wt;t=s(t)SA={d(o)}fWw=1,#t,64ZA=z(t,w,A)VU("%08x"):rep(8):format(d(A))V',"S"," local "),"T",",0x"),"U"," return "),"V"," end "),"W","or "),"X","bit32."),"Y","function "),"Z"," do "))()local aN=au()local function aO(aA)return{aA:byte(1,#aA)}end;local function aP(n)return string.char(table.unpack(n))end;local aQ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'local function aR(aS)local n,aT,aU=aO(aS),#aS,{}local v=1;while v<=aT do local j=n[v]or 0;local k=n[v+1]or 0;local l=n[v+2]or 0;local aV=j*65536+k*256+l;aU[#aU+1]=aQ:sub(bit32.band(bit32.rshift(aV,18),63)+1,bit32.band(bit32.rshift(aV,18),63)+1)aU[#aU+1]=aQ:sub(bit32.band(bit32.rshift(aV,12),63)+1,bit32.band(bit32.rshift(aV,12),63)+1)aU[#aU+1]=v+1<=aT and aQ:sub(bit32.band(bit32.rshift(aV,6),63)+1,bit32.band(bit32.rshift(aV,6),63)+1)or''aU[#aU+1]=v+2<=aT and aQ:sub(bit32.band(bit32.rshift(aV,0),63)+1,bit32.band(bit32.rshift(aV,0),63)+1)or''v=v+3 end;return table.concat(aU)end;local function aW(aX)local aY={}for v=1,#aQ do aY[aQ:sub(v,v)]=v-1 end;local aU={}local v=1;while v<=#aX do local j=aY[aX:sub(v,v)]v=v+1;local k=aY[aX:sub(v,v)]v=v+1;local l=aY[aX:sub(v,v)]v=v+1;local m=aY[aX:sub(v,v)]v=v+1;if j==nil or k==nil then break end;local aV=bit32.bor(bit32.lshift(j,18),bit32.lshift(k,12),bit32.lshift(l or 0,6),m or 0)aU[#aU+1]=string.char(bit32.band(bit32.rshift(aV,16),255))if l~=nil then aU[#aU+1]=string.char(bit32.band(bit32.rshift(aV,8),255))end;if m~=nil then aU[#aU+1]=string.char(bit32.band(aV,255))end end;return table.concat(aU)end;local function aZ(r,a_)local b0=64;if#r>b0 then r=sha256(r):gsub('..',function(b1)return string.char(tonumber(b1,16))end)end;if#r<b0 then r=r..string.rep("\0",b0-#r)end;local b2=r:gsub('.',function(l)return string.char(bit32.bxor(string.byte(l),0x5c))end)local b3=r:gsub('.',function(l)return string.char(bit32.bxor(string.byte(l),0x36))end)local b4=sha256(b3 ..a_)b4=b4:gsub('..',function(b1)return string.char(tonumber(b1,16))end)local aq=sha256(b2 ..b4)return aq:gsub('..',function(b1)return string.char(tonumber(b1,16))end)end;local function b5(aT)return string.char(bit32.band(bit32.rshift(aT,24),255),bit32.band(bit32.rshift(aT,16),255),bit32.band(bit32.rshift(aT,8),255),bit32.band(aT,255))end;local function b6(b7,b8,b9,ba)local bb=32;local bc=math.ceil(ba/bb)local bd=ba-(bc-1)*bb;local be={}for v=1,bc do local bf=aZ(b7,b8 ..b5(v))local bg={bf:byte(1,bb)}for bh=2,b9 do bf=aZ(b7,bf)local bi={bf:byte(1,bb)}for bj=1,bb do bg[bj]=bit32.bxor(bg[bj],bi[bj])end;if bh%500==0 then sleep(0)end end;if v<bc then be[#be+1]=string.char(table.unpack(bg))else be[#be+1]=string.char(table.unpack(bg,1,bd))end end;return table.concat(be)end;local bk="siss_drg_seed.bin"local bl={K=string.rep("\0",32),V=string.rep("\1",32),inited=false}local function bm(bn)bl.K=aZ(bl.K,bl.V.."\0"..(bn or""))bl.V=aZ(bl.K,bl.V)if bn and#bn>0 then bl.K=aZ(bl.K,bl.V.."\1"..bn)bl.V=aZ(bl.K,bl.V)end end;local function bo(bp)bl.K=string.rep("\0",32)bl.V=string.rep("\1",32)bm(bp)bl.inited=true end;local function bq(aT)if not bl.inited then error("DRBG not seeded. Call seed_entropy() once.")end;local aU={}while#table.concat(aU)<aT do bl.V=aZ(bl.K,bl.V)aU[#aU+1]=bl.V end;bm("")local br=table.concat(aU)return br:sub(1,aT)end;local function bs(bt)local bu={}if fs.exists(bk)then local ak=fs.open(bk,"rb")bu[#bu+1]=ak.readAll()ak.close()local bp=sha256(table.concat(bu)):gsub('..',function(b1)return string.char(tonumber(b1,16))end)bo(bp)else term.write("Move around / mash keys then press Enter 4 times to seed…\n")for v=1,4 do local bv=os.clock()read()local bw=os.clock()bu[#bu+1]=b5(math.floor((bw-bv)*1e9))..tostring({}):sub(8)end;if bt and#bt>0 then bu[#bu+1]=bt end;local bp=sha256(table.concat(bu)):gsub('..',function(b1)return string.char(tonumber(b1,16))end)bo(bp)local ak=fs.open(bk,"wb")ak.write(bq(48))ak.close()end end;local bx="\1"local by="\1"local bz="SiSS RA rev1|chacha20poly1305"local function bA(aT)return string.char(bit32.band(bit32.rshift(aT,24),255),bit32.band(bit32.rshift(aT,16),255),bit32.band(bit32.rshift(aT,8),255),bit32.band(aT,255))end;local function bB(aT)return string.char(bit32.band(bit32.rshift(aT,8),255),bit32.band(aT,255))end;local function bC(bD)return bA(bD)..bB(32)end;local function bE(aA)local bF,bG,bH,bI,ac,ad=aA:byte(1,6)local bJ=bit32.bor(bit32.lshift(bF,24),bit32.lshift(bG,16),bit32.lshift(bH,8),bI)local bK=bit32.bor(bit32.lshift(ac,8),ad)return bJ,bK end;local function bL(aT)return bq(aT)end;local function bM(O)assert(#O==12,"nonce must be 12 bytes")local aD=O:sub(1,6)local aE=O:sub(7,12)return aD,aE end;local function bN(b7,bO)local b8=bL(16)local bJ=1000;local r=b6(b7,b8,bJ,32)local O=bL(12)local aD,aE=bM(O)local bP,aK=aN.encrypt(bz,r,aD,aE,bO)local bQ=bC(bJ)local bR=table.concat{bx,by,bQ,b8,O,bP,aK}return aR(bR)end;local function bS(b7,bR)local aS=aW(bR)if#aS<1+1+6+16+12+16 then return nil,"ciphertext too short"end;local bT=1;local bU=aS:sub(bT,bT)bT=bT+1;if bU~=bx then return nil,"version mismatch"end;local bV=aS:sub(bT,bT)bT=bT+1;if bV~=by then return nil,"kdf mismatch"end;local bQ=aS:sub(bT,bT+5)bT=bT+6;local bJ,bK=bE(bQ)if bK~=32 then return nil,"bad dkLen"end;local b8=aS:sub(bT,bT+15)bT=bT+16;local O=aS:sub(bT,bT+11)bT=bT+12;local aD,aE=bM(O)local bW=16;local aK=aS:sub(#aS-bW+1)local bP=aS:sub(bT,#aS-bW)local r=b6(b7,b8,bJ,32)local z,bX=aN.decrypt(bz,r,aD,aE,bP,aK)if not z then return nil,bX or"auth failed"end;return z end;return{decrypt_with_password=bS,encrypt_with_password=bN,seed_entropy=bs}
end
local hmac = crypto()
---@type string
local password
---@type number
local port
---@type ccTweaked.peripheral.Modem
local modem
local function init(modemI, portI, passwordI)
port = portI
password = passwordI
modem = modemI
hmac.seed_entropy()
modem.open(port)
end
---@param itemName string
---@param count number|nil
local function withdraw(itemName, count)
if not port or not modem or not password then
error("tiny_ra_library: init was never ran")
end
local data = {
itemName = itemName
}
if count then
data["count"] = count
end
modem.transmit(port, port, hmac.encrypt_with_password(password,
textutils.serialiseJSON({
["type"] = "withdraw",
["data"] = data
})))
end
---@param slots number[]
---@param count number|nil
local function depositBySlots(slots, count)
if not port or not modem or not password then
error("tiny_ra_library: init was never ran")
end
local data = {
slots = slots
}
if count then
data["count"] = count
end
modem.transmit(port, port, hmac.encrypt_with_password(password,
textutils.serialiseJSON({
["type"] = "deposit",
["data"] = data
})))
end
---@param itemName string
---@param count number|nil
local function depositByItemName(itemName, count)
if not port or not modem or not password then
error("tiny_ra_library: init was never ran")
end
local data = {
itemName = itemName
}
if count then
data["count"] = count
end
modem.transmit(port, port, hmac.encrypt_with_password(password,
textutils.serialiseJSON({
["type"] = "deposit",
["data"] = data
})))
end
return {
init = init,
withdraw = withdraw,
depositByItemName = depositByItemName,
depositBySlots = depositBySlots
}