From 40cbb213ac910ddcaf22a26a247d2a9eeddca1fc Mon Sep 17 00:00:00 2001 From: J08nY Date: Tue, 27 Feb 2018 20:48:21 +0100 Subject: Add tests for Koblitz order store. --- src/math/koblitz.c | 2 +- src/math/koblitz.h | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'src/math') diff --git a/src/math/koblitz.c b/src/math/koblitz.c index 48eec2a..10467e3 100644 --- a/src/math/koblitz.c +++ b/src/math/koblitz.c @@ -63,7 +63,7 @@ const koblitz_t *koblitz_find(unsigned int m, unsigned int a) { sizeof(koblitz_t), &compare_koblitz); } -GEN koblitz_get_order(unsigned long m, unsigned int a) { +GEN koblitz_get_order(unsigned int m, unsigned int a) { const koblitz_t *found = koblitz_find(m, a); if (found) { return strtoi(found->hex_order); diff --git a/src/math/koblitz.h b/src/math/koblitz.h index 8284c2e..f1b87d2 100644 --- a/src/math/koblitz.h +++ b/src/math/koblitz.h @@ -14,10 +14,27 @@ typedef struct { const char *hex_order; } koblitz_t; +/** + * @brief + * @param curve + * @return + */ bool koblitz_is_curve(const curve_t *curve); +/** + * @brief + * @param m + * @param a + * @return + */ const koblitz_t *koblitz_find(unsigned int m, unsigned int a); -GEN koblitz_get_order(unsigned long m, unsigned int a); +/** + * @brief + * @param m + * @param a + * @return + */ +GEN koblitz_get_order(unsigned int m, unsigned int a); #endif // ECGEN_KOBLITZ_H -- cgit v1.3.1