Skip to content

Commit

Permalink
namespace rename [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
vo-nil committed Dec 11, 2024
1 parent 367014e commit 7d6d5df
Show file tree
Hide file tree
Showing 120 changed files with 1,788 additions and 1,795 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace nil {
public:
template <typename TEndian = default_endianness>
using type = nil::crypto3::marshalling::types::field_element<
nil::marshalling::field_type<TEndian>,
field_type<TEndian>,
T>;
static const bool value = true;
static const bool fixed_size = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace nil {

template<typename Coordinates>
struct curve_element_writer<
nil::marshalling::endian::big_endian,
endian::big_endian,
typename algebra::curves::alt_bn128_254::template g1_type<
Coordinates,
algebra::curves::forms::short_weierstrass>> {
Expand All @@ -64,11 +64,11 @@ namespace nil {
using g1_field_type = typename group_value_type::field_type;
using coordinates = typename group_value_type::coordinates;
using form = typename group_value_type::form;
using endianness = nil::marshalling::endian::big_endian;
using endianness = endian::big_endian;
using params_type = curve_element_marshalling_params<group_type>;

template<typename TIter>
static nil::marshalling::status_type process(const group_value_type &point, TIter &iter) {
static status_type process(const group_value_type &point, TIter &iter) {

/* Point is always encoded in compressed form, only X coordinate.
* Highest bit is Infinity flag
Expand All @@ -92,13 +92,13 @@ namespace nil {
*iter |= S_bit;
}

return nil::marshalling::status_type::success;
return status_type::success;
}
};

template<typename Coordinates>
struct curve_element_writer<
nil::marshalling::endian::big_endian,
endian::big_endian,
typename algebra::curves::alt_bn128_254::template g2_type<
Coordinates,
algebra::curves::forms::short_weierstrass>> {
Expand All @@ -109,11 +109,11 @@ namespace nil {
using g2_field_type = typename group_value_type::field_type;
using coordinates = typename group_value_type::coordinates;
using form = typename group_value_type::form;
using endianness = nil::marshalling::endian::big_endian;
using endianness = endian::big_endian;
using params_type = curve_element_marshalling_params<group_type>;

template<typename TIter>
static nil::marshalling::status_type process(const group_value_type &point, TIter &iter) {
static status_type process(const group_value_type &point, TIter &iter) {

/* Point is always encoded in compressed form, only X coordinate.
* Highest bit is Infinity flag
Expand Down Expand Up @@ -153,14 +153,14 @@ namespace nil {
*iter |= S_bit;
}

return nil::marshalling::status_type::success;
return status_type::success;
}
};


template<typename Coordinates>
struct curve_element_reader<
nil::marshalling::endian::big_endian,
endian::big_endian,
typename algebra::curves::alt_bn128_254::template g1_type<
Coordinates,
algebra::curves::forms::short_weierstrass>> {
Expand All @@ -169,11 +169,11 @@ namespace nil {
using group_value_type = typename group_type::value_type;
using coordinates = typename group_value_type::coordinates;
using form = typename group_value_type::form;
using endianness = nil::marshalling::endian::big_endian;
using endianness = endian::big_endian;
using params_type = curve_element_marshalling_params<group_type>;

template<typename TIter>
static nil::marshalling::status_type process(group_value_type &point, TIter &iter) {
static status_type process(group_value_type &point, TIter &iter) {
using chunk_type = typename TIter::value_type;

constexpr static const std::size_t sizeof_field_element =
Expand All @@ -191,7 +191,7 @@ namespace nil {
if (I_bit) {
// point at infinity
point = g1_value_type();
return nil::marshalling::status_type::success;
return status_type::success;
}

g1_field_value_type x_mod(x);
Expand All @@ -209,13 +209,13 @@ namespace nil {
point = result;
}

return nil::marshalling::status_type::success;
return status_type::success;
}
};

template<typename Coordinates>
struct curve_element_reader<
nil::marshalling::endian::big_endian,
endian::big_endian,
typename algebra::curves::alt_bn128_254::template g2_type<
Coordinates,
algebra::curves::forms::short_weierstrass>> {
Expand All @@ -224,11 +224,11 @@ namespace nil {
using group_value_type = typename group_type::value_type;
using coordinates = typename group_value_type::coordinates;
using form = typename group_value_type::form;
using endianness = nil::marshalling::endian::big_endian;
using endianness = endian::big_endian;
using params_type = curve_element_marshalling_params<group_type>;

template<typename TIter>
static nil::marshalling::status_type process(group_value_type &point, TIter &iter) {
static status_type process(group_value_type &point, TIter &iter) {
using chunk_type = typename TIter::value_type;

constexpr static const std::size_t sizeof_field_element =
Expand All @@ -253,7 +253,7 @@ namespace nil {
if (I_bit) {
// point at infinity
point = group_value_type();
return nil::marshalling::status_type::success;
return status_type::success;
}

g2_field_value_type x_mod(x_0, x_1);
Expand All @@ -271,7 +271,7 @@ namespace nil {
point = result;
}

return nil::marshalling::status_type::success;
return status_type::success;
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace nil {

template<typename Coordinates>
struct curve_element_writer<
nil::marshalling::endian::little_endian,
endian::little_endian,
typename algebra::curves::babyjubjub::template g1_type<Coordinates,
algebra::curves::forms::twisted_edwards>> {
using group_type =
Expand All @@ -71,14 +71,14 @@ namespace nil {
using group_value_type = typename group_type::value_type;
using coordinates = typename group_value_type::coordinates;
using form = typename group_value_type::form;
using endianness = nil::marshalling::endian::little_endian;
using endianness = endian::little_endian;
using params_type = curve_element_marshalling_params<group_type>;
using encoded_integral_type = typename algebra::fields::field<256>::integral_type;

template<typename TIter>
static typename std::enable_if<
std::is_same<std::uint8_t, typename std::iterator_traits<TIter>::value_type>::value,
nil::marshalling::status_type>::type
status_type>::type
process(const group_value_type &point, TIter &iter) {
using base_field_type = typename group_type::field_type;
using base_integral_type = typename base_field_type::integral_type;
Expand Down Expand Up @@ -106,14 +106,14 @@ namespace nil {

std::copy(std::cbegin(encoded_value), std::cend(encoded_value), iter);

return nil::marshalling::status_type::success;
return status_type::success;
}
};


template<typename Coordinates>
struct curve_element_reader<
nil::marshalling::endian::little_endian,
endian::little_endian,
typename algebra::curves::babyjubjub::template g1_type<Coordinates,
algebra::curves::forms::twisted_edwards>> {
using group_type =
Expand All @@ -122,7 +122,7 @@ namespace nil {
using group_value_type = typename group_type::value_type;
using coordinates = typename group_value_type::coordinates;
using form = typename group_value_type::form;
using endianness = nil::marshalling::endian::little_endian;
using endianness = endian::little_endian;
using params_type = curve_element_marshalling_params<group_type>;

using group_affine_value_type =
Expand All @@ -132,7 +132,7 @@ namespace nil {
template<typename TIter>
static typename std::enable_if<
std::is_same<std::uint8_t, typename std::iterator_traits<TIter>::value_type>::value,
nil::marshalling::status_type>::type
status_type>::type
process(group_value_type &point, TIter &iter)
{
using base_field_type = typename group_type::field_type;
Expand All @@ -157,7 +157,7 @@ namespace nil {
}

point = decoded_point_affine.value();
return nil::marshalling::status_type::success;
return status_type::success;
}
};

Expand Down
Loading

0 comments on commit 7d6d5df

Please sign in to comment.