| 123 | |
| 124 | |
| 125 | void bench_aes(bool show) |
| 126 | { |
| 127 | AES_CBC_Encryption enc; |
| 128 | enc.SetKey(key, 16, iv); |
| 129 | |
| 130 | double start = current_time(); |
| 131 | |
| 132 | for(int i = 0; i < megs; i++) |
| 133 | enc.Process(plain, cipher, sizeof(plain)); |
| 134 | |
| 135 | double total = current_time() - start; |
| 136 | |
| 137 | double persec = 1 / total * megs; |
| 138 | |
| 139 | if (show) |
| 140 | printf("AES %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total, |
| 141 | persec); |
| 142 | } |
| 143 | |
| 144 | |
| 145 | void bench_twofish() |
no test coverage detected