X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/80e2389990082500d76eb566d4946be3e786c3ef..d8f41ccd20de16f8ebe2ccc84d47bf1cb2b26bbb:/libsecurity_cryptkit/ckutils/giantBench/giantBench.c diff --git a/libsecurity_cryptkit/ckutils/giantBench/giantBench.c b/libsecurity_cryptkit/ckutils/giantBench/giantBench.c deleted file mode 100644 index 465ea422..00000000 --- a/libsecurity_cryptkit/ckutils/giantBench/giantBench.c +++ /dev/null @@ -1,259 +0,0 @@ -/* Copyright (c) 1998 Apple Computer, Inc. All rights reserved. - * - * giantBench.c - Benchmark of NSGiantInteger primitives. - * - * Revision History - * ---------------- - * 13 Apr 98 Doug Mitchell at Apple - * Created. - */ - -#include "giantIntegers.h" -#include "ckutilities.h" -#include "feeFunctions.h" -#include "feeDebug.h" -#include -#include "ckutilsPlatform.h" -#include -#include - -#define LOOPS_DEF 100 -#define MIN_SIZE_DEF 4 /* min giant size in bytes */ -#define MAX_SIZE_DEF 32 /* max in bytes */ -#define LOOP_NOTIFY 100 - - -static void usage(char **argv) -{ - printf("usage: %s [options]\n", argv[0]); - printf(" Options:\n"); - printf(" l=loops (default = %d)\n", LOOPS_DEF); - printf(" n=maxBytes (default = %d\n", MIN_SIZE_DEF); - printf(" x=maxBytes (default = %d\n", MAX_SIZE_DEF); - printf(" o (use old 16-bit CryptKit\n"); - printf(" s=seed\n"); - printf(" h(elp)\n"); - exit(1); -} - -/* - * Fill buffer with random data. - */ -static void fillData(unsigned bufSize, - unsigned char *buf) -{ - unsigned *ip; - unsigned intCount; - unsigned residue; - unsigned char *cp; - int i; - - intCount = bufSize >> 2; - ip = (unsigned *)buf; - for(i=0; isign = -g->sign; - } - - /* avoid zero data - too many pitfalls with mod and div */ - while(isZero(g)) { - g->sign = 1; - g->n[0] = RAND(); - } -} - -/* - * Init giant arrays with random data. - */ -static void initRandGiants(unsigned numBytes, - unsigned char *buf, - unsigned numGiants, - giant *g1, - giant *g2) -{ - int i; - - for(i=0; i