#ifndef ALCRYPTOLIB_STREAM_CIPHER_CIPHER_BASE_2019_03_08_H #define ALCRYPTOLIB_STREAM_CIPHER_CIPHER_BASE_2019_03_08_H #include #include #include #include // https://en.wikipedia.org/wiki/Category:Cryptographic_algorithms #if(__cplusplus >= 201703L) namespace al::crypto::stream::cipher { #else namespace al { namespace crypto { namespace stream { namespace cipher { #endif template class cipher_base : public al::crypto::stream::stream { private: using input_output_allocator_type = typename std::allocator_traits::template rebind_alloc; public: using input_output_container_type = std::vector; cipher_base(const cipher_base&) = default; cipher_base(cipher_base&&) noexcept = default; auto operator=(const cipher_base&) -> cipher_base& = default; auto operator=(cipher_base&&) noexcept -> cipher_base& = default; ~cipher_base() override = default; virtual void encrypt(const std::uint8_t*, const std::size_t, const std::uint8_t*, const std::size_t*, const std::uint8_t*, input_output_container_type&) = 0; virtual void decrypt(const std::uint8_t*, const std::size_t, const std::uint8_t*, const std::size_t*, const std::uint8_t*, input_output_container_type&) = 0; // TBD: Need to implement a sensible result type/getter for cipher(s). AL_CRYPTO_NODISCARD auto get_result() const -> result_type override { return nullptr; } protected: cipher_base() = default; }; #if(__cplusplus >= 201703L) } // namespace al::crypto::stream::cipher #else } // namespace cipher } // namespace stream } // namespace crypto } // namespace al #endif #endif // ALCRYPTOLIB_STREAM_CIPHER_CIPHER_BASE_2019_03_08_H