(aes, iv, slot=0)
| 55 | |
| 56 | |
| 57 | def aes_set_iv(aes, iv, slot=0): |
| 58 | assert len(iv) == 16 |
| 59 | aes.R_CMD_FIFO = AESSetIVCommand(SLOT=slot) |
| 60 | |
| 61 | for i in range(0, len(iv), 4): |
| 62 | aes.R_CMD_FIFO = struct.unpack(">I", iv[i : i + 4])[0] |
| 63 | |
| 64 | |
| 65 | def aes_crypt(aes, dart, data, key_slot=0, iv_slot=0): |