Add convenience function.

This commit is contained in:
Christoffer Lerno
2024-07-21 00:43:16 +02:00
parent edc55a2afd
commit c84bc8a8f3

View File

@@ -28,6 +28,18 @@ fn void Rc4.init(&self, char[] key)
self.j = 0;
}
/**
* Run a single pass of en/decryption using a particular key.
* @param [in] key
* @param [inout] data
**/
fn void crypt(char[] key, char[] data)
{
Rc4 rc4;
rc4.init(key);
rc4.crypt(data, data);
}
/**
* Encrypt or decrypt a sequence of bytes.
*