Lclint clean.
CVS patchset: 5101 CVS date: 2001/10/08 15:48:30
This commit is contained in:
parent
4c15c4d274
commit
49fb1d34f1
|
@ -1,7 +1,7 @@
|
|||
-I. -I/usr/lib/gcc-lib/i386-redhat-linux/2.96/include -DHAVE_CONFIG_H -D_GNU_SOURCE -DHAVE_DEV_DSP -DHAVE_SYS_SOUNDCARD
|
||||
|
||||
#+partial
|
||||
#+forcehints
|
||||
+forcehints
|
||||
|
||||
-warnunixlib
|
||||
-warnposix
|
||||
|
|
|
@ -145,7 +145,7 @@ DOXYGEN = /usr/bin/doxygen
|
|||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.gnu.h
|
||||
CONFIG_CLEAN_FILES = Doxyfile
|
||||
CONFIG_CLEAN_FILES = Doxyfile beecrypt.spec
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
|
||||
|
||||
|
@ -168,8 +168,8 @@ HEADERS = $(pkginclude_HEADERS)
|
|||
|
||||
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING COPYING.LIB ChangeLog \
|
||||
Doxyfile.in INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 \
|
||||
config.gnu.h.in config.guess config.sub configure configure.in \
|
||||
install-sh ltconfig ltmain.sh missing mkinstalldirs
|
||||
beecrypt.spec.in config.gnu.h.in config.guess config.sub configure \
|
||||
configure.in install-sh ltconfig ltmain.sh missing mkinstalldirs
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
@ -226,6 +226,8 @@ distclean-hdr:
|
|||
maintainer-clean-hdr:
|
||||
Doxyfile: $(top_builddir)/config.status Doxyfile.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
beecrypt.spec: $(top_builddir)/config.status beecrypt.spec.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
mostlyclean-libLTLIBRARIES:
|
||||
|
||||
|
@ -552,6 +554,9 @@ install uninstall-am uninstall all-redirect all-am all installdirs-am \
|
|||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
.S.lo:
|
||||
$(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
|
||||
|
||||
.PHONY: beetest
|
||||
beetest: all
|
||||
make -C tests beetest
|
||||
|
@ -574,9 +579,6 @@ doxygen apidocs: Doxyfile Doxyheader
|
|||
mkdir -p $@
|
||||
- [ -x ${DOXYGEN} ] && ${DOXYGEN}
|
||||
|
||||
.S.lo:
|
||||
$(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
|
@ -2675,31 +2675,181 @@ EOF
|
|||
;;
|
||||
esac
|
||||
|
||||
case "$target" in
|
||||
NONE) lt_target="$host" ;;
|
||||
*) lt_target="$target" ;;
|
||||
esac
|
||||
|
||||
# Check for any special flags to pass to ltconfig.
|
||||
case $host_os in
|
||||
cygwin* | mingw* | pw32* | os2*)
|
||||
cat <<'EOF' >> "${ofile}T"
|
||||
# This is a source program that is used to create dlls on Windows
|
||||
# Don't remove nor modify the starting and closing comments
|
||||
# /* ltdll.c starts here */
|
||||
# #define WIN32_LEAN_AND_MEAN
|
||||
# #include <windows.h>
|
||||
# #undef WIN32_LEAN_AND_MEAN
|
||||
# #include <stdio.h>
|
||||
#
|
||||
# the following will cause an existing older ltconfig to fail, so
|
||||
# we ignore this at the expense of the cache file... Checking this
|
||||
# will just take longer ... bummer!
|
||||
#libtool_flags="--cache-file=$cache_file"
|
||||
# #ifndef __CYGWIN__
|
||||
# # ifdef __CYGWIN32__
|
||||
# # define __CYGWIN__ __CYGWIN32__
|
||||
# # endif
|
||||
# #endif
|
||||
#
|
||||
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
||||
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
||||
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
||||
[libtool_flags="$libtool_flags --enable-dlopen"])
|
||||
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
||||
[libtool_flags="$libtool_flags --enable-win32-dll"])
|
||||
AC_ARG_ENABLE(libtool-lock,
|
||||
[ --disable-libtool-lock avoid locking (might break parallel builds)])
|
||||
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
||||
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
||||
# #ifdef __cplusplus
|
||||
# extern "C" {
|
||||
# #endif
|
||||
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
|
||||
# #ifdef __cplusplus
|
||||
# }
|
||||
# #endif
|
||||
#
|
||||
# #ifdef __CYGWIN__
|
||||
# #include <cygwin/cygwin_dll.h>
|
||||
# DECLARE_CYGWIN_DLL( DllMain );
|
||||
# #endif
|
||||
# HINSTANCE __hDllInstance_base;
|
||||
#
|
||||
# BOOL APIENTRY
|
||||
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
|
||||
# {
|
||||
# __hDllInstance_base = hInst;
|
||||
# return TRUE;
|
||||
# }
|
||||
# /* ltdll.c ends here */
|
||||
# This is a source program that is used to create import libraries
|
||||
# on Windows for dlls which lack them. Don't remove nor modify the
|
||||
# starting and closing comments
|
||||
# /* impgen.c starts here */
|
||||
# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU libtool.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# */
|
||||
#
|
||||
# #include <stdio.h> /* for printf() */
|
||||
# #include <unistd.h> /* for open(), lseek(), read() */
|
||||
# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
|
||||
# #include <string.h> /* for strdup() */
|
||||
#
|
||||
# /* O_BINARY isn't required (or even defined sometimes) under Unix */
|
||||
# #ifndef O_BINARY
|
||||
# #define O_BINARY 0
|
||||
# #endif
|
||||
#
|
||||
# static unsigned int
|
||||
# pe_get16 (fd, offset)
|
||||
# int fd;
|
||||
# int offset;
|
||||
# {
|
||||
# unsigned char b[2];
|
||||
# lseek (fd, offset, SEEK_SET);
|
||||
# read (fd, b, 2);
|
||||
# return b[0] + (b[1]<<8);
|
||||
# }
|
||||
#
|
||||
# static unsigned int
|
||||
# pe_get32 (fd, offset)
|
||||
# int fd;
|
||||
# int offset;
|
||||
# {
|
||||
# unsigned char b[4];
|
||||
# lseek (fd, offset, SEEK_SET);
|
||||
# read (fd, b, 4);
|
||||
# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
|
||||
# }
|
||||
#
|
||||
# static unsigned int
|
||||
# pe_as32 (ptr)
|
||||
# void *ptr;
|
||||
# {
|
||||
# unsigned char *b = ptr;
|
||||
# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
|
||||
# }
|
||||
#
|
||||
# int
|
||||
# main (argc, argv)
|
||||
# int argc;
|
||||
# char *argv[];
|
||||
# {
|
||||
# int dll;
|
||||
# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
|
||||
# unsigned long export_rva, export_size, nsections, secptr, expptr;
|
||||
# unsigned long name_rvas, nexp;
|
||||
# unsigned char *expdata, *erva;
|
||||
# char *filename, *dll_name;
|
||||
#
|
||||
# filename = argv[1];
|
||||
#
|
||||
# dll = open(filename, O_RDONLY|O_BINARY);
|
||||
# if (dll < 1)
|
||||
# return 1;
|
||||
#
|
||||
# dll_name = filename;
|
||||
#
|
||||
# for (i=0; filename[i]; i++)
|
||||
# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
|
||||
# dll_name = filename + i +1;
|
||||
#
|
||||
# pe_header_offset = pe_get32 (dll, 0x3c);
|
||||
# opthdr_ofs = pe_header_offset + 4 + 20;
|
||||
# num_entries = pe_get32 (dll, opthdr_ofs + 92);
|
||||
#
|
||||
# if (num_entries < 1) /* no exports */
|
||||
# return 1;
|
||||
#
|
||||
# export_rva = pe_get32 (dll, opthdr_ofs + 96);
|
||||
# export_size = pe_get32 (dll, opthdr_ofs + 100);
|
||||
# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
|
||||
# secptr = (pe_header_offset + 4 + 20 +
|
||||
# pe_get16 (dll, pe_header_offset + 4 + 16));
|
||||
#
|
||||
# expptr = 0;
|
||||
# for (i = 0; i < nsections; i++)
|
||||
# {
|
||||
# char sname[8];
|
||||
# unsigned long secptr1 = secptr + 40 * i;
|
||||
# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
|
||||
# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
|
||||
# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
|
||||
# lseek(dll, secptr1, SEEK_SET);
|
||||
# read(dll, sname, 8);
|
||||
# if (vaddr <= export_rva && vaddr+vsize > export_rva)
|
||||
# {
|
||||
# expptr = fptr + (export_rva - vaddr);
|
||||
# if (export_rva + export_size > vaddr + vsize)
|
||||
# export_size = vsize - (export_rva - vaddr);
|
||||
# break;
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# expdata = (unsigned char*)malloc(export_size);
|
||||
# lseek (dll, expptr, SEEK_SET);
|
||||
# read (dll, expdata, export_size);
|
||||
# erva = expdata - export_rva;
|
||||
#
|
||||
# nexp = pe_as32 (expdata+24);
|
||||
# name_rvas = pe_as32 (expdata+32);
|
||||
#
|
||||
# printf ("EXPORTS\n");
|
||||
# for (i = 0; i<nexp; i++)
|
||||
# {
|
||||
# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
|
||||
# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
|
||||
# }
|
||||
#
|
||||
# return 0;
|
||||
# }
|
||||
# /* impgen.c ends here */
|
||||
|
||||
EOF
|
||||
;;
|
||||
|
|
|
@ -46,7 +46,9 @@ static int _debug = 0;
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
/*@-readonlytrans@*/
|
||||
static const char* to_b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
/*@=readonlytrans@*/
|
||||
|
||||
/* encode 64 characters per line */
|
||||
#define CHARS_PER_LINE 64
|
||||
|
@ -69,10 +71,10 @@ char* b64enc(const memchunk* chunk)
|
|||
|
||||
while (div > 0)
|
||||
{
|
||||
buf[0] = to_b64[ (data[0] >> 2) & 0x3f];
|
||||
buf[1] = to_b64[((data[0] << 4) & 0x30) | ((data[1] >> 4) & 0xf)];
|
||||
buf[2] = to_b64[((data[1] << 2) & 0x3c) | ((data[2] >> 6) & 0x3)];
|
||||
buf[3] = to_b64[ data[2] & 0x3f];
|
||||
buf[0] = to_b64[ ((unsigned)data[0] >> 2) & 0x3f];
|
||||
buf[1] = to_b64[(((unsigned)data[0] << 4) & 0x30) | (((unsigned)data[1] >> 4) & 0xf)];
|
||||
buf[2] = to_b64[(((unsigned)data[1] << 2) & 0x3c) | (((unsigned)data[2] >> 6) & 0x3)];
|
||||
buf[3] = to_b64[ (unsigned)data[2] & 0x3f];
|
||||
data += 3;
|
||||
buf += 4;
|
||||
div--;
|
||||
|
@ -87,16 +89,16 @@ char* b64enc(const memchunk* chunk)
|
|||
switch (rem)
|
||||
{
|
||||
case 2:
|
||||
buf[0] = to_b64[ (data[0] >> 2) & 0x3f];
|
||||
buf[1] = to_b64[((data[0] << 4) & 0x30) + ((data[1] >> 4) & 0xf)];
|
||||
buf[2] = to_b64[ (data[1] << 2) & 0x3c];
|
||||
buf[0] = to_b64[ ((unsigned)data[0] >> 2) & 0x3f];
|
||||
buf[1] = to_b64[(((unsigned)data[0] << 4) & 0x30) + (((unsigned)data[1] >> 4) & 0xf)];
|
||||
buf[2] = to_b64[ ((unsigned)data[1] << 2) & 0x3c];
|
||||
buf[3] = '=';
|
||||
buf += 4;
|
||||
chars += 4;
|
||||
break;
|
||||
case 1:
|
||||
buf[0] = to_b64[ (data[0] >> 2) & 0x3f];
|
||||
buf[1] = to_b64[ (data[0] << 4) & 0x30];
|
||||
buf[0] = to_b64[ ((unsigned)data[0] >> 2) & 0x3f];
|
||||
buf[1] = to_b64[ ((unsigned)data[0] << 4) & 0x30];
|
||||
buf[2] = '=';
|
||||
buf[3] = '=';
|
||||
buf += 4;
|
||||
|
@ -140,7 +142,7 @@ memchunk* b64dec(const char* string)
|
|||
for (i = 0; i < vrfy; i++)
|
||||
{
|
||||
if (isspace(tmp[i]))
|
||||
continue;
|
||||
/*@innercontinue@*/ continue;
|
||||
|
||||
if (tmp[i] == '=')
|
||||
{
|
||||
|
@ -152,7 +154,7 @@ memchunk* b64dec(const char* string)
|
|||
return 0;
|
||||
|
||||
/* end-of-message recognized */
|
||||
break;
|
||||
/*@innerbreak@*/ break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -189,6 +191,7 @@ memchunk* b64dec(const char* string)
|
|||
if (isspace(ch))
|
||||
continue;
|
||||
|
||||
bits = 0;
|
||||
if ((ch >= 'A') && (ch <= 'Z'))
|
||||
{
|
||||
bits = (byte) (ch - 'A');
|
||||
|
@ -211,23 +214,25 @@ memchunk* b64dec(const char* string)
|
|||
}
|
||||
else if (ch == '=')
|
||||
break;
|
||||
else
|
||||
{};
|
||||
|
||||
switch (qw++)
|
||||
{
|
||||
case 0:
|
||||
data[tw+0] = (bits << 2) & 0xfc;
|
||||
break;
|
||||
/*@switchbreak@*/ break;
|
||||
case 1:
|
||||
data[tw+0] |= (bits >> 4) & 0x03;
|
||||
data[tw+1] = (bits << 4) & 0xf0;
|
||||
break;
|
||||
/*@switchbreak@*/ break;
|
||||
case 2:
|
||||
data[tw+1] |= (bits >> 2) & 0x0f;
|
||||
data[tw+2] = (bits << 6) & 0xc0;
|
||||
break;
|
||||
/*@switchbreak@*/ break;
|
||||
case 3:
|
||||
data[tw+2] |= bits & 0x3f;
|
||||
break;
|
||||
/*@switchbreak@*/ break;
|
||||
}
|
||||
|
||||
if (qw == 4)
|
||||
|
|
|
@ -88,7 +88,7 @@ char* b64enc(const memchunk*);
|
|||
|
||||
/**
|
||||
*/
|
||||
BEECRYPTAPI /*@unused@*/
|
||||
BEECRYPTAPI /*@only@*/ /*@null@*/ /*@unused@*/
|
||||
memchunk* b64dec(const char*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Summary: The BeeCrypt Cryptography Library
|
||||
Name: beecrypt
|
||||
Version: 2.1.0
|
||||
Release: 1
|
||||
Version: 2.2.0
|
||||
Release: 2
|
||||
Copyright: LGPL
|
||||
Group: Development/Libraries
|
||||
Source0: http://beecrypt.virtualunlimited.com/download/beecrypt-%{version}.tar.gz
|
||||
|
@ -23,7 +23,7 @@ The BeeCrypt Cryptography Library headers.
|
|||
%setup -q
|
||||
|
||||
%build
|
||||
%configure
|
||||
%configure --enable-static
|
||||
make
|
||||
make apidocs
|
||||
|
||||
|
@ -41,7 +41,7 @@ rm -rf ${RPM_BUILD_ROOT}
|
|||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc BENCHMARKS NEWS README*
|
||||
%{_libdir}/libbeecrypt.so.2.1.0
|
||||
%{_libdir}/libbeecrypt.so.2.2.0
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
|
@ -49,8 +49,12 @@ rm -rf ${RPM_BUILD_ROOT}
|
|||
%{_libdir}/libbeecrypt.so.2
|
||||
%{_libdir}/libbeecrypt.so
|
||||
%{_libdir}/libbeecrypt.la
|
||||
%{_libdir}/libbeecrypt.a
|
||||
%{_includedir}/beecrypt
|
||||
|
||||
%changelog
|
||||
* Mon Sep 24 2001 Jeff Johnsopn <jbj@redhat.com>
|
||||
- add static libraries.
|
||||
|
||||
* Tue Sep 18 2001 Jeff Johnson <jbj@redhat.com>
|
||||
- repackage
|
||||
- repackage.
|
||||
|
|
|
@ -123,6 +123,9 @@
|
|||
/* Define if you have the <ctype.h> header file. */
|
||||
#undef HAVE_CTYPE_H
|
||||
|
||||
/* Define if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define if you have the <errno.h> header file. */
|
||||
#undef HAVE_ERRNO_H
|
||||
|
||||
|
@ -190,12 +193,8 @@
|
|||
#undef HAVE_LIBTHREAD
|
||||
|
||||
/* Name of package */
|
||||
#if !defined(PACKAGE)
|
||||
#undef PACKAGE
|
||||
#endif
|
||||
|
||||
/* Version number of package */
|
||||
#if !defined(VERSION)
|
||||
#undef VERSION
|
||||
#endif
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -753,4 +753,11 @@ EOF
|
|||
fi
|
||||
|
||||
dnl Output
|
||||
AC_OUTPUT(Doxyfile Makefile docs/Makefile gas/Makefile masm/Makefile mwerks/Makefile tests/Makefile)
|
||||
AC_OUTPUT([ Doxyfile Makefile beecrypt.spec
|
||||
docs/Makefile gas/Makefile masm/Makefile mwerks/Makefile
|
||||
tests/Makefile ],
|
||||
[
|
||||
echo timestamp > stamp-h.in
|
||||
]
|
||||
|
||||
)
|
||||
|
|
|
@ -74,20 +74,11 @@ int dldp_pFree(/*@special@*/ dldp_p* dp)
|
|||
/*@releases dp->p.modl, dp->q.modl, dp->n.modl @*/
|
||||
/*@modifies dp->p, dp->q, dp->r, dp->g, dp->n @*/;
|
||||
|
||||
<<<<<<< dldp.h
|
||||
/**
|
||||
*/
|
||||
BEECRYPTAPI
|
||||
int dldp_pCopy(dldp_p* dst, const dldp_p* src)
|
||||
/*@modifies dst @*/;
|
||||
=======
|
||||
BEECRYPTAPI
|
||||
int dldp_pInit(dldp_p*);
|
||||
BEECRYPTAPI
|
||||
int dldp_pFree(dldp_p*);
|
||||
BEECRYPTAPI
|
||||
int dldp_pCopy(dldp_p*, const dldp_p*);
|
||||
>>>>>>> 1.1.1.3
|
||||
|
||||
/*
|
||||
* Functions for generating keys
|
||||
|
|
|
@ -59,7 +59,7 @@ memchunk* memchunkResize(/*@only@*/ /*@null@*/memchunk* m, int size)
|
|||
|
||||
/**
|
||||
*/
|
||||
BEECRYPTAPI /*@only@*/ /*@null@*/
|
||||
BEECRYPTAPI /*@only@*/ /*@null@*/ /*@unused@*/
|
||||
memchunk* memchunkClone(const memchunk* m);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -72,10 +72,8 @@ extern "C" {
|
|||
# if defined(OPTIMIZE_I386) || defined(OPTIMIZE_I486) || defined(OPTIMIZE_I586) || defined(OPTIMIZE_I686)
|
||||
# define ASM_MP32ZERO
|
||||
# define ASM_MP32FILL
|
||||
#if 0 /* XXX BROKEN! */
|
||||
# define ASM_MP32EVEN
|
||||
# define ASM_MP32ODD
|
||||
#endif
|
||||
# define ASM_MP32ADDW
|
||||
# define ASM_MP32ADD
|
||||
# define ASM_MP32SUBW
|
||||
|
|
|
@ -125,6 +125,8 @@ static const char* elg_n = "8df2a494492276aa3d25759bb06869cbeac0d83afb8d0cf7cbb8
|
|||
|
||||
randomGeneratorContext rngc;
|
||||
|
||||
memset(&rngc, 0, sizeof(randomGeneratorContext));
|
||||
|
||||
/*@-nullpass -modobserver @*/
|
||||
if (randomGeneratorContextInit(&rngc, randomGeneratorDefault()) == 0)
|
||||
/*@=nullpass =modobserver @*/
|
||||
|
@ -137,9 +139,11 @@ static const char* elg_n = "8df2a494492276aa3d25759bb06869cbeac0d83afb8d0cf7cbb8
|
|||
|
||||
mp32nsize(&digest, 5);
|
||||
|
||||
rngc.rng->next(rngc.param, digest.data, digest.size);
|
||||
/*@-noeffectuncon@*/ /* LCL: ??? */
|
||||
(void) rngc.rng->next(rngc.param, digest.data, digest.size);
|
||||
/*@=noeffectuncon@*/
|
||||
|
||||
dsasign(&keypair->param.p, &keypair->param.q, &keypair->param.g, &rngc, &digest, &keypair->x, &r, &s);
|
||||
(void) dsasign(&keypair->param.p, &keypair->param.q, &keypair->param.g, &rngc, &digest, &keypair->x, &r, &s);
|
||||
|
||||
rc = dsavrfy(&keypair->param.p, &keypair->param.q, &keypair->param.g, &digest, &keypair->y, &r, &s);
|
||||
|
||||
|
@ -147,7 +151,9 @@ static const char* elg_n = "8df2a494492276aa3d25759bb06869cbeac0d83afb8d0cf7cbb8
|
|||
mp32nfree(&r);
|
||||
mp32nfree(&s);
|
||||
|
||||
randomGeneratorContextFree(&rngc);
|
||||
/*@-modobserver@*/
|
||||
(void) randomGeneratorContextFree(&rngc);
|
||||
/*@=modobserver@*/
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
@ -764,15 +770,16 @@ static void testDLAlgorithms(void)
|
|||
dldp_p dp;
|
||||
dlkp_p kp;
|
||||
|
||||
memset(&rc, 0, sizeof(randomGeneratorContext));
|
||||
memset(&rngc, 0, sizeof(randomGeneratorContext));
|
||||
memset(&dp, 0, sizeof(dldp_p));
|
||||
memset(&kp, 0, sizeof(dlkp_p));
|
||||
|
||||
mp32nzero(&hm);
|
||||
mp32nzero(&r);
|
||||
mp32nzero(&s);
|
||||
|
||||
dldp_pInit(&dp);
|
||||
dlkp_pInit(&kp);
|
||||
(void) dldp_pInit(&dp);
|
||||
(void) dlkp_pInit(&kp);
|
||||
|
||||
/*@-nullpass -modobserver @*/
|
||||
if (randomGeneratorContextInit(&rngc, randomGeneratorDefault()) == 0)
|
||||
|
@ -795,12 +802,12 @@ static void testDLAlgorithms(void)
|
|||
printf(" done in %.3f seconds\n", ttime);
|
||||
#endif
|
||||
|
||||
dlkp_pInit(&kp);
|
||||
(void) dlkp_pInit(&kp);
|
||||
printf("Generating keypair\n");
|
||||
#if HAVE_TIME_H
|
||||
tstart = clock();
|
||||
#endif
|
||||
dlkp_pPair(&kp, &rngc, &dp);
|
||||
(void) dlkp_pPair(&kp, &rngc, &dp);
|
||||
#if HAVE_TIME_H
|
||||
tstop = clock();
|
||||
ttime = ((double)(tstop - tstart)) / CLOCKS_PER_SEC;
|
||||
|
@ -808,15 +815,17 @@ static void testDLAlgorithms(void)
|
|||
#endif
|
||||
|
||||
mp32nsize(&hm, 5);
|
||||
rngc.rng->next(rngc.param, hm.data, hm.size);
|
||||
/*@-noeffectuncon@*/ /* LCL: ??? */
|
||||
(void) rngc.rng->next(rngc.param, hm.data, hm.size);
|
||||
/*@=noeffectuncon@*/
|
||||
|
||||
printf("DSA signing (%d bits)\n", kp.param.p.size << 5);
|
||||
printf("DSA signing (%u bits)\n", kp.param.p.size << 5);
|
||||
#if HAVE_TIME_H
|
||||
tstart = clock();
|
||||
#endif
|
||||
for (i = 0; i < 100; i++)
|
||||
{
|
||||
dsasign(&kp.param.p, &kp.param.q, &kp.param.g, &rngc, &hm, &kp.x, &r, &s);
|
||||
(void) dsasign(&kp.param.p, &kp.param.q, &kp.param.g, &rngc, &hm, &kp.x, &r, &s);
|
||||
}
|
||||
#if HAVE_TIME_H
|
||||
tstop = clock();
|
||||
|
@ -824,13 +833,15 @@ static void testDLAlgorithms(void)
|
|||
printf(" 100x in %.3f seconds\n", ttime);
|
||||
#endif
|
||||
|
||||
printf("DSA verification (%d bits)\n", kp.param.p.size << 5);
|
||||
printf("DSA verification (%u bits)\n", kp.param.p.size << 5);
|
||||
#if HAVE_TIME_H
|
||||
tstart = clock();
|
||||
#endif
|
||||
for (i = 0; i < 100; i++)
|
||||
{
|
||||
dsavrfy(&kp.param.p, &kp.param.q, &kp.param.g, &hm, &kp.y, &r, &s);
|
||||
/*@-noeffect@*/ /* check return code */
|
||||
(void) dsavrfy(&kp.param.p, &kp.param.q, &kp.param.g, &hm, &kp.y, &r, &s);
|
||||
/*@=noeffect@*/
|
||||
}
|
||||
#if HAVE_TIME_H
|
||||
tstop = clock();
|
||||
|
@ -838,7 +849,9 @@ static void testDLAlgorithms(void)
|
|||
printf(" 100x in %.3f seconds\n", ttime);
|
||||
#endif
|
||||
(void) dlkp_pFree(&kp);
|
||||
memset(&kp, 0, sizeof(dlkp_p));
|
||||
(void) dldp_pFree(&dp);
|
||||
memset(&dp, 0, sizeof(dldp_p));
|
||||
|
||||
printf("Generating P (1024 bits) Q (768 bits) G with order (P-1)\n");
|
||||
#if HAVE_TIME_H
|
||||
|
@ -851,8 +864,11 @@ static void testDLAlgorithms(void)
|
|||
printf(" done in %.3f seconds\n", ttime);
|
||||
#endif
|
||||
(void) dldp_pFree(&dp);
|
||||
memset(&dp, 0, sizeof(dldp_p));
|
||||
|
||||
/*@-modobserver@*/
|
||||
(void) randomGeneratorContextFree(&rngc);
|
||||
/*@=modobserver@*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1020,7 +1036,7 @@ int main(/*@unused@*/int argc, /*@unused@*/char *argv[])
|
|||
else
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
/*@-compdef@*/
|
||||
memset(&keypair, 0, sizeof(dlkp_p));
|
||||
(void) dlkp_pInit(&keypair);
|
||||
|
||||
mp32bsethex(&keypair.param.p, dsa_p);
|
||||
|
@ -1058,7 +1074,6 @@ int main(/*@unused@*/int argc, /*@unused@*/char *argv[])
|
|||
#endif
|
||||
|
||||
(void) dlkp_pFree(&keypair);
|
||||
/*@=compdef@*/
|
||||
|
||||
if (testVectorRSA())
|
||||
printf("RSA works!\n");
|
||||
|
|
Loading…
Reference in New Issue