diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-11-08 10:37:23 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-11-08 10:37:23 +0200 |
commit | 0551ad0ea4227a96c886fe073514f79eba6c4d35 (patch) | |
tree | ae85b934e66d9d8ebb772db8027d85ba6c07a7e5 /blowfish.hpp | |
parent | Initial commit (diff) | |
download | blowfish-0551ad0ea4227a96c886fe073514f79eba6c4d35.tar.xz |
Replace P and S C-arrays with std::array
Diffstat (limited to 'blowfish.hpp')
-rw-r--r-- | blowfish.hpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/blowfish.hpp b/blowfish.hpp index e0468cd..9a6e0fe 100644 --- a/blowfish.hpp +++ b/blowfish.hpp @@ -23,9 +23,7 @@ public: constexpr Blowfish(const uint8_t key[], size_t keylen) { for (size_t i = 0; i < BOXES; ++i) { - for (size_t j = 0; j < ENTRIES; ++j) { - S[i][j] = S_INIT[i][j]; - } + std::copy(S_INIT[i].begin(), S_INIT[i].end(), S[i].begin()); } // @@ -98,6 +96,6 @@ private: return y; } - uint32_t P[SUBKEYS]; - uint32_t S[BOXES][ENTRIES]; + std::array<uint32_t, SUBKEYS> P; + std::array<std::array<uint32_t, ENTRIES>, BOXES> S; }; |