MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / EncryptBlock20

Method EncryptBlock20

Libraries/unrar/crypt2.cpp:62–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60
61
62void CryptData::EncryptBlock20(byte *Buf)
63{
64 uint A,B,C,D,T,TA,TB;
65 A=RawGet4(Buf+0)^Key20[0];
66 B=RawGet4(Buf+4)^Key20[1];
67 C=RawGet4(Buf+8)^Key20[2];
68 D=RawGet4(Buf+12)^Key20[3];
69 for(int I=0;I<NROUNDS;I++)
70 {
71 T=((C+rotls(D,11,32))^Key20[I&3]);
72 TA=A^substLong(T);
73 T=((D^rotls(C,17,32))+Key20[I&3]);
74 TB=B^substLong(T);
75 A=C;
76 B=D;
77 C=TA;
78 D=TB;
79 }
80 RawPut4(C^Key20[0],Buf+0);
81 RawPut4(D^Key20[1],Buf+4);
82 RawPut4(A^Key20[2],Buf+8);
83 RawPut4(B^Key20[3],Buf+12);
84 UpdKeys20(Buf);
85}
86
87
88void CryptData::DecryptBlock20(byte *Buf)

Callers

nothing calls this directly

Calls 2

RawGet4Function · 0.85
RawPut4Function · 0.85

Tested by

no test coverage detected