[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gc: add forgotten prototypes
From: |
Simon Josefsson |
Subject: |
gc: add forgotten prototypes |
Date: |
Mon, 17 Oct 2005 15:42:48 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
I forgot the prototypes for these earlier. I also ran indent on the
file... I have installed this.
Incidentally, I have now installed this gnulib in GnuTLS and I'm
working out the glitches.
2005-10-17 Simon Josefsson <address@hidden>
* gc.h (gc_nonce, gc_pseudo_random, gc_random): Add prototypes.
Index: lib/gc.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/gc.h,v
retrieving revision 1.11
diff -u -p -r1.11 gc.h
--- lib/gc.h 17 Oct 2005 13:34:58 -0000 1.11
+++ lib/gc.h 17 Oct 2005 13:41:50 -0000
@@ -25,33 +25,33 @@
# include <stddef.h>
enum Gc_rc
- {
- GC_OK = 0,
- GC_MALLOC_ERROR,
- GC_INIT_ERROR,
- GC_RANDOM_ERROR,
- GC_INVALID_CIPHER,
- GC_INVALID_HASH,
- GC_PKCS5_INVALID_ITERATION_COUNT,
- GC_PKCS5_INVALID_DERIVED_KEY_LENGTH,
- GC_PKCS5_DERIVED_KEY_TOO_LONG
- };
+{
+ GC_OK = 0,
+ GC_MALLOC_ERROR,
+ GC_INIT_ERROR,
+ GC_RANDOM_ERROR,
+ GC_INVALID_CIPHER,
+ GC_INVALID_HASH,
+ GC_PKCS5_INVALID_ITERATION_COUNT,
+ GC_PKCS5_INVALID_DERIVED_KEY_LENGTH,
+ GC_PKCS5_DERIVED_KEY_TOO_LONG
+};
typedef enum Gc_rc Gc_rc;
/* Hash types. */
enum Gc_hash
- {
- GC_MD5,
- GC_SHA1,
- GC_MD2,
- GC_RMD160
- };
+{
+ GC_MD5,
+ GC_SHA1,
+ GC_MD2,
+ GC_RMD160
+};
typedef enum Gc_hash Gc_hash;
enum Gc_hash_mode
- {
- GC_HMAC = 1
- };
+{
+ GC_HMAC = 1
+};
typedef enum Gc_hash_mode Gc_hash_mode;
typedef void *gc_hash_handle;
@@ -61,23 +61,23 @@ typedef void *gc_hash_handle;
/* Cipher types. */
enum Gc_cipher
- {
- GC_AES128,
- GC_AES192,
- GC_AES256,
- GC_3DES,
- GC_DES,
- GC_ARCFOUR128,
- GC_ARCFOUR40,
- GC_ARCTWO40
- };
+{
+ GC_AES128,
+ GC_AES192,
+ GC_AES256,
+ GC_3DES,
+ GC_DES,
+ GC_ARCFOUR128,
+ GC_ARCFOUR40,
+ GC_ARCTWO40
+};
typedef enum Gc_cipher Gc_cipher;
enum Gc_cipher_mode
- {
- GC_CBC,
- GC_STREAM
- };
+{
+ GC_CBC,
+ GC_STREAM
+};
typedef enum Gc_cipher_mode Gc_cipher_mode;
typedef void *gc_cipher_handle;
@@ -97,9 +97,14 @@ extern void gc_set_allocators (gc_malloc
gc_realloc_t func_realloc,
gc_free_t func_free);
+/* Randomness. */
+extern Gc_rc gc_nonce (char *data, size_t datalen);
+extern Gc_rc gc_pseudo_random (char *data, size_t datalen);
+extern Gc_rc gc_random (char *data, size_t datalen);
+
/* Ciphers. */
extern Gc_rc gc_cipher_open (Gc_cipher cipher, Gc_cipher_mode mode,
- gc_cipher_handle * outhandle);
+ gc_cipher_handle *outhandle);
extern Gc_rc gc_cipher_setkey (gc_cipher_handle handle,
size_t keylen, const char *key);
extern Gc_rc gc_cipher_setiv (gc_cipher_handle handle,
@@ -113,8 +118,8 @@ extern Gc_rc gc_cipher_close (gc_cipher_
/* Hashes. */
extern Gc_rc gc_hash_open (Gc_hash hash, Gc_hash_mode mode,
- gc_hash_handle * outhandle);
-extern Gc_rc gc_hash_clone (gc_hash_handle handle, gc_hash_handle * outhandle);
+ gc_hash_handle *outhandle);
+extern Gc_rc gc_hash_clone (gc_hash_handle handle, gc_hash_handle *outhandle);
extern size_t gc_hash_digest_length (Gc_hash hash);
extern void gc_hash_hmac_setkey (gc_hash_handle handle,
size_t len, const char *key);
@@ -136,11 +141,9 @@ gc_hash_buffer (Gc_hash hash, const void
extern Gc_rc gc_md5 (const void *in, size_t inlen, void *resbuf);
extern Gc_rc gc_sha1 (const void *in, size_t inlen, void *resbuf);
extern Gc_rc gc_hmac_md5 (const void *key, size_t keylen,
- const void *in, size_t inlen,
- char *resbuf);
+ const void *in, size_t inlen, char *resbuf);
extern Gc_rc gc_hmac_sha1 (const void *key, size_t keylen,
- const void *in, size_t inlen,
- char *resbuf);
+ const void *in, size_t inlen, char *resbuf);
/* Derive cryptographic keys from a password P of length PLEN, with
salt S of length SLEN, placing the result in pre-allocated buffer
@@ -152,8 +155,7 @@ extern Gc_rc gc_hmac_sha1 (const void *k
extern Gc_rc
gc_pbkdf2_sha1 (const char *P, size_t Plen,
const char *S, size_t Slen,
- unsigned int c,
- char *DK, size_t dkLen);
+ unsigned int c, char *DK, size_t dkLen);
/*
TODO:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gc: add forgotten prototypes,
Simon Josefsson <=