Back to index

glibc  2.9
ufc.c
Go to the documentation of this file.
00001 /*
00002  * UFC-crypt: ultra fast crypt(3) implementation
00003  *
00004  * Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with the GNU C Library; see the file COPYING.LIB.  If not,
00018  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019  * Boston, MA 02111-1307, USA.
00020  *
00021  * @(#)ufc.c  2.7 9/10/96
00022  *
00023  * Stub main program for debugging
00024  * and benchmarking.
00025  *
00026  */
00027 
00028 #include <stdio.h>
00029 
00030 char *crypt();
00031 
00032 main(argc, argv)
00033   int argc;
00034   char **argv;
00035   { char *s;
00036     unsigned long i,iterations;
00037 
00038     if(argc != 2) {
00039       fprintf(stderr, "usage: ufc iterations\n");
00040       exit(1);
00041     }
00042     argv++;
00043     iterations = atoi(*argv);
00044     printf("ufc: running %d iterations\n", iterations);
00045 
00046     for(i=0; i<iterations; i++)
00047       s=crypt("foob","ar");
00048     if(strcmp(s, "arlEKn0OzVJn.") == 0)
00049       printf("OK\n");
00050     else {
00051       printf("wrong result: %s!!\n", s);
00052       exit(1);
00053     }
00054     exit(0);
00055   }
00056