This is an automated email from the ASF dual-hosted git repository. sandreoli pushed a commit to branch review-mike in repository https://gitbox.apache.org/repos/asf/incubator-milagro-crypto-c.git
commit 8e805c2a57773319bd1fce3e22704aa8ebfd5571 Author: Samuele Andreoli <[email protected]> AuthorDate: Sun Apr 12 17:54:59 2020 +0100 add debug norm statements to big --- src/big.c.in | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/big.c.in b/src/big.c.in index a97f414..cbeb524 100644 --- a/src/big.c.in +++ b/src/big.c.in @@ -29,6 +29,10 @@ int BIG_XXX_iszilch(BIG_XXX a) int i; chunk d = 0; +#ifdef DEBUG_NORM + if ((a[MPV_XXX]!=1 && a[MPV_XXX]!=0) || a[MNV_XXX]!=0) printf("Input to iszilch not normed\n"); +#endif + for (i=0; i<NLEN_XXX; i++) d |= a[i]; @@ -45,6 +49,10 @@ int BIG_XXX_isunity(BIG_XXX a) int i; chunk d = 0; +#ifdef DEBUG_NORM + if ((a[MPV_XXX]!=1 && a[MPV_XXX]!=0) || a[MNV_XXX]!=0) printf("Input to isunity not normed\n"); +#endif + for(i=1; i<NLEN_XXX; i++) d |= a[i]; @@ -58,6 +66,10 @@ int BIG_XXX_diszilch(DBIG_XXX a) int i; chunk d = 0; +#ifdef DEBUG_NORM + if ((a[DMPV_XXX]!=1 && a[DMPV_XXX]!=0) || a[DMNV_XXX]!=0) printf("Input to diszilch not normed\n"); +#endif + for (i=0; i<DNLEN_XXX; i++) d |= a[i]; @@ -1027,6 +1039,11 @@ int BIG_XXX_comp(BIG_XXX b1,BIG_XXX b2) chunk gt = 0; chunk eq = 1; +#ifdef DEBUG_NORM + if ((b1[MPV_XXX]!=1 && b1[MPV_XXX]!=0) || b1[MNV_XXX]!=0) printf("First input to comp not normed\n"); + if ((b2[MPV_XXX]!=1 && b2[MPV_XXX]!=0) || b2[MNV_XXX]!=0) printf("Second input to comp not normed\n"); +#endif + for (i = NLEN_XXX-1; i>=0; i--) { gt |= ((b2[i]-b1[i]) >> BASEBITS_XXX) & eq; @@ -1045,6 +1062,11 @@ int BIG_XXX_dcomp(DBIG_XXX b1,DBIG_XXX b2) chunk gt = 0; chunk eq = 1; +#ifdef DEBUG_NORM + if ((b1[DMPV_XXX]!=1 && b1[DMPV_XXX]!=0) || b1[DMNV_XXX]!=0) printf("First input to dcomp not normed\n"); + if ((b2[DMPV_XXX]!=1 && b2[DMPV_XXX]!=0) || b2[DMNV_XXX]!=0) printf("Second input to dcomp not normed\n"); +#endif + for (i=DNLEN_XXX-1; i>=0; i--) { gt |= ((b2[i]-b1[i]) >> BASEBITS_XXX) & eq;
