mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Added arcfour crypto.
This commit is contained in:
16
test/unit/stdlib/crypto/rc4.c3
Normal file
16
test/unit/stdlib/crypto/rc4.c3
Normal file
@@ -0,0 +1,16 @@
|
||||
import std::crypto;
|
||||
import std::io;
|
||||
|
||||
fn void! rc_crypt() @test
|
||||
{
|
||||
Rc4 rc;
|
||||
rc.init(&&x"63727970746969");
|
||||
char[200] x;
|
||||
char[] text = "The quick brown fox jumps over the lazy dog.";
|
||||
rc.crypt(text, &x);
|
||||
char[*] res = x"2ac2fecdd8fbb84638e3a4
|
||||
820eb205cc8e29c28b9d5d
|
||||
6b2ef974f311964971c90e
|
||||
8b9ca16467ef2dc6fc3520";
|
||||
assert(res[:text.len] == x[:text.len]);
|
||||
}
|
||||
Reference in New Issue
Block a user