aboutsummaryrefslogtreecommitdiffstats
path: root/include/cipher.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-01-07 17:05:48 +0000
committerWerner Koch <[email protected]>1999-01-07 17:05:48 +0000
commit7d0efec7cf5ae110c99511abc32587ff0c45b14f (patch)
treec25f43c0b175ca31c84da4e9a256b259ea070fc7 /include/cipher.h
parentSee ChangeLog: Sun Jan 3 15:28:44 CET 1999 Werner Koch (diff)
downloadgnupg-7d0efec7cf5ae110c99511abc32587ff0c45b14f.tar.gz
gnupg-7d0efec7cf5ae110c99511abc32587ff0c45b14f.zip
See ChangeLog: Thu Jan 7 18:00:58 CET 1999 Werner Koch
Diffstat (limited to 'include/cipher.h')
-rw-r--r--include/cipher.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/include/cipher.h b/include/cipher.h
index 38050efa5..9cd5b5f3c 100644
--- a/include/cipher.h
+++ b/include/cipher.h
@@ -75,15 +75,13 @@ struct cipher_handle_s { char does_not_matter[1]; };
#define CIPHER_MODE_AUTO_CFB 4
#define CIPHER_MODE_DUMMY 5 /* used with algo DUMMY for no encryption */
-
-#define MD_BUFFER_SIZE 512
-
typedef struct {
- byte buffer[MD_BUFFER_SIZE];
- int bufcount;
int secure;
FILE *debug;
struct md_digest_list_s *list;
+ int bufcount;
+ int bufsize;
+ byte buffer[1];
} *MD_HANDLE;
@@ -118,9 +116,9 @@ const byte *md_asn_oid( int algo, size_t *asnlen, size_t *mdlen );
void md_start_debug( MD_HANDLE a, const char *suffix );
void md_stop_debug( MD_HANDLE a );
#define md_is_secure(a) ((a)->secure)
-#define md_putc(h,c) \
+#define md_putc(h,c) \
do { \
- if( (h)->bufcount == MD_BUFFER_SIZE ) \
+ if( (h)->bufcount == (h)->bufsize ) \
md_write( (h), NULL, 0 ); \
(h)->buffer[(h)->bufcount++] = (c) & 0xff; \
} while(0)