v / vlib / crypto / cipher / cfb_test.v
18 lines · 14 sloc · 304 bytes · a4b8768146ed5a5d712747f51f84fafabec149a6
Raw
1import crypto.cipher
2import crypto.des
3
4struct StreamCipher {
5 cipher cipher.Stream
6}
7
8fn test_cfb_stream_cipher() ! {
9 key := '123456789012345678901234'.bytes()
10 iv := 'abcdegfh'.bytes()
11
12 block := des.new_cipher(key[..8])
13 c := cipher.new_cfb_encrypter(block, iv)
14
15 s := StreamCipher{
16 cipher: c
17 }
18}
19