Improve readability of bn_shift.c.
Add comment in bn_lib.c (why zero data between top and max?)
Change bntest.c output for BN_kronecker test
}
/* Now need to zero any data between b->top and b->max */
}
/* Now need to zero any data between b->top and b->max */
A= &(a[b->top]);
for (i=(words - b->top)>>3; i>0; i--,A+=8)
A= &(a[b->top]);
for (i=(words - b->top)>>3; i>0; i--,A+=8)
BN_ULONG l;
r->neg=a->neg;
BN_ULONG l;
r->neg=a->neg;
- if (bn_wexpand(r,a->top+(n/BN_BITS2)+1) == NULL) return(0);
+ if (bn_wexpand(r,a->top+nw+1) == NULL) return(0);
lb=n%BN_BITS2;
rb=BN_BITS2-lb;
f=a->d;
lb=n%BN_BITS2;
rb=BN_BITS2-lb;
f=a->d;
- fprintf(stderr, "ok\n");
+ putc('.', stderr);
+ fflush(stderr);
+ putc('\n', stderr);
+ fflush(stderr);
ret = 1;
err:
if (a != NULL) BN_free(a);
ret = 1;
err:
if (a != NULL) BN_free(a);
/* determine timings for modexp, gcd, or modular inverse */
/* determine timings for modexp, gcd, or modular inverse */
#include <string.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <string.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
+#include <openssl/rand.h>
#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
#define TIMES
#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
#define TIMES
static int mul_c[NUM_SIZES]={8*8*8*8*8*8,8*8*8*8*8,8*8*8*8,8*8*8,8*8,8,1};
/*static int sizes[NUM_SIZES]={59,179,299,419,539}; */
static int mul_c[NUM_SIZES]={8*8*8*8*8*8,8*8*8*8*8,8*8*8*8,8*8*8,8*8,8,1};
/*static int sizes[NUM_SIZES]={59,179,299,419,539}; */
-#define RAND_SEED(string) { const char str[] = string; RAND_seed(string, sizeof string); }
+#define RAND_SEED(string) { const char str[] = string; RAND_seed(string, sizeof str); }
static void genprime_cb(int p, int n, void *arg)
{
static void genprime_cb(int p, int n, void *arg)
{
RAND_SEED("I demand a manual recount!");
do_mul_exp(r,a,b,c,ctx);
RAND_SEED("I demand a manual recount!");
do_mul_exp(r,a,b,c,ctx);
}
void do_mul_exp(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *c, BN_CTX *ctx)
}
void do_mul_exp(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *c, BN_CTX *ctx)
#else /* TEST_INV */
"2*inv %4d %4d mod %4d"
#endif
#else /* TEST_INV */
"2*inv %4d %4d mod %4d"
#endif
- " -> %8.3fms %5.1f (%d)\n",sizes[i],sizes[i],sizes[i],tm*1000.0/num,tm*mul_c[i]/num, num);
+ " -> %8.3fms %5.1f (%ld)\n",sizes[i],sizes[i],sizes[i],tm*1000.0/num,tm*mul_c[i]/num, num);
num/=7;
if (num <= 0) num=1;
}
num/=7;
if (num <= 0) num=1;
}