20 #ifndef CS_CRYPTO_SYM_TRAITS_H
21 #define CS_CRYPTO_SYM_TRAITS_H
23 #include <util/tools/crypto_traits.h>
24 #include <util/tools/is_detected_traits.h>
26 namespace cs_crypto::cipher::traits {
29 using has_key_size =
decltype(T::key_size);
33 static_assert(cs_crypto::traits::is_detected_v<has_key_size, T>,
"No key_size constexpr data member found");
35 using size_type =
decltype(T::key_size);
36 constexpr static const size_type value = T::key_size;
40 [[maybe_unused]]
inline constexpr const auto key_size_v = key_size<T>::value;
43 using has_iv_size =
decltype(T::iv_size);
47 static_assert(cs_crypto::traits::is_detected_v<has_iv_size, T>,
"No iv_size constexpr data member found");
49 using size_type =
decltype(T::iv_size);
50 constexpr static const size_type value = T::iv_size;
54 [[maybe_unused]]
inline constexpr const auto iv_size_v = iv_size<T>::value;