md5.c (176095) | md5.c (182672) |
---|---|
1/* 2 * Derived from: 3 * 4 * MDDRIVER.C - test driver for MD2, MD4 and MD5 5 */ 6 7/* 8 * Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All --- 4 unchanged lines hidden (view full) --- 13 * software for any particular purpose. It is provided "as is" 14 * without express or implied warranty of any kind. 15 * 16 * These notices must be retained in any copies of any part of this 17 * documentation and/or software. 18 */ 19 20#include <sys/cdefs.h> | 1/* 2 * Derived from: 3 * 4 * MDDRIVER.C - test driver for MD2, MD4 and MD5 5 */ 6 7/* 8 * Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All --- 4 unchanged lines hidden (view full) --- 13 * software for any particular purpose. It is provided "as is" 14 * without express or implied warranty of any kind. 15 * 16 * These notices must be retained in any copies of any part of this 17 * documentation and/or software. 18 */ 19 20#include <sys/cdefs.h> |
21__FBSDID("$FreeBSD: head/sbin/md5/md5.c 176095 2008-02-07 18:10:24Z obrien $"); | 21__FBSDID("$FreeBSD: head/sbin/md5/md5.c 182672 2008-09-02 02:59:13Z kevlo $"); |
22 23#include <sys/types.h> 24#include <sys/time.h> 25#include <sys/resource.h> 26#include <err.h> 27#include <md5.h> 28#include <ripemd.h> 29#include <sha.h> --- 193 unchanged lines hidden (view full) --- 223 alg->name, TEST_BLOCK_COUNT, TEST_BLOCK_LEN); 224 fflush(stdout); 225 226 /* Initialize block */ 227 for (i = 0; i < TEST_BLOCK_LEN; i++) 228 block[i] = (unsigned char) (i & 0xff); 229 230 /* Start timer */ | 22 23#include <sys/types.h> 24#include <sys/time.h> 25#include <sys/resource.h> 26#include <err.h> 27#include <md5.h> 28#include <ripemd.h> 29#include <sha.h> --- 193 unchanged lines hidden (view full) --- 223 alg->name, TEST_BLOCK_COUNT, TEST_BLOCK_LEN); 224 fflush(stdout); 225 226 /* Initialize block */ 227 for (i = 0; i < TEST_BLOCK_LEN; i++) 228 block[i] = (unsigned char) (i & 0xff); 229 230 /* Start timer */ |
231 getrusage(0, &before); | 231 getrusage(RUSAGE_SELF, &before); |
232 233 /* Digest blocks */ 234 alg->Init(&context); 235 for (i = 0; i < TEST_BLOCK_COUNT; i++) 236 alg->Update(&context, block, TEST_BLOCK_LEN); 237 p = alg->End(&context, buf); 238 239 /* Stop timer */ | 232 233 /* Digest blocks */ 234 alg->Init(&context); 235 for (i = 0; i < TEST_BLOCK_COUNT; i++) 236 alg->Update(&context, block, TEST_BLOCK_LEN); 237 p = alg->End(&context, buf); 238 239 /* Stop timer */ |
240 getrusage(0, &after); | 240 getrusage(RUSAGE_SELF, &after); |
241 timersub(&after.ru_utime, &before.ru_utime, &total); 242 seconds = total.tv_sec + (float) total.tv_usec / 1000000; 243 244 printf(" done\n"); 245 printf("Digest = %s", p); 246 printf("\nTime = %f seconds\n", seconds); 247 printf("Speed = %f bytes/second\n", 248 (float) TEST_BLOCK_LEN * (float) TEST_BLOCK_COUNT / seconds); --- 105 unchanged lines hidden --- | 241 timersub(&after.ru_utime, &before.ru_utime, &total); 242 seconds = total.tv_sec + (float) total.tv_usec / 1000000; 243 244 printf(" done\n"); 245 printf("Digest = %s", p); 246 printf("\nTime = %f seconds\n", seconds); 247 printf("Speed = %f bytes/second\n", 248 (float) TEST_BLOCK_LEN * (float) TEST_BLOCK_COUNT / seconds); --- 105 unchanged lines hidden --- |