Skip to content

Commit

Permalink
fix crypto3 tests affected by clang-19
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMlashkin committed Sep 25, 2024
1 parent 0b4575e commit bbf59e7
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ namespace nil {
detail::blueprint_variable<field_type> pad_i;
pad_i.allocate(bp);
bp.val(pad_i) = field_value_type::zero();
padded_input.template emplace_back(pad_i);
padded_input.template emplace_back<>(pad_i);
}
return padded_input;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace nil {
std::vector<digest_variable<FieldType>> layer;

for (std::size_t j = 0; j < Arity; ++j) {
layer.template emplace_back(
layer.template emplace_back<>(
digest_variable<FieldType>(this->bp, HashComponent::digest_bits));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,12 @@ namespace nil {
//
template<class... Args>
reference emplace_back(Args &&..._args) {
return _hashes.template emplace_back(_args...);
return _hashes.template emplace_back<>(_args...);
}

template<class... Args>
iterator emplace(const_iterator _position, Args &&... _args) {
return _hashes.template emplace(_position, _args...);
return _hashes.template emplace<>(_position, _args...);
}

void pop_back() {
Expand All @@ -421,7 +421,7 @@ namespace nil {
void swap(merkle_tree_impl &other) {
_hashes.swap(other.hashes());
std::swap(_leaves, other.leaves());
std::swap(_rc, other.rc());
std::swap(_rc, other.row_count());
std::swap(_size, other.size());
}

Expand Down
2 changes: 1 addition & 1 deletion crypto3/libs/hash/include/nil/crypto3/hash/pedersen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ namespace nil {

public:
inline void update(bool b) {
cached_bits.template emplace_back(b);
cached_bits.template emplace_back<>(b);
++bits_supplied;
if (cached_bits.size() == chunk_bits) { ///< we could proceed if whole chunk was supplied
if (is_time_to_go_to_new_segment()) {
Expand Down
2 changes: 1 addition & 1 deletion crypto3/libs/hash/test/hash_to_curve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void check_expand_message(std::size_t len_in_bytes, const DstType &dst, const Ms
return ret;
};
std::vector<std::uint8_t> uniform_bytes(len_in_bytes, 0);
Expander::template process(len_in_bytes, msg, dst, uniform_bytes);
Expander::template process<>(len_in_bytes, msg, dst, uniform_bytes);
BOOST_CHECK(result_compare(uniform_bytes));
}

Expand Down
8 changes: 4 additions & 4 deletions crypto3/libs/marshalling/zk/test/plonk_gates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ generate_random_plonk_gate(std::size_t vars_n, std::size_t depth, std::size_t co
std::size_t selector_index = rand() % vars_n;
std::vector<constraint_type> constraints;
for (std::size_t i = 0; i < constr_n; i++) {
constraints.template emplace_back(
constraints.template emplace_back<>(
generate_random_plonk_expression<Field, variable_type>( vars_n, depth )
);
}
Expand Down Expand Up @@ -162,7 +162,7 @@ generate_random_plonk_lookup_gate(std::size_t vars_n, std::size_t depth, std::si
std::size_t selector_index = std::random_device()();
std::vector<constraint_type> constraints;
for (std::size_t i = 0; i < constr_n; i++) {
constraints.template emplace_back(generate_random_plonk_lookup_constraint<Field>(vars_n, depth, expr_n));
constraints.template emplace_back<>(generate_random_plonk_lookup_constraint<Field>(vars_n, depth, expr_n));
}
return {selector_index, constraints};
}
Expand Down Expand Up @@ -506,7 +506,7 @@ void test_plonk_gates(std::size_t vars_n, std::size_t depth, std::size_t constr_

std::vector<value_type> val;
for (std::size_t i = 0; i < gates_n; i++) {
val.template emplace_back(generate_random_plonk_gate<Field>(vars_n, depth, constr_n));
val.template emplace_back<>(generate_random_plonk_gate<Field>(vars_n, depth, constr_n));
}

auto filled_val = types::fill_plonk_gates<Endianness, value_type>(val);
Expand Down Expand Up @@ -539,7 +539,7 @@ void test_plonk_lookup_gates(std::size_t vars_n, std::size_t depth, std::size_t

std::vector<value_type> val;
for (std::size_t i = 0; i < gates_n; i++) {
val.template emplace_back(generate_random_plonk_lookup_gate<Field>(vars_n, depth, expr_n, constr_n));
val.template emplace_back<>(generate_random_plonk_lookup_gate<Field>(vars_n, depth, expr_n, constr_n));
}

auto filled_val = types::fill_plonk_lookup_gates<Endianness, value_type>(val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ namespace nil {

template<class... Args>
reference emplace_back(Args&&... _args) {
return val.template emplace_back(_args...);
return val.template emplace_back<>(_args...);
}

void pop_back() {
Expand All @@ -330,7 +330,7 @@ namespace nil {

template<class... Args>
iterator emplace(const_iterator _position, Args&&... _args) {
return val.template emplace(_position, _args...);
return val.template emplace<>(_position, _args...);
}

iterator insert(const_iterator _position, size_type _n, const_reference _x) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ namespace nil {

template<class... Args>
reference emplace_back(Args&&... _args) {
return val.template emplace_back(_args...);
return val.template emplace_back<>(_args...);
}

void pop_back() {
Expand All @@ -304,7 +304,7 @@ namespace nil {
}
template<class... Args>
iterator emplace(const_iterator _position, Args&&... _args) {
return val.template emplace(_position, _args...);
return val.template emplace<>(_position, _args...);
}

iterator insert(const_iterator _position, size_type _n, const_reference _x) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace nil {
// }

bool operator==(const polynomial_dfs_view& rhs) const {
return (*it) == (*(rhs.it)) && _d == rhs.d;
return (*it) == (*(rhs.it)) && _d == rhs._d;
}
bool operator!=(const polynomial_dfs_view& rhs) const {
return !(rhs == *this);
Expand Down Expand Up @@ -239,7 +239,7 @@ namespace nil {

template<class... Args>
reference emplace_back(Args&&... _args) {
return it.template emplace_back(_args...);
return it.template emplace_back<>(_args...);
}

void pop_back() {
Expand All @@ -255,7 +255,7 @@ namespace nil {
}
template<class... Args>
iterator emplace(const_iterator _position, Args&&... _args) {
return it.template emplace(_position, _args...);
return it.template emplace<>(_position, _args...);
}

iterator insert(const_iterator _position, size_type _n, const_reference _x) {
Expand Down Expand Up @@ -309,7 +309,7 @@ namespace nil {
// }

void swap(polynomial_dfs_view& other) {
it.swap(other.val);
it.swap(other.data());
std::swap(_d, other._d);
}

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

template<class... Args>
reference emplace_back(Args&&... _args) {
return it.template emplace_back(_args...);
return it.template emplace_back<>(_args...);
}

void pop_back() {
Expand All @@ -248,7 +248,7 @@ namespace nil {
}
template<class... Args>
iterator emplace(const_iterator _position, Args&&... _args) {
return it.template emplace(_position, _args...);
return it.template emplace<>(_position, _args...);
}

iterator insert(const_iterator _position, size_type _n, const_reference _x) {
Expand Down Expand Up @@ -285,7 +285,7 @@ namespace nil {
}

void swap(polynomial_view& other) {
it.swap(other.val);
it.swap(other.data());
}

template<typename Range>
Expand Down Expand Up @@ -406,7 +406,7 @@ namespace nil {
}
nil::crypto3::math::condense(q);

this->template assign(q.begin(), q.end());
this->template assign<>(q.begin(), q.end());
return *this;
}

Expand Down
8 changes: 4 additions & 4 deletions crypto3/libs/random/include/nil/crypto3/random/rfc6979.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ namespace nil {
for (const auto v : range) {
bitset_repr_type v_bitset_repr(v);
carried_bits = carry_bits(v_bitset_repr, carried_bits);
result.template emplace_back(static_cast<ValueType>(v_bitset_repr.to_ullong()));
result.template emplace_back<>(static_cast<ValueType>(v_bitset_repr.to_ullong()));
}
bitset_repr_type v_bitset_repr;
carry_bits(v_bitset_repr, carried_bits);
result.template emplace_back(static_cast<ValueType>(v_bitset_repr.to_ullong()));
result.template emplace_back<>(static_cast<ValueType>(v_bitset_repr.to_ullong()));

return result;
}
Expand All @@ -151,7 +151,7 @@ namespace nil {
auto adjusted_range = adjust_bitstring(range);
marshalling_integral_value_be_type marshalling_integral_value_be;
auto it = adjusted_range.cbegin();
marshalling_integral_value_be.template read(it, modulus_octets);
marshalling_integral_value_be.template read<>(it, modulus_octets);
result = marshalling_integral_value_be.value();
} else {
// TODO: creating copy of input range of modulus_octets size is a bottleneck:
Expand All @@ -163,7 +163,7 @@ namespace nil {
std::copy(std::crbegin(range), std::crend(range), std::rbegin(range_padded));
marshalling_integral_value_be_type marshalling_integral_value_be;
auto it = std::cbegin(range_padded);
marshalling_integral_value_be.template read(it, range_padded.size());
marshalling_integral_value_be.template read<>(it, range_padded.size());
result = marshalling_integral_value_be.value();
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,15 @@ namespace nil {
pc.merge_random(a_input1.begin(), a_input1.end(), b_input1.begin(), b_input1.end(), final_res.zab);

// final_aB.0 = T = e(A,v1)e(w1,B)
a_input1.template emplace_back(proof.tmipp.gipa.final_wkey.first);
b_input1.template emplace(b_input1.begin(), proof.tmipp.gipa.final_vkey.first);
a_input1.template emplace_back<>(proof.tmipp.gipa.final_wkey.first);
b_input1.template emplace<>(b_input1.begin(), proof.tmipp.gipa.final_vkey.first);
pc.merge_random(a_input1.begin(), a_input1.end(), b_input1.begin(), b_input1.end(), final_res.tab);

// final_aB.1 = U = e(A,v2)e(w2,B)
a_input1.pop_back();
a_input1.template emplace_back(proof.tmipp.gipa.final_wkey.second);
a_input1.template emplace_back<>(proof.tmipp.gipa.final_wkey.second);
b_input1.erase(b_input1.begin());
b_input1.template emplace(b_input1.begin(), proof.tmipp.gipa.final_vkey.second);
b_input1.template emplace<>(b_input1.begin(), proof.tmipp.gipa.final_vkey.second);
pc.merge_random(a_input1.begin(), a_input1.end(), b_input1.begin(), b_input1.end(), final_res.uab);

// MIPP
Expand All @@ -536,7 +536,7 @@ namespace nil {

// U = e(A,v2)
b_input2.pop_back();
b_input2.template emplace_back(proof.tmipp.gipa.final_vkey.second);
b_input2.template emplace_back<>(proof.tmipp.gipa.final_vkey.second);
pc.merge_random(a_input2.begin(), a_input2.end(), b_input2.begin(), b_input2.end(), final_res.uc);

if (final_z != final_res.zc) {
Expand Down

0 comments on commit bbf59e7

Please sign in to comment.