From c76161cce326aee7a0835c095cd99b694db3d3d4 Mon Sep 17 00:00:00 2001 From: mdw Date: Wed, 6 Dec 2000 20:31:33 +0000 Subject: [PATCH] Add assertion to prevent crapness. --- mp-jacobi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.11.0