1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-01 22:28:02 +02:00

* rijndael.c, rndunix.c, twofish.c: Remove dead IS_MODULE code.

* g10c.c: Dead code.  Remove.

* Makefile.am: Don't compile g10c.c.
This commit is contained in:
David Shaw 2003-12-30 00:57:05 +00:00
parent 330f042fa4
commit d7a28c72a8
6 changed files with 10 additions and 190 deletions

View File

@ -1,3 +1,11 @@
2003-12-29 David Shaw <dshaw@jabberwocky.com>
* rijndael.c, rndunix.c, twofish.c: Remove dead IS_MODULE code.
* g10c.c: Dead code. Remove.
* Makefile.am: Don't compile g10c.c.
2003-12-28 Stefan Bellon <sbellon@sbellon.de>
* rndriscos.c (rndriscos_gather_random) [__riscos__]: Declare

View File

@ -42,7 +42,6 @@ libcipher_a_SOURCES = cipher.c \
rmd.h \
dsa.h \
dsa.c \
g10c.c \
smallprime.c \
algorithms.h \
rndlinux.c \

View File

@ -1,46 +0,0 @@
/* g10c.c - Wrapper for cipher functions
* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
* GnuPG 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.
*
* GnuPG 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 <config.h>
#include <stdio.h>
#include <stdlib.h>
#include "mpi.h"
#include "random.h"
#include "cipher.h"
/* FIXME: The modules should use functions from libgcrypt */
const char *g10c_revision_string(int dummy) { return "$Revision$"; }
MPI
g10c_generate_secret_prime( unsigned nbits )
{
return generate_secret_prime( nbits );
}
char *
g10c_get_random_bits( unsigned nbits, int level, int secure )
{
return (char*)get_random_bits( nbits, level, secure );
}

View File

@ -2128,10 +2128,7 @@ selftest (void)
return NULL;
}
#ifdef IS_MODULE
static
#endif
const char *
const char *
rijndael_get_info (int algo, size_t *keylen,
size_t *blocksize, size_t *contextsize,
int (**r_setkey) (void *c, byte *key, unsigned keylen),
@ -2158,68 +2155,3 @@ rijndael_get_info (int algo, size_t *keylen,
return "AES256";
return NULL;
}
#ifdef IS_MODULE
static
const char * const gnupgext_version = "RIJNDAEL ($Revision$)";
static struct {
int class;
int version;
int value;
void (*func)(void);
} func_table[] = {
{ 20, 1, 0, (void(*)(void))rijndael_get_info },
{ 21, 1, 7 },
{ 21, 1, 8 },
{ 21, 1, 9 },
};
/****************
* Enumerate the names of the functions together with information about
* this function. Set sequence to an integer with a initial value of 0 and
* do not change it.
* If what is 0 all kind of functions are returned.
* Return values: class := class of function:
* 10 = message digest algorithm info function
* 11 = integer with available md algorithms
* 20 = cipher algorithm info function
* 21 = integer with available cipher algorithms
* 30 = public key algorithm info function
* 31 = integer with available pubkey algorithms
* version = interface version of the function/pointer
* (currently this is 1 for all functions)
*/
static
void *
gnupgext_enum_func ( int what, int *sequence, int *class, int *vers )
{
void *ret;
int i = *sequence;
do {
if ( i >= DIM(func_table) || i < 0 ) {
return NULL;
}
*class = func_table[i].class;
*vers = func_table[i].version;
switch( *class ) {
case 11:
case 21:
case 31:
ret = &func_table[i].value;
break;
default:
ret = func_table[i].func;
break;
}
i++;
} while ( what && what != *class );
*sequence = i;
return ret;
}
#endif

View File

@ -100,9 +100,7 @@
#include <errno.h>
#include "types.h" /* for byte and u32 typedefs */
#ifndef IS_MODULE
#include "algorithms.h"
#endif
#include "util.h"
#ifndef EAGAIN

View File

@ -557,7 +557,6 @@ burn_stack (int bytes)
}
/* Perform the key setup. Note that this works only with 128- and 256-bit
* keys, despite the API that looks like it might support other sizes. */
@ -1010,10 +1009,7 @@ main()
#endif /* TEST */
#ifdef IS_MODULE
static
#endif
const char *
const char *
twofish_get_info (int algo, size_t *keylen,
size_t *blocksize, size_t *contextsize,
int (**r_setkey) (void *c, byte *key, unsigned keylen),
@ -1039,70 +1035,3 @@ twofish_get_info (int algo, size_t *keylen,
return "TWOFISH128";
return NULL;
}
#ifdef IS_MODULE
static
const char * const gnupgext_version = "TWOFISH ($Revision$)";
static struct {
int class;
int version;
int value;
void (*func)(void);
} func_table[] = {
{ 20, 1, 0, (void(*)(void))twofish_get_info },
{ 21, 1, 10 },
{ 21, 1, 102 },
};
/****************
* Enumerate the names of the functions together with information about
* this function. Set sequence to an integer with a initial value of 0 and
* do not change it.
* If what is 0 all kind of functions are returned.
* Return values: class := class of function:
* 10 = message digest algorithm info function
* 11 = integer with available md algorithms
* 20 = cipher algorithm info function
* 21 = integer with available cipher algorithms
* 30 = public key algorithm info function
* 31 = integer with available pubkey algorithms
* version = interface version of the function/pointer
* (currently this is 1 for all functions)
*/
static void *
gnupgext_enum_func ( int what, int *sequence, int *class, int *vers )
{
void *ret;
int i = *sequence;
do {
if ( i >= DIM(func_table) || i < 0 ) {
return NULL;
}
*class = func_table[i].class;
*vers = func_table[i].version;
switch( *class ) {
case 11:
case 21:
case 31:
ret = &func_table[i].value;
break;
default:
#ifndef __riscos__
ret = func_table[i].func;
#else /* __riscos__ */
ret = (void *) func_table[i].func;
#endif /* __riscos__ */
break;
}
i++;
} while ( what && what != *class );
*sequence = i;
return ret;
}
#endif