/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2015 Danny Robson */ #ifndef CRUFT_CRYPTO_BLOCKXXTEA_HPP #define CRUFT_CRYPTO_BLOCKXXTEA_HPP #include #include #include namespace cruft::crypto::block { // http://en.wikipedia.org/wiki/XXTEA // 'corrected' block TEA class XXTEA { public: using key_t = std::array; explicit XXTEA (key_t); void encrypt (uint32_t *restrict data, size_t count); void decrypt (uint32_t *restrict data, size_t count); private: key_t m_key; }; } #endif