diff --git a/src/ristretto255.h b/src/ristretto255.h index 91b0e30..30cc919 100644 --- a/src/ristretto255.h +++ b/src/ristretto255.h @@ -195,10 +195,12 @@ namespace ristretto255 { if (i) throw HashReuseException(); } template< has_machine_independent_representation T, typename... Args>explicit hash(const T& first, Args... args) { + // not restraining the variant args by concept, because they get caught deeper in, + // and visual studio reporting of variant concept errors sucks. hsh in; in << first; if constexpr (sizeof...(args) > 0) { - in.hashinto( args...); + in.hashinto( ro::trigger_error(args)...); } int i = crypto_generichash_blake2b_final( &in.st, diff --git a/src/serialization.h b/src/serialization.h index 7c4c997..0eaf4ca 100644 --- a/src/serialization.h +++ b/src/serialization.h @@ -317,6 +317,9 @@ template concept has_machine_independent_representation = serializable(); + template + T trigger_error(T x) { return x; }; + static_assert( !has_machine_independent_representation && has_machine_independent_representation, char*, std::span>, "concepts needed");