| 104 | |
| 105 | |
| 106 | void bench_des() |
| 107 | { |
| 108 | DES_EDE3_CBC_Encryption enc; |
| 109 | enc.SetKey(key, 16, iv); |
| 110 | |
| 111 | double start = current_time(); |
| 112 | |
| 113 | for(int i = 0; i < megs; i++) |
| 114 | enc.Process(plain, cipher, sizeof(plain)); |
| 115 | |
| 116 | double total = current_time() - start; |
| 117 | |
| 118 | double persec = 1 / total * megs; |
| 119 | |
| 120 | printf("3DES %d megs took %5.3f seconds, %6.2f MB/s\n", megs, total, |
| 121 | persec); |
| 122 | } |
| 123 | |
| 124 | |
| 125 | void bench_aes(bool show) |
no test coverage detected