From 0551ad0ea4227a96c886fe073514f79eba6c4d35 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 8 Nov 2020 10:37:23 +0200 Subject: Replace P and S C-arrays with std::array --- blowfish.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'blowfish.hpp') 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 P; + std::array, BOXES> S; }; -- cgit v1.2.1