MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / RC4

Method RC4

LuaSTGPlus/Utility.h:80–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 }
79 public:
80 RC4(const uint8_t* password, size_t len)
81 {
82 len = min(len, 256U);
83
84 // ��ʼ��S��
85 for (int i = 0; i < 256; ++i)
86 S[i] = i;
87
88 // S�г�ʼ�û�
89 for (size_t i = 0, j = 0; i < 256; i++)
90 {
91 j = (j + S[i] + password[i % len]) % 256;
92 std::swap(S[i], S[j]);
93 }
94 }
95 };
96}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected