(mode, key, iv, plaintext)
| 8 | |
| 9 | |
| 10 | def encrypt(mode, key, iv, plaintext): |
| 11 | cipher = base.Cipher( |
| 12 | algorithms.CAST5(binascii.unhexlify(key)), |
| 13 | mode(binascii.unhexlify(iv)), |
| 14 | ) |
| 15 | encryptor = cipher.encryptor() |
| 16 | ct = encryptor.update(binascii.unhexlify(plaintext)) |
| 17 | ct += encryptor.finalize() |
| 18 | return binascii.hexlify(ct) |
| 19 | |
| 20 | |
| 21 | def build_vectors(mode, filename): |
no test coverage detected
searching dependent graphs…