Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set minimum supported version of Clang to 17 #4528

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lib/math/pcurves/pcurves_impl/pcurves_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ class BlindedScalarBits final {
static constexpr size_t Bits = C::Scalar::BITS + (BlindingEnabled ? BlindingBits : 0);
static constexpr size_t Bytes = (Bits + 7) / 8;

BlindedScalarBits(const typename C::Scalar& scalar, RandomNumberGenerator& rng) {
BlindedScalarBits(const C::Scalar& scalar, RandomNumberGenerator& rng) {
if constexpr(BlindingEnabled) {
constexpr size_t mask_words = BlindingBits / WordInfo<W>::bits;
constexpr size_t mask_bytes = mask_words * WordInfo<W>::bytes;
Expand Down Expand Up @@ -1552,7 +1552,7 @@ class UnblindedScalarBits final {
public:
static constexpr size_t Bits = C::Scalar::BITS;

UnblindedScalarBits(const typename C::Scalar& scalar) { scalar.serialize_to(std::span{m_bytes}); }
UnblindedScalarBits(const C::Scalar& scalar) { scalar.serialize_to(std::span{m_bytes}); }

size_t get_window(size_t offset) const {
// Extract a WindowBits sized window out of s, depending on offset.
Expand Down Expand Up @@ -1973,7 +1973,7 @@ const auto& SSWU_C1()
* See RFC 9380 ("Hashing to Elliptic Curves") section 6.6.2
*/
template <typename C>
inline auto map_to_curve_sswu(const typename C::FieldElement& u) -> typename C::AffinePoint {
inline auto map_to_curve_sswu(const typename C::FieldElement& u) -> C::AffinePoint {
reneme marked this conversation as resolved.
Show resolved Hide resolved
CT::poison(u);
const auto z_u2 = C::SSWU_Z * u.square(); // z * u^2
const auto z2_u4 = z_u2.square();
Expand Down
15 changes: 7 additions & 8 deletions src/lib/math/pcurves/pcurves_impl/pcurves_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class PrimeOrderCurveImpl final : public PrimeOrderCurve {

const WindowedMul2Table<C, WindowBits>& table() const { return m_table; }

explicit PrecomputedMul2TableC(const typename C::AffinePoint& x, const typename C::AffinePoint& y) :
m_table(x, y) {}
explicit PrecomputedMul2TableC(const C::AffinePoint& x, const C::AffinePoint& y) : m_table(x, y) {}

private:
WindowedMul2Table<C, WindowBits> m_table;
Expand Down Expand Up @@ -324,24 +323,24 @@ class PrimeOrderCurveImpl final : public PrimeOrderCurve {
}

private:
static Scalar stash(const typename C::Scalar& s) {
static Scalar stash(const C::Scalar& s) {
return Scalar::_create(instance(), s.template stash_value<StorageWords>());
}

static typename C::Scalar from_stash(const Scalar& s) {
static C::Scalar from_stash(const Scalar& s) {
if(s._curve() != instance()) {
throw Invalid_Argument("Curve mismatch");
}
return C::Scalar::from_stash(s._value());
}

static AffinePoint stash(const typename C::AffinePoint& pt) {
static AffinePoint stash(const C::AffinePoint& pt) {
auto x_w = pt.x().template stash_value<StorageWords>();
auto y_w = pt.y().template stash_value<StorageWords>();
return AffinePoint::_create(instance(), x_w, y_w);
}

static typename C::AffinePoint from_stash(const AffinePoint& pt) {
static C::AffinePoint from_stash(const AffinePoint& pt) {
if(pt._curve() != instance()) {
throw Invalid_Argument("Curve mismatch");
}
Expand All @@ -350,14 +349,14 @@ class PrimeOrderCurveImpl final : public PrimeOrderCurve {
return typename C::AffinePoint(x, y);
}

static ProjectivePoint stash(const typename C::ProjectivePoint& pt) {
static ProjectivePoint stash(const C::ProjectivePoint& pt) {
auto x_w = pt.x().template stash_value<StorageWords>();
auto y_w = pt.y().template stash_value<StorageWords>();
auto z_w = pt.z().template stash_value<StorageWords>();
return ProjectivePoint::_create(instance(), x_w, y_w, z_w);
}

static typename C::ProjectivePoint from_stash(const ProjectivePoint& pt) {
static C::ProjectivePoint from_stash(const ProjectivePoint& pt) {
if(pt._curve() != instance()) {
throw Invalid_Argument("Curve mismatch");
}
Expand Down
Loading