@@ -192,11 +192,11 @@ private: | |||||
}; | }; | ||||
/**@cond internal*/ | /**@cond internal*/ | ||||
template<GroupId g> EcGroup<g>::Scalar::Scalar(SpongeRng &rng) NOEXCEPT { | |||||
*this = rng.read(EcGroup<g>::Scalar::SER_BYTES); | |||||
inline Ed448::Scalar::Scalar(SpongeRng &rng) NOEXCEPT { | |||||
*this = rng.read(SER_BYTES); | |||||
} | } | ||||
template<GroupId g> EcGroup<g>::Point::Point(SpongeRng &rng, bool uniform) NOEXCEPT { | |||||
inline Ed448::Point::Point(SpongeRng &rng, bool uniform) NOEXCEPT { | |||||
SecureBuffer buffer((uniform ? 2 : 1) * HASH_BYTES); | SecureBuffer buffer((uniform ? 2 : 1) * HASH_BYTES); | ||||
rng.read(buffer); | rng.read(buffer); | ||||
set_to_hash(buffer); | set_to_hash(buffer); | ||||
@@ -21,9 +21,9 @@ | |||||
#include <algorithm> | #include <algorithm> | ||||
using namespace decaf; | using namespace decaf; | ||||
typedef EcGroup<448>::Scalar Scalar; | |||||
typedef EcGroup<448>::Point Point; | |||||
typedef EcGroup<448>::Precomputed Precomputed; | |||||
typedef Ed448::Scalar Scalar; | |||||
typedef Ed448::Point Point; | |||||
typedef Ed448::Precomputed Precomputed; | |||||
static __inline__ void __attribute__((unused)) ignore_result ( int result ) { (void)result; } | static __inline__ void __attribute__((unused)) ignore_result ( int result ) { (void)result; } | ||||
@@ -40,11 +40,11 @@ public: | |||||
} | } | ||||
}; | }; | ||||
template<decaf::GroupId GROUP> struct Tests { | |||||
template<typename Group> struct Tests { | |||||
typedef typename decaf::EcGroup<GROUP>::Scalar Scalar; | |||||
typedef typename decaf::EcGroup<GROUP>::Point Point; | |||||
typedef typename decaf::EcGroup<GROUP>::Precomputed Precomputed; | |||||
typedef typename Group::Scalar Scalar; | |||||
typedef typename Group::Point Point; | |||||
typedef typename Group::Precomputed Precomputed; | |||||
static void print(const char *name, const Scalar &x) { | static void print(const char *name, const Scalar &x) { | ||||
unsigned char buffer[Scalar::SER_BYTES]; | unsigned char buffer[Scalar::SER_BYTES]; | ||||
@@ -199,8 +199,8 @@ static void test_ec() { | |||||
int main(int argc, char **argv) { | int main(int argc, char **argv) { | ||||
(void) argc; (void) argv; | (void) argc; (void) argv; | ||||
Tests<448>::test_arithmetic(); | |||||
Tests<448>::test_ec(); | |||||
Tests<decaf::Ed448>::test_arithmetic(); | |||||
Tests<decaf::Ed448>::test_ec(); | |||||
if (passing) printf("Passed all tests.\n"); | if (passing) printf("Passed all tests.\n"); | ||||