From: mdw Date: Wed, 6 Dec 2000 20:31:33 +0000 (+0000) Subject: Add assertion to prevent crapness. X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/commitdiff_plain/c76161cce326aee7a0835c095cd99b694db3d3d4 Add assertion to prevent crapness. --- diff --git a/mp-jacobi.c b/mp-jacobi.c index aba168e..0e187cf 100644 --- a/mp-jacobi.c +++ b/mp-jacobi.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mp-jacobi.c,v 1.3 2000/07/20 17:14:34 mdw Exp $ + * $Id: mp-jacobi.c,v 1.4 2000/12/06 20:31:33 mdw Exp $ * * Compute Jacobi symbol * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: mp-jacobi.c,v $ + * Revision 1.4 2000/12/06 20:31:33 mdw + * Add assertion to prevent crapness. + * * Revision 1.3 2000/07/20 17:14:34 mdw * Simplify by using @mp_odd@. * @@ -64,6 +67,8 @@ int mp_jacobi(mp *a, mp *n) { int s = 1; + assert(((void)"n must be odd in mp_jacobi", MP_LEN(n) && (n->v[0] & 1))); + /* --- Take copies of the arguments --- */ a = MP_COPY(a);