mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-21 21:39:58 +01:00
Add Rijndael support, changes to fix an IRIX problem.
This commit is contained in:
parent
ce6cfb69d2
commit
dc7cea85ba
@ -1,3 +1,7 @@
|
|||||||
|
2000-10-09 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* acinclude.m4: Changed wording of the faqprog.pl warning.
|
||||||
|
|
||||||
Wed Oct 4 15:50:18 CEST 2000 Werner Koch <wk@openit.de>
|
Wed Oct 4 15:50:18 CEST 2000 Werner Koch <wk@openit.de>
|
||||||
|
|
||||||
* configure.in: Set DYNLINK_MOD_CFLAGS for Irix. It seems that Irix
|
* configure.in: Set DYNLINK_MOD_CFLAGS for Irix. It seems that Irix
|
||||||
|
2
NEWS
2
NEWS
@ -2,6 +2,8 @@
|
|||||||
* New utility gpgv which is a stripped down version of gpg to
|
* New utility gpgv which is a stripped down version of gpg to
|
||||||
be used to verify signatures against a list of trusted keys.
|
be used to verify signatures against a list of trusted keys.
|
||||||
|
|
||||||
|
* Rijndael (AES) is now supported and listed as first preference.
|
||||||
|
|
||||||
|
|
||||||
Noteworthy changes in version 1.0.3 (2000-09-18)
|
Noteworthy changes in version 1.0.3 (2000-09-18)
|
||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
|
4
TODO
4
TODO
@ -1,4 +1,8 @@
|
|||||||
|
|
||||||
|
* option to set the signature expiration time for key sigs.
|
||||||
|
|
||||||
|
* Option to warn when a non MDC message is decrypted?
|
||||||
|
|
||||||
* If there is no secure memory, allocate more memory for the secure
|
* If there is no secure memory, allocate more memory for the secure
|
||||||
memory block or do it in all cases.
|
memory block or do it in all cases.
|
||||||
|
|
||||||
|
@ -63,10 +63,11 @@ AC_DEFUN(GNUPG_CHECK_FAQPROG,
|
|||||||
if test $working_faqprog = no; then
|
if test $working_faqprog = no; then
|
||||||
AC_MSG_WARN([[
|
AC_MSG_WARN([[
|
||||||
***
|
***
|
||||||
*** It seems that the faqprog.pl program is not installed.
|
*** It seems that the faqprog.pl program is not installed;
|
||||||
*** Unless you do not change the source of the FAQs it is not required.
|
*** however it is only needed if you want to change the FAQ.
|
||||||
*** The working version of this utility should be available at:
|
*** (faqprog.pl should be available at:
|
||||||
*** ftp://ftp.gnupg.org/pub/gcrypt/contrib/faqprog.pl
|
*** ftp://ftp.gnupg.org/pub/gcrypt/contrib/faqprog.pl )
|
||||||
|
*** No need to worry about this warning.
|
||||||
***]])
|
***]])
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2000-10-12 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* rijndael.c: New.
|
||||||
|
* cipher.c: Add Rijndael support.
|
||||||
|
|
||||||
Wed Oct 4 15:50:18 CEST 2000 Werner Koch <wk@openit.de>
|
Wed Oct 4 15:50:18 CEST 2000 Werner Koch <wk@openit.de>
|
||||||
|
|
||||||
* sha1.c (transform): Use rol() macro. Actually this is not needed
|
* sha1.c (transform): Use rol() macro. Actually this is not needed
|
||||||
|
@ -41,6 +41,7 @@ libcipher_a_SOURCES = cipher.c \
|
|||||||
blowfish.h \
|
blowfish.h \
|
||||||
cast5.c \
|
cast5.c \
|
||||||
cast5.h \
|
cast5.h \
|
||||||
|
rijndael.c \
|
||||||
elgamal.c \
|
elgamal.c \
|
||||||
elgamal.h \
|
elgamal.h \
|
||||||
rsa.c rsa.h \
|
rsa.c rsa.h \
|
||||||
|
@ -41,4 +41,14 @@ twofish_get_info( int algo, size_t *keylen,
|
|||||||
void (**decryptf)( void *c, byte *outbuf, byte *inbuf )
|
void (**decryptf)( void *c, byte *outbuf, byte *inbuf )
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* this is just a kludge for the time we have not yet chnaged the cipher
|
||||||
|
* stuff to the scheme we use for random and digests */
|
||||||
|
const char *
|
||||||
|
rijndael_get_info( int algo, size_t *keylen,
|
||||||
|
size_t *blocksize, size_t *contextsize,
|
||||||
|
int (**setkeyf)( void *c, byte *key, unsigned keylen ),
|
||||||
|
void (**encryptf)( void *c, byte *outbuf, byte *inbuf ),
|
||||||
|
void (**decryptf)( void *c, byte *outbuf, byte *inbuf )
|
||||||
|
);
|
||||||
|
|
||||||
#endif /*G10_BLOWFISH_H*/
|
#endif /*G10_BLOWFISH_H*/
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define MAX_BLOCKSIZE 16
|
#define MAX_BLOCKSIZE 16
|
||||||
#define TABLE_SIZE 10
|
#define TABLE_SIZE 14
|
||||||
|
|
||||||
struct cipher_table_s {
|
struct cipher_table_s {
|
||||||
const char *name;
|
const char *name;
|
||||||
@ -84,6 +84,39 @@ setup_cipher_table(void)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
cipher_table[i].algo = CIPHER_ALGO_RIJNDAEL;
|
||||||
|
cipher_table[i].name = rijndael_get_info( cipher_table[i].algo,
|
||||||
|
&cipher_table[i].keylen,
|
||||||
|
&cipher_table[i].blocksize,
|
||||||
|
&cipher_table[i].contextsize,
|
||||||
|
&cipher_table[i].setkey,
|
||||||
|
&cipher_table[i].encrypt,
|
||||||
|
&cipher_table[i].decrypt );
|
||||||
|
if( !cipher_table[i].name )
|
||||||
|
BUG();
|
||||||
|
i++;
|
||||||
|
cipher_table[i].algo = CIPHER_ALGO_RIJNDAEL192;
|
||||||
|
cipher_table[i].name = rijndael_get_info( cipher_table[i].algo,
|
||||||
|
&cipher_table[i].keylen,
|
||||||
|
&cipher_table[i].blocksize,
|
||||||
|
&cipher_table[i].contextsize,
|
||||||
|
&cipher_table[i].setkey,
|
||||||
|
&cipher_table[i].encrypt,
|
||||||
|
&cipher_table[i].decrypt );
|
||||||
|
if( !cipher_table[i].name )
|
||||||
|
BUG();
|
||||||
|
i++;
|
||||||
|
cipher_table[i].algo = CIPHER_ALGO_RIJNDAEL256;
|
||||||
|
cipher_table[i].name = rijndael_get_info( cipher_table[i].algo,
|
||||||
|
&cipher_table[i].keylen,
|
||||||
|
&cipher_table[i].blocksize,
|
||||||
|
&cipher_table[i].contextsize,
|
||||||
|
&cipher_table[i].setkey,
|
||||||
|
&cipher_table[i].encrypt,
|
||||||
|
&cipher_table[i].decrypt );
|
||||||
|
if( !cipher_table[i].name )
|
||||||
|
BUG();
|
||||||
|
i++;
|
||||||
cipher_table[i].algo = CIPHER_ALGO_TWOFISH;
|
cipher_table[i].algo = CIPHER_ALGO_TWOFISH;
|
||||||
cipher_table[i].name = twofish_get_info( cipher_table[i].algo,
|
cipher_table[i].name = twofish_get_info( cipher_table[i].algo,
|
||||||
&cipher_table[i].keylen,
|
&cipher_table[i].keylen,
|
||||||
|
@ -39,7 +39,8 @@
|
|||||||
#include <string.h> /* for memcmp() */
|
#include <string.h> /* for memcmp() */
|
||||||
|
|
||||||
#include "types.h" /* for byte and u32 typedefs */
|
#include "types.h" /* for byte and u32 typedefs */
|
||||||
#include "g10lib.h"
|
#include "util.h"
|
||||||
|
#include "errors.h"
|
||||||
#include "dynload.h"
|
#include "dynload.h"
|
||||||
|
|
||||||
#define MAXKC (256/32)
|
#define MAXKC (256/32)
|
||||||
@ -1726,7 +1727,7 @@ rijndael_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
|
|||||||
fprintf(stderr, "%s\n", selftest_failed );
|
fprintf(stderr, "%s\n", selftest_failed );
|
||||||
}
|
}
|
||||||
if( selftest_failed )
|
if( selftest_failed )
|
||||||
return GCRYERR_SELFTEST;
|
return G10ERR_SELFTEST_FAILED;
|
||||||
|
|
||||||
if( keylen == 128/8 ) {
|
if( keylen == 128/8 ) {
|
||||||
ROUNDS = 10;
|
ROUNDS = 10;
|
||||||
@ -1741,7 +1742,7 @@ rijndael_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen)
|
|||||||
KC = 8;
|
KC = 8;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return GCRYERR_INV_KEYLEN;
|
return G10ERR_WRONG_KEYLEN;
|
||||||
|
|
||||||
ctx->ROUNDS = ROUNDS;
|
ctx->ROUNDS = ROUNDS;
|
||||||
ctx->decryption_prepared = 0;
|
ctx->decryption_prepared = 0;
|
||||||
@ -2121,9 +2122,8 @@ rijndael_get_info (int algo, size_t *keylen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef IS_MODULE
|
#ifdef IS_MODULE
|
||||||
static
|
static
|
||||||
#endif
|
|
||||||
const char * const gnupgext_version = "RIJNDAEL ($Revision$)";
|
const char * const gnupgext_version = "RIJNDAEL ($Revision$)";
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
@ -2155,9 +2155,7 @@ static struct {
|
|||||||
* version = interface version of the function/pointer
|
* version = interface version of the function/pointer
|
||||||
* (currently this is 1 for all functions)
|
* (currently this is 1 for all functions)
|
||||||
*/
|
*/
|
||||||
#ifndef IS_MODULE
|
|
||||||
static
|
static
|
||||||
#endif
|
|
||||||
void *
|
void *
|
||||||
gnupgext_enum_func ( int what, int *sequence, int *class, int *vers )
|
gnupgext_enum_func ( int what, int *sequence, int *class, int *vers )
|
||||||
{
|
{
|
||||||
@ -2186,7 +2184,7 @@ gnupgext_enum_func ( int what, int *sequence, int *class, int *vers )
|
|||||||
*sequence = i;
|
*sequence = i;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2000-10-12 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* keygen.c (keygen_add_std_prefs): Add Rijndael to the prefs.
|
||||||
|
|
||||||
2000-10-07 Werner Koch <wk@gnupg.org>
|
2000-10-07 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
* gpgv.c: Add more stubs for ununsed code to make the binary smaller.
|
* gpgv.c: Add more stubs for ununsed code to make the binary smaller.
|
||||||
|
@ -135,10 +135,11 @@ keygen_add_std_prefs( PKT_signature *sig, void *opaque )
|
|||||||
|
|
||||||
keygen_add_key_expire( sig, opaque );
|
keygen_add_key_expire( sig, opaque );
|
||||||
|
|
||||||
buf[0] = CIPHER_ALGO_TWOFISH;
|
buf[0] = CIPHER_ALGO_RIJNDAEL;
|
||||||
buf[1] = CIPHER_ALGO_CAST5;
|
buf[1] = CIPHER_ALGO_TWOFISH;
|
||||||
buf[2] = CIPHER_ALGO_BLOWFISH;
|
buf[2] = CIPHER_ALGO_CAST5;
|
||||||
build_sig_subpkt( sig, SIGSUBPKT_PREF_SYM, buf, 3 );
|
buf[3] = CIPHER_ALGO_BLOWFISH;
|
||||||
|
build_sig_subpkt( sig, SIGSUBPKT_PREF_SYM, buf, 4 );
|
||||||
|
|
||||||
buf[0] = DIGEST_ALGO_RMD160;
|
buf[0] = DIGEST_ALGO_RMD160;
|
||||||
buf[1] = DIGEST_ALGO_SHA1;
|
buf[1] = DIGEST_ALGO_SHA1;
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2000-10-12 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* mpi.h: Changed the way mpi_limb_t is defined.
|
||||||
|
|
||||||
Wed Sep 6 17:55:47 CEST 2000 Werner Koch <wk@openit.de>
|
Wed Sep 6 17:55:47 CEST 2000 Werner Koch <wk@openit.de>
|
||||||
|
|
||||||
* iobuf.c (IOBUF_FILELENGTH_LIMIT): New.
|
* iobuf.c (IOBUF_FILELENGTH_LIMIT): New.
|
||||||
|
@ -33,6 +33,9 @@
|
|||||||
#define CIPHER_ALGO_BLOWFISH 4 /* blowfish 128 bit key */
|
#define CIPHER_ALGO_BLOWFISH 4 /* blowfish 128 bit key */
|
||||||
#define CIPHER_ALGO_SAFER_SK128 5
|
#define CIPHER_ALGO_SAFER_SK128 5
|
||||||
#define CIPHER_ALGO_DES_SK 6
|
#define CIPHER_ALGO_DES_SK 6
|
||||||
|
#define CIPHER_ALGO_RIJNDAEL 7
|
||||||
|
#define CIPHER_ALGO_RIJNDAEL192 8
|
||||||
|
#define CIPHER_ALGO_RIJNDAEL256 9
|
||||||
#define CIPHER_ALGO_TWOFISH 10 /* twofish 256 bit */
|
#define CIPHER_ALGO_TWOFISH 10 /* twofish 256 bit */
|
||||||
#define CIPHER_ALGO_SKIPJACK 101 /* experimental: skipjack */
|
#define CIPHER_ALGO_SKIPJACK 101 /* experimental: skipjack */
|
||||||
#define CIPHER_ALGO_TWOFISH_OLD 102 /* experimental: twofish 128 bit */
|
#define CIPHER_ALGO_TWOFISH_OLD 102 /* experimental: twofish 128 bit */
|
||||||
|
@ -29,20 +29,34 @@
|
|||||||
#ifndef G10_MPI_H
|
#ifndef G10_MPI_H
|
||||||
#define G10_MPI_H
|
#define G10_MPI_H
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "iobuf.h"
|
#include "iobuf.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "../mpi/mpi-asm-defs.h"
|
||||||
|
|
||||||
|
#if BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_INT
|
||||||
|
typedef unsigned int mpi_limb_t;
|
||||||
|
typedef signed int mpi_limb_signed_t;
|
||||||
|
#elif BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_LONG
|
||||||
|
typedef unsigned long int mpi_limb_t;
|
||||||
|
typedef signed long int mpi_limb_signed_t;
|
||||||
|
#elif BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_LONG_LONG
|
||||||
|
typedef unsigned long long int mpi_limb_t;
|
||||||
|
typedef signed long long int mpi_limb_signed_t;
|
||||||
|
#elif BYTES_PER_MPI_LIMB == SIZEOF_UNSIGNED_SHORT
|
||||||
|
typedef unsigned short int mpi_limb_t;
|
||||||
|
typedef signed short int mpi_limb_signed_t;
|
||||||
|
#else
|
||||||
|
#error BYTES_PER_MPI_LIMB does not match any C type
|
||||||
|
#endif
|
||||||
|
#define BITS_PER_MPI_LIMB (8*BYTES_PER_MPI_LIMB)
|
||||||
|
|
||||||
|
|
||||||
#define DBG_MPI mpi_debug_mode
|
#define DBG_MPI mpi_debug_mode
|
||||||
int mpi_debug_mode;
|
int mpi_debug_mode;
|
||||||
|
|
||||||
#define BITS_PER_MPI_LIMB (8*SIZEOF_UNSIGNED_LONG)
|
|
||||||
#define BYTES_PER_MPI_LIMB SIZEOF_UNSIGNED_LONG
|
|
||||||
typedef unsigned long int mpi_limb_t;
|
|
||||||
typedef signed long int mpi_limb_signed_t;
|
|
||||||
|
|
||||||
struct gcry_mpi {
|
struct gcry_mpi {
|
||||||
int alloced; /* array size (# of allocated limbs) */
|
int alloced; /* array size (# of allocated limbs) */
|
||||||
int nlimbs; /* number of valid limbs */
|
int nlimbs; /* number of valid limbs */
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2000-10-12 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* generic/mpi-asm-defs.h: New.
|
||||||
|
* mips3/mpi-asm-defs.h: New.
|
||||||
|
* config.links: Create a link to one of the above files.
|
||||||
|
|
||||||
Wed Jul 19 11:26:43 CEST 2000 Werner Koch <wk@>
|
Wed Jul 19 11:26:43 CEST 2000 Werner Koch <wk@>
|
||||||
|
|
||||||
* config.links: Support for powerpc--netbsd by Gabriel Rosenkoetter.
|
* config.links: Support for powerpc--netbsd by Gabriel Rosenkoetter.
|
||||||
|
@ -277,3 +277,13 @@ for fn in $mpi_ln_modules ; do
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Same thing for the file which defines the limb size
|
||||||
|
path="$path generic"
|
||||||
|
for dir in $path ; do
|
||||||
|
rm -f $srcdir/mpi/mpi-asm-defs.h
|
||||||
|
if test -f $srcdir/mpi/$dir/mpi-asm-defs.h ; then
|
||||||
|
mpi_ln_src="$mpi_ln_src mpi/$dir/mpi-asm-defs.h"
|
||||||
|
mpi_ln_dst="$mpi_ln_dst mpi/mpi-asm-defs.h"
|
||||||
|
break;
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
@ -6,4 +6,5 @@ mpih-lshift.c
|
|||||||
mpih-rshift.c
|
mpih-rshift.c
|
||||||
mpih-sub1.c
|
mpih-sub1.c
|
||||||
udiv-w-sdiv.c
|
udiv-w-sdiv.c
|
||||||
|
mpi-asm-defs.h
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/* This file defines some basic constants for the MPI machinery. We
|
/* This file defines some basic constants for the MPI machinery. We
|
||||||
* need to define the types on a per-CPU basis, so it is done with
|
* need to define the types on a per-CPU basis, so it is done with
|
||||||
* this file here. */
|
* this file here. */
|
||||||
#define BYTES_PER_MPI_LIMB (sizeof unsigned long)
|
#define BYTES_PER_MPI_LIMB (SIZEOF_UNSIGNED_LONG)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,4 +6,5 @@ mpih-mul2.S
|
|||||||
mpih-mul3.S
|
mpih-mul3.S
|
||||||
mpih-lshift.S
|
mpih-lshift.S
|
||||||
mpih-rshift.S
|
mpih-rshift.S
|
||||||
|
mpi-asm-defs.h
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user