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

Method Cypher

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

Source from the content-addressed store, hash-verified

38{
39public:
40 Cypher(unsigned int l, const unsigned char* key) throw()
41 : s1(0), s2(0)
42 {
43 for (unsigned int n = 0; n < sizeof(state); ++n)
44 {
45 state[n] = n;
46 }
47
48 for (unsigned int k1 = 0, k2 = 0; k1 < sizeof(state); ++k1)
49 {
50 k2 = (k2 + key[k1 % l] + state[k1]) & 0xff;
51 swap(state[k1], state[k2]);
52 }
53 }
54
55 void transform(unsigned int length, const void* from, void* to) throw()
56 {

Callers

nothing calls this directly

Calls 1

swapFunction · 0.50

Tested by

no test coverage detected