mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
See ChangeLog: Fri Jan 14 18:32:01 CET 2000 Werner Koch
This commit is contained in:
parent
e8164f20ab
commit
932049cbe4
25 changed files with 249 additions and 65 deletions
|
@ -1,3 +1,15 @@
|
|||
Fri Jan 14 18:32:01 CET 2000 Werner Koch <wk@gnupg.de>
|
||||
|
||||
* rmd160.c (rmd160_get_info): Moved casting to the left side due to a
|
||||
problem with UTS4.3. Suggested by Dave Dykstra.
|
||||
* sha1.c (sha1_get_info): Ditto.
|
||||
* tiger.c (tiger_get_info): Ditto.
|
||||
* md5.c (md5_get_info): Ditto
|
||||
* des.c (des_get_info): Ditto.
|
||||
* blowfish.c (blowfish_get_info): Ditto.
|
||||
* cast5.c (cast5_get_info): Ditto.
|
||||
* twofish.c (twofish_get_info): Ditto.
|
||||
|
||||
Thu Jan 13 19:31:58 CET 2000 Werner Koch <wk@gnupg.de>
|
||||
|
||||
* elgamal.c (wiener_map): New.
|
||||
|
@ -5,7 +17,7 @@ Thu Jan 13 19:31:58 CET 2000 Werner Koch <wk@gnupg.de>
|
|||
(generate): Calculate the qbits using the wiener map and
|
||||
choose an x at a size comparable to the one choosen in gen_k
|
||||
|
||||
* random.c (read_pool): Print a more friendly erro message in
|
||||
* random.c (read_pool): Print a more friendly error message in
|
||||
cases when too much random is requested in one call.
|
||||
|
||||
* Makefile.am (tiger): Replaced -O1 by -O. Suggested by Alec Habig.
|
||||
|
|
|
@ -43,9 +43,6 @@
|
|||
|
||||
#define CIPHER_ALGO_BLOWFISH 4 /* blowfish 128 bit key */
|
||||
|
||||
#define FNCCAST_SETKEY(f) (int(*)(void*, byte*, unsigned))(f)
|
||||
#define FNCCAST_CRYPT(f) (void(*)(void*, byte*, byte*))(f)
|
||||
|
||||
#define BLOWFISH_BLOCKSIZE 8
|
||||
#define BLOWFISH_ROUNDS 16
|
||||
|
||||
|
@ -584,9 +581,12 @@ blowfish_get_info( int algo, size_t *keylen,
|
|||
*keylen = 128;
|
||||
*blocksize = BLOWFISH_BLOCKSIZE;
|
||||
*contextsize = sizeof(BLOWFISH_context);
|
||||
*r_setkey = FNCCAST_SETKEY(bf_setkey);
|
||||
*r_encrypt= FNCCAST_CRYPT(encrypt_block);
|
||||
*r_decrypt= FNCCAST_CRYPT(decrypt_block);
|
||||
*(int (**)(BLOWFISH_context*, byte*, unsigned))r_setkey
|
||||
= bf_setkey;
|
||||
*(void (**)(BLOWFISH_context*, byte*, byte*))r_encrypt
|
||||
= encrypt_block;
|
||||
*(void (**)(BLOWFISH_context*, byte*, byte*))r_decrypt
|
||||
= decrypt_block;
|
||||
|
||||
if( algo == CIPHER_ALGO_BLOWFISH )
|
||||
return "BLOWFISH";
|
||||
|
|
|
@ -46,9 +46,6 @@
|
|||
|
||||
#define CIPHER_ALGO_CAST5 3
|
||||
|
||||
#define FNCCAST_SETKEY(f) (int(*)(void*, byte*, unsigned))(f)
|
||||
#define FNCCAST_CRYPT(f) (void(*)(void*, byte*, byte*))(f)
|
||||
|
||||
#define CAST5_BLOCKSIZE 8
|
||||
|
||||
typedef struct {
|
||||
|
@ -610,9 +607,13 @@ cast5_get_info( int algo, size_t *keylen,
|
|||
*keylen = 128;
|
||||
*blocksize = CAST5_BLOCKSIZE;
|
||||
*contextsize = sizeof(CAST5_context);
|
||||
*r_setkey = FNCCAST_SETKEY(cast_setkey);
|
||||
*r_encrypt= FNCCAST_CRYPT(encrypt_block);
|
||||
*r_decrypt= FNCCAST_CRYPT(decrypt_block);
|
||||
*(int (**)(CAST5_context*, byte*, unsigned))r_setkey
|
||||
= cast_setkey;
|
||||
*(void (**)(CAST5_context*, byte*, byte*))r_encrypt
|
||||
= encrypt_block;
|
||||
*(void (**)(CAST5_context*, byte*, byte*))r_decrypt
|
||||
= decrypt_block;
|
||||
|
||||
|
||||
if( algo == CIPHER_ALGO_CAST5 )
|
||||
return "CAST5";
|
||||
|
|
13
cipher/des.c
13
cipher/des.c
|
@ -147,9 +147,6 @@ working_memcmp( const char *a, const char *b, size_t n )
|
|||
#endif
|
||||
|
||||
|
||||
/* Macros used by the info function. */
|
||||
#define FNCCAST_SETKEY(f) ((int(*)(void*, byte*, unsigned))(f))
|
||||
#define FNCCAST_CRYPT(f) ((void(*)(void*, byte*, byte*))(f))
|
||||
|
||||
|
||||
/*
|
||||
|
@ -996,14 +993,16 @@ des_get_info( int algo, size_t *keylen,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if( algo == CIPHER_ALGO_3DES ) {
|
||||
*keylen = 192;
|
||||
*blocksize = 8;
|
||||
*contextsize = sizeof(struct _tripledes_ctx);
|
||||
*r_setkey = FNCCAST_SETKEY(do_tripledes_setkey);
|
||||
*r_encrypt= FNCCAST_CRYPT(do_tripledes_encrypt);
|
||||
*r_decrypt= FNCCAST_CRYPT(do_tripledes_decrypt);
|
||||
*(int (**)(struct _tripledes_ctx*, byte*, unsigned))r_setkey
|
||||
= do_tripledes_setkey;
|
||||
*(void (**)(struct _tripledes_ctx*, byte*, byte*))r_encrypt
|
||||
= do_tripledes_encrypt;
|
||||
*(void (**)(struct _tripledes_ctx*, byte*, byte*))r_decrypt
|
||||
= do_tripledes_decrypt;
|
||||
return "3DES";
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
@ -344,10 +344,10 @@ md5_get_info( int algo, size_t *contextsize,
|
|||
*r_asnoid = asn;
|
||||
*r_asnlen = DIM(asn);
|
||||
*r_mdlen = 16;
|
||||
*r_init = (void (*)(void *))md5_init;
|
||||
*r_write = (void (*)(void *, byte*, size_t))md5_write;
|
||||
*r_final = (void (*)(void *))md5_final;
|
||||
*r_read = (byte *(*)(void *))md5_read;
|
||||
*(void (**)(MD5_CONTEXT *))r_init = md5_init;
|
||||
*(void (**)(MD5_CONTEXT *, byte*, size_t))r_write = md5_write;
|
||||
*(void (**)(MD5_CONTEXT *))r_final = md5_final;
|
||||
*(byte *(**)(MD5_CONTEXT *))r_read = md5_read;
|
||||
|
||||
return "MD5";
|
||||
}
|
||||
|
|
|
@ -562,10 +562,10 @@ rmd160_get_info( int algo, size_t *contextsize,
|
|||
*r_asnoid = asn;
|
||||
*r_asnlen = DIM(asn);
|
||||
*r_mdlen = 20;
|
||||
*r_init = (void (*)(void *))rmd160_init;
|
||||
*r_write = (void (*)(void *, byte*, size_t))rmd160_write;
|
||||
*r_final = (void (*)(void *))rmd160_final;
|
||||
*r_read = (byte *(*)(void *))rmd160_read;
|
||||
*(void (**)(RMD160_CONTEXT *))r_init = rmd160_init;
|
||||
*(void (**)(RMD160_CONTEXT *, byte*, size_t))r_write = rmd160_write;
|
||||
*(void (**)(RMD160_CONTEXT *))r_final = rmd160_final;
|
||||
*(byte *(**)(RMD160_CONTEXT *))r_read = rmd160_read;
|
||||
|
||||
return "RIPEMD160";
|
||||
}
|
||||
|
|
|
@ -341,6 +341,10 @@ sha1_get_info( int algo, size_t *contextsize,
|
|||
*r_write = (void (*)(void *, byte*, size_t))sha1_write;
|
||||
*r_final = (void (*)(void *))sha1_final;
|
||||
*r_read = (byte *(*)(void *))sha1_read;
|
||||
*(void (**)(SHA1_CONTEXT *))r_init = sha1_init;
|
||||
*(void (**)(SHA1_CONTEXT *, byte*, size_t))r_write = sha1_write;
|
||||
*(void (**)(SHA1_CONTEXT *))r_final = sha1_final;
|
||||
*(byte *(**)(SHA1_CONTEXT *))r_read = sha1_read;
|
||||
|
||||
return "SHA1";
|
||||
}
|
||||
|
|
|
@ -899,10 +899,10 @@ tiger_get_info( int algo, size_t *contextsize,
|
|||
*r_asnoid = asn;
|
||||
*r_asnlen = DIM(asn);
|
||||
*r_mdlen = 24;
|
||||
*r_init = (void (*)(void *))tiger_init;
|
||||
*r_write = (void (*)(void *, byte*, size_t))tiger_write;
|
||||
*r_final = (void (*)(void *))tiger_final;
|
||||
*r_read = (byte *(*)(void *))tiger_read;
|
||||
*(void (**)(TIGER_CONTEXT *))r_init = tiger_init;
|
||||
*(void (**)(TIGER_CONTEXT *, byte*, size_t))r_write = tiger_write;
|
||||
*(void (**)(TIGER_CONTEXT *))r_final = tiger_final;
|
||||
*(byte *(**)(TIGER_CONTEXT *))r_read = tiger_read;
|
||||
|
||||
return "TIGER";
|
||||
}
|
||||
|
|
|
@ -35,10 +35,6 @@
|
|||
/* Prototype for the self-test function. */
|
||||
static const char *selftest(void);
|
||||
|
||||
/* Macros used by the info function. */
|
||||
#define FNCCAST_SETKEY(f) ((int(*)(void*, byte*, unsigned))(f))
|
||||
#define FNCCAST_CRYPT(f) ((void(*)(void*, byte*, byte*))(f))
|
||||
|
||||
/* Structure for an expanded Twofish key. s contains the key-dependent
|
||||
* S-boxes composed with the MDS matrix; w contains the eight "whitening"
|
||||
* subkeys, K[0] through K[7]. k holds the remaining, "round" subkeys. Note
|
||||
|
@ -991,16 +987,19 @@ twofish_get_info (int algo, size_t *keylen,
|
|||
*keylen = algo==10? 256 : 128;
|
||||
*blocksize = 16;
|
||||
*contextsize = sizeof (TWOFISH_context);
|
||||
*r_setkey = FNCCAST_SETKEY (twofish_setkey);
|
||||
*r_encrypt= FNCCAST_CRYPT (twofish_encrypt);
|
||||
*r_decrypt= FNCCAST_CRYPT (twofish_decrypt);
|
||||
*(int (**)(const TWOFISH_context*, byte*, unsigned))r_setkey
|
||||
= twofish_setkey;
|
||||
*(void (**)(const TWOFISH_context*, byte*, byte*))r_encrypt
|
||||
= twofish_encrypt;
|
||||
*(void (**)(const TWOFISH_context*, byte*, byte*))r_decrypt
|
||||
= twofish_decrypt;
|
||||
|
||||
if( algo == 10 )
|
||||
return "TWOFISH";
|
||||
if (algo == 102) /* This algorithm number is assigned for
|
||||
* experiments, so we can use it */
|
||||
return "TWOFISH128";
|
||||
return NULL;
|
||||
if( algo == 10 )
|
||||
return "TWOFISH";
|
||||
if (algo == 102) /* This algorithm number is assigned for
|
||||
* experiments, so we can use it */
|
||||
return "TWOFISH128";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue