git: 9front

Download patch

ref: e2a048f429e08e770a28d14147e24da5f1d64dad
parent: 51cddb5bad753bc03e6e7a63f31b80790a209369
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Dec 1 04:40:24 EST 2015

libsec: fix genprime() to produce normalized result

this fixed bug "assert_failed_m-flags__mpnorm_since_283cc2200e34".

--- a/sys/src/libsec/port/genprime.c
+++ b/sys/src/libsec/port/genprime.c
@@ -17,6 +17,7 @@
 	p->p[p->top-1] &= (x-1);
 	p->p[p->top-1] |= x;
 	p->p[0] |= 1;
+	mpnorm(p);
 
 	// keep icrementing till it looks prime
 	for(;;){
--