|
30 | 30 | * @author Thomas Pornin <thomas.pornin@cryptolog.com> |
31 | 31 | */ |
32 | 32 |
|
33 | | -#include <stddef.h> |
34 | | -#include <string.h> |
| 33 | +#include <crypto/x11/dispatch.h> |
| 34 | + |
| 35 | +#include <cstddef> |
| 36 | +#include <cstring> |
35 | 37 |
|
36 | 38 | #include "sph_echo.h" |
37 | 39 |
|
| 40 | +extern sapphire::dispatch::AESRoundFn aes_round; |
| 41 | +extern sapphire::dispatch::AESRoundFnNk aes_round_nk; |
| 42 | + |
38 | 43 | /* |
39 | 44 | * We can use a 64-bit implementation only if a 64-bit type is available. |
40 | 45 | */ |
|
45 | 50 | #define T32 SPH_T32 |
46 | 51 | #define C64 SPH_C64 |
47 | 52 |
|
48 | | -#include "aes_helper.hpp" |
49 | | - |
50 | 53 | #define DECL_STATE_BIG \ |
51 | 54 | sph_u64 W[16][2]; |
52 | 55 |
|
@@ -79,8 +82,8 @@ aes_2rounds_all(sph_u64 W[16][2], |
79 | 82 | sph_u32 X2 = (sph_u32)Wh; |
80 | 83 | sph_u32 X3 = (sph_u32)(Wh >> 32); |
81 | 84 | sph_u32 Y0, Y1, Y2, Y3; \ |
82 | | - AES_ROUND_LE(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3); |
83 | | - AES_ROUND_NOKEY_LE(Y0, Y1, Y2, Y3, X0, X1, X2, X3); |
| 85 | + aes_round(X0, X1, X2, X3, K0, K1, K2, K3, Y0, Y1, Y2, Y3); |
| 86 | + aes_round_nk(Y0, Y1, Y2, Y3, X0, X1, X2, X3); |
84 | 87 | W[n][0] = (sph_u64)X0 | ((sph_u64)X1 << 32); |
85 | 88 | W[n][1] = (sph_u64)X2 | ((sph_u64)X3 << 32); |
86 | 89 | if ((K0 = T32(K0 + 1)) == 0) { |
|
0 commit comments