| 1 | import crypto.cipher |
| 2 | import crypto.des |
| 3 | |
| 4 | struct StreamCipher { |
| 5 | cipher cipher.Stream |
| 6 | } |
| 7 | |
| 8 | fn 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 |