| 13 | #include "Exception.hpp" |
| 14 | |
| 15 | void generateSecretKey(std::array<uint8_t, 16>& key) { |
| 16 | int ret = getentropy(key.data(), 16); |
| 17 | if (ret != 0) { |
| 18 | throw SYSCALL_EXCEPTION("getentropy"); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | // adapted from the Intel Cryptography Primitives Library |
| 23 | static inline __m128i aes128_assist(__m128i temp1, __m128i temp2) { |