Skip to content

Commit 397f78d

Browse files
committed
field template
1 parent 2878eb8 commit 397f78d

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

lib/evmone_precompiles/pairing/field_template.hpp

+3-16
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,7 @@ struct ExtFieldElem
111111
return ExtFieldElem(v);
112112
}
113113

114-
static constexpr ExtFieldElem zero() noexcept
115-
{
116-
std::array<ValueT, DEGREE> v;
117-
for (size_t i = 0; i < DEGREE; ++i)
118-
v[i] = ValueT();
119-
120-
return ExtFieldElem(v);
121-
}
114+
static constexpr ExtFieldElem zero() noexcept { return ExtFieldElem{}; }
122115

123116
constexpr ExtFieldElem inv() const noexcept { return inverse(*this); }
124117

@@ -154,14 +147,8 @@ struct ExtFieldElem
154147
return ExtFieldElem(std::move(ret));
155148
}
156149

157-
friend constexpr bool operator==(const ExtFieldElem& e1, const ExtFieldElem& e2) noexcept
158-
{
159-
bool res = true;
160-
for (size_t i = 0; i < DEGREE && res; ++i)
161-
res = res && (e1.coeffs[i] == e2.coeffs[i]);
162-
163-
return res;
164-
}
150+
friend constexpr bool operator==(
151+
const ExtFieldElem& e1, const ExtFieldElem& e2) noexcept = default;
165152

166153
friend constexpr ExtFieldElem operator*(const ExtFieldElem& e, const Base& s) noexcept
167154
{

0 commit comments

Comments
 (0)