/* * 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-2018 Danny Robson */ #pragma once #include #include #include #include #include namespace cruft::crypto::block { /// An implementation of the "Tiny Encryption Algorithm" block cipher. /// /// ref: http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm class TEA { public: using key_t = std::array; using word_t = u32; explicit TEA (key_t); void encrypt (cruft::view data); void decrypt (cruft::view data); private: key_t const m_key; }; }