MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / transform

Method transform

src/plugins/crypt/arc4/Arc4.cpp:55–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 }
54
55 void transform(unsigned int length, const void* from, void* to) throw()
56 {
57 unsigned char* t = static_cast<unsigned char*>(to);
58 const unsigned char* f = static_cast<const unsigned char*>(from);
59
60 while (length--)
61 {
62 s2 += state[++s1];
63 swap(state[s1], state[s2]);
64 unsigned char k = state[s1] + state[s2];
65 k = state[k];
66 *t++ = k ^ *f++;
67 }
68 }
69
70private:
71 unsigned char state[256];

Callers 2

encryptMethod · 0.45
decryptMethod · 0.45

Calls 1

swapFunction · 0.50

Tested by

no test coverage detected