mux/src/crypt/ufc.cpp

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 Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 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  * Library General Public License for more details.
00015  
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the Free
00018  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  *
00020  * @(#)ufc.c    2.7 9/10/96
00021  *
00022  * Stub main program for debugging
00023  * and benchmarking.
00024  *
00025  */
00026 
00027 #include <stdio.h>
00028 
00029 char *crypt();
00030 
00031 main(argc, argv)
00032   int argc;
00033   char **argv;
00034   { char *s;
00035     unsigned long i,iterations;
00036 
00037     if(argc != 2) {
00038       fprintf(stderr, "usage: ufc iterations\n");
00039       exit(1);
00040     }
00041     argv++;
00042     iterations = atoi(*argv);
00043     printf("ufc: running %d iterations\n", iterations);
00044 
00045     for(i=0; i<iterations; i++)
00046       s=crypt("foob","ar");
00047     if(strcmp(s, "arlEKn0OzVJn.") == 0)
00048       printf("OK\n");
00049     else {
00050       printf("wrong result: %s!!\n", s);
00051       exit(1);
00052     }
00053     exit(0);
00054   }
00055 

Generated on Mon May 28 04:40:08 2007 for MUX by  doxygen 1.4.7