crypto3
crypto3 copied to clipboard
Multiple crypto3/detail directories with out-of-date file versions
latest pubkey branch provides older versions of common headers -- i.e. here:
https://github.com/NilFoundation/crypto3-pubkey/tree/2ffb35f0d4cd2f31102dba1d7513fa9a90b3a5a1/include/nil/crypto3/detail
when compared to latest algebra branch (it appears that the newest version of each file is located in the repo where the file was last edited, with many out-of-date duplicates in the other repos) -- i.e. here:
https://github.com/NilFoundation/crypto3-algebra/tree/f8fcef6aab3495de5cc7a0075f6335c4268542d9/include/nil/crypto3/detail
File version conflicts exist among these crypto3/detail directories:
./libs/kdf/include/nil/crypto3/detail
./libs/modes/include/nil/crypto3/detail
./libs/hash/include/nil/crypto3/detail
./libs/pubkey/include/nil/crypto3/detail
./libs/stream/include/nil/crypto3/detail
./libs/pbkdf/include/nil/crypto3/detail
./libs/math/include/nil/crypto3/detail
./libs/mac/include/nil/crypto3/detail
./libs/passhash/include/nil/crypto3/detail
./libs/pkpad/include/nil/crypto3/detail
./libs/algebra/include/nil/crypto3/detail
./libs/pkmodes/include/nil/crypto3/detail
./libs/vdf/include/nil/crypto3/detail
Example diff output (note the copyright was updated to 2021 in algebra which implies it is the preferred version, removing the BOOST_TTI_ lines and the templates, which appear to have been relocated):
diff -r crypto3/libs/algebra/include/nil/crypto3/detail/type_traits.hpp crypto3/libs/pubkey/include/nil/crypto3/detail/type_traits.hpp
2,3c2,3
< // Copyright (c) 2018-2021 Mikhail Komarov <[email protected]>
< // Copyright (c) 2020-2021 Nikita Kaskov <[email protected]>
---
> // Copyright (c) 2018-2020 Mikhail Komarov <[email protected]>
> // Copyright (c) 2020 Nikita Kaskov <[email protected]>
29a30
> #include <type_traits>
76a78,103
> BOOST_TTI_HAS_TYPE(extension_policy)
> BOOST_TTI_HAS_TYPE(curve_type)
> BOOST_TTI_HAS_TYPE(underlying_field_type)
> BOOST_TTI_HAS_TYPE(value_type)
> BOOST_TTI_HAS_TYPE(modulus_type)
> BOOST_TTI_HAS_TYPE(base_field_type)
> BOOST_TTI_HAS_TYPE(number_type)
> BOOST_TTI_HAS_TYPE(scalar_field_type)
> BOOST_TTI_HAS_TYPE(g1_type)
> BOOST_TTI_HAS_TYPE(g2_type)
> BOOST_TTI_HAS_TYPE(gt_type)
>
> BOOST_TTI_HAS_STATIC_MEMBER_DATA(value_bits)
> BOOST_TTI_HAS_STATIC_MEMBER_DATA(modulus_bits)
> BOOST_TTI_HAS_STATIC_MEMBER_DATA(base_field_bits)
> BOOST_TTI_HAS_STATIC_MEMBER_DATA(base_field_modulus)
> BOOST_TTI_HAS_STATIC_MEMBER_DATA(scalar_field_bits)
> BOOST_TTI_HAS_STATIC_MEMBER_DATA(scalar_field_modulus)
> BOOST_TTI_HAS_STATIC_MEMBER_DATA(arity)
> BOOST_TTI_HAS_STATIC_MEMBER_DATA(p)
> BOOST_TTI_HAS_STATIC_MEMBER_DATA(q)
>
> BOOST_TTI_HAS_FUNCTION(to_affine)
> BOOST_TTI_HAS_FUNCTION(to_special)
> BOOST_TTI_HAS_FUNCTION(is_special)
>
187a215,277
>
> template<typename T>
> struct is_curve {
> static const bool value = has_static_member_data_base_field_bits<T, const std::size_t>::value &&
> has_type_base_field_type<T>::value && has_type_number_type<T>::value &&
>
> has_static_member_data_scalar_field_bits<T, const std::size_t>::value &&
> has_type_scalar_field_type<T>::value && has_type_g1_type<T>::value &&
> has_type_g2_type<T>::value && has_type_gt_type<T>::value &&
> has_type_number_type<T>::value &&
> has_static_member_data_p<T, const typename T::number_type>::value &&
> has_static_member_data_q<T, const typename T::number_type>::value;
> typedef T type;
> };
>
> // TODO: we should add some other params to curve group policy to identify it more clearly
> template<typename T>
> struct is_curve_group {
> static const bool value = has_type_value_type<T>::value && has_type_underlying_field_type<T>::value &&
> has_static_member_data_value_bits<T, const std::size_t>::value &&
> has_type_curve_type<T>::value;
> typedef T type;
> };
>
> template<typename T>
> struct is_field {
> static const bool value =
> has_type_value_type<T>::value && has_static_member_data_value_bits<T, const std::size_t>::value &&
> has_type_modulus_type<T>::value &&
> has_static_member_data_modulus_bits<T, const std::size_t>::value &&
> has_type_number_type<T>::value && has_static_member_data_arity<T, const std::size_t>::value;
> typedef T type;
> };
>
> template<typename T>
> struct is_extended_field {
> static const bool value = has_type_value_type<T>::value &&
> has_static_member_data_value_bits<T, const std::size_t>::value &&
> has_type_modulus_type<T>::value &&
> has_static_member_data_modulus_bits<T, const std::size_t>::value &&
> has_type_number_type<T>::value &&
> has_static_member_data_modulus_bits<T, const std::size_t>::value &&
> has_type_extension_policy<T>::value;
> typedef T type;
> };
>
> template<typename T>
> struct is_complex : std::false_type { };
> template<typename T>
> struct is_complex<std::complex<T>> : std::true_type { };
> template<typename T>
> constexpr bool is_complex_v = is_complex<T>::value;
>
> template<typename T>
> struct remove_complex {
> using type = T;
> };
> template<typename T>
> struct remove_complex<std::complex<T>> {
> using type = T;
> };
> template<typename T>
> using remove_complex_t = typename remove_complex<T>::type;