projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support subgroups of binary fields.
[u/mdw/catacomb]
/
ec-info.c
diff --git
a/ec-info.c
b/ec-info.c
index
6b5e08e
..
bf9607c
100644
(file)
--- a/
ec-info.c
+++ b/
ec-info.c
@@
-34,6
+34,7
@@
#include "gf.h"
#include "pgen.h"
#include "mprand.h"
#include "gf.h"
#include "pgen.h"
#include "mprand.h"
+#include "mpint.h"
#include "rabin.h"
/*----- Main code ---------------------------------------------------------*/
#include "rabin.h"
/*----- Main code ---------------------------------------------------------*/
@@
-435,6
+436,13
@@
static const char *bincheck(const ec_info *ei, grand *gr)
ec p;
int rc;
ec p;
int rc;
+ /* --- Check that %$m$% is prime --- */
+
+ x = mp_fromuint(MP_NEW, f->nbits);
+ rc = pfilt_smallfactor(x);
+ mp_drop(x);
+ if (rc != PGEN_DONE) return ("degree not prime");
+
/* --- Check that %$p$% is irreducible --- */
if (!gf_irreduciblep(f->m)) return ("p not irreducible");
/* --- Check that %$p$% is irreducible --- */
if (!gf_irreduciblep(f->m)) return ("p not irreducible");