From e8e6125e9264312aff804ab8684c2dd702eeba6c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 8 Feb 2000 12:34:10 +0000 Subject: [PATCH] Started with gcrypt manual --- doc/gcryptref-cipher.sgml | 242 ++++++++++++++++++++++++++++++++++++++ doc/gcryptref-digest.sgml | 191 ++++++++++++++++++++++++++++++ doc/gcryptref-misc.sgml | 20 ++++ doc/gcryptref-pubkey.sgml | 20 ++++ doc/gcryptref.sgml | 76 ++++++++++++ 5 files changed, 549 insertions(+) create mode 100644 doc/gcryptref-cipher.sgml create mode 100644 doc/gcryptref-digest.sgml create mode 100644 doc/gcryptref-misc.sgml create mode 100644 doc/gcryptref-pubkey.sgml create mode 100644 doc/gcryptref.sgml diff --git a/doc/gcryptref-cipher.sgml b/doc/gcryptref-cipher.sgml new file mode 100644 index 000000000..1253b38f3 --- /dev/null +++ b/doc/gcryptref-cipher.sgml @@ -0,0 +1,242 @@ + + + + + gcry_cipher_open + gcry_cipher_close + create and destroy an encryption context + + + + + + #include <gcrypt.h> + + + GCRY_CIPHER_HD gcry_cipher_open + int algo + int mode + unsigned in flags + + + void gcry_cipher_close + GCRY_CIPHER_HD h + + + + + + Description + + cipher functions + gcry_cipher_open + gcry_cipher_close + + gcry_cipher_open creates the context required for + most of the cipher functions. + + + + + + + gcry_cipher_ctl + gcry_cipher_setkey + gcry_cipher_setiv + gcry_cipher_setiv + control cipher functions + + + + + + #include <gcrypt.h> + + + int gcry_cipher_ctl + GCRY_CIPHER_HD h + int cmd + void *buffer + size_t buflen + + + + + + Description + + cipher functions + gcry_cipher_ctl + + gcry_cipher_ctl controls various aspects of the + cipher module and specific cipher contexts. A couple of macros may + be used for convenience: + + gcry_cipher_setkey(h,k,l) + gcry_cipher_setiv(h,k,l) + gcry_cipher_sync(h) + + + + + + + + gcry_cipher_info + return information about a cipher context + + + + + + #include <gcrypt.h> + + + int gcry_cipher_info + GCRY_CIPHER_HD h + int what + + + + + + Description + + cipher functions + gcry_cipher_info + + gcry_cipher_info is used to retrieve various + information about a cipher context or the cipher module in general. + Currently no information is available. + + + + + + + gcry_cipher_algo_name + return the name of a cipher algorithm + + + + + + #include <gcrypt.h> + + + const char *gcry_cipher_algo_name + int algo + + + + + + Description + + cipher functions + gcry_cipher_algo_name + + gcry_cipher_algo_name returns a string with the + name of the cipher algorithm algo. If the algorithm + is not known or an other error occured, an empty string is return. This + function will never return NULL. + + + + + + gcry_cipher_map_name + return an algorithm identifier for string + + + + + + #include <gcrypt.h> + + + int gcry_cipher_map_name + const char *name + + + + + + Description + + cipher functions + gcry_cipher_map_name + + gcry_cipher_map_name returns the algorithm identifier + for the cipher algorithm described by the string name. + If this algorith is not available 0 is returned. + + + + + + + gcry_cipher_encrypt + gcry_cipher_decrypt + encrypt data or decrypt data + + + + + + #include <gcrypt.h> + + + int gcry_cipher_encrypt + GCRY_CIPHER_HD h + unsigned char out + size_t outsize + unsigned char in + size_t insize + + + int gcry_cipher_decrypt + GCRY_CIPHER_HD h + unsigned char out + size_t outsize + unsigned char in + size_t insize + + + + + + Description + + cipher functions + gcry_cipher_encrypt + gcry_cipher_decrypt + + gcry_cipher_encrypt is used to encrypt the data. + the complemetary function gcry_cipher_decrypt is + be used to decrypt the data. The calling convention for both functions + is the same. + + These functions can either work in place or with two buffers. + Overlapping buffers are not allowed. + + + diff --git a/doc/gcryptref-digest.sgml b/doc/gcryptref-digest.sgml new file mode 100644 index 000000000..63a345a73 --- /dev/null +++ b/doc/gcryptref-digest.sgml @@ -0,0 +1,191 @@ + + + + + gcry_md_open + gcry_md_enable + gcry_md_close + create and destroy a message digest context + + + + + + #include <gcrypt.h> + + + GCRY_MD_HD gcry_md_open + int algo + unsigned int flags + + + void gcry_md_enable + GCRY_MD_HD h + int algo + + + void gcry_md_close + GCRY_MD_HD h + + + + + + Description + + hash functions + gcry_md_open + gcry_md_enable + gcry_md_close + + gcry_md_open creates the context required for + the message digest functions. The hash algorithm may optionally be + specified. + gcry_md_close releases all resources associated + with the context. + gcry_md_enable may be used to enable hash + algorithms. This function may be used multiple times to create + a hash context for multiple algorithms. Adding an already enabled algorithm + has no effect. A algorithm must be enabled prios to calculate hash + algorithms. + + + + + + gcry_md_copy + create and copy of a message digest context + + + + + + #include <gcrypt.h> + + + GCRY_MD_HD gcry_md_copy + GCRY_MD_HD h + + + + + + Description + + hash functions + gcry_md_copy + + gcry_md_copy creates an excat copy of the given context. + This is useful to calculate hashes with a common initial part of the + plaintext. + + + + + + gcry_md_reset + reset a message digest context + + + + + + #include <gcrypt.h> + + + void gcry_md_reset + GCRY_MD_HD h + + + + + + Description + + hash functions + gcry_md_reset + + gcry_md_reset is used to reuse a message context + without the overhead of an open and close operation. + + + + + + gcry_md_ctl + perform special operations on a digest context + + + + + + #include <gcrypt.h> + + + int gcry_md_ctl + GCRY_MD_HD h + int cmd + unsigned char * buffer + size_t buflen + + + + + + Description + + hash functions + gcry_md_ctl + + gcry_md_ctl is a multi-purpose function + to control the behaviour of all gcry_md functions or one instance + of it. + + + + +void gcry_md_write( GCRY_MD_HD hd, const byte *buffer, size_t length); +byte *gcry_md_read( GCRY_MD_HD hd, int algo ); +void gcry_md_hash_buffer( int algo, char *digest, + const char *buffer, size_t length); +int gcry_md_get_algo( GCRY_MD_HD hd ); +unsigned int gcry_md_get_algo_dlen( int algo ); +int gcry_md_info( GCRY_MD_HD h, int what, void *buffer, size_t *nbytes); +int gcry_md_algo_info( int algo, int what, void *buffer, size_t *nbytes); +const char *gcry_md_algo_name( int algo ); +int gcry_md_map_name( const char* name ); + +#define gcry_md_putc(h,c) \ + do { \ + if( (h)->bufpos == (h)->bufsize ) \ + gcry_md_write( (h), NULL, 0 ); \ + (h)->buf[(h)->bufpos++] = (c) & 0xff; \ + } while(0) + +#define gcry_md_final(a) \ + gcry_md_ctl( (a), GCRYCTL_FINALIZE, NULL, 0 ) + +#define gcry_md_is_secure(a) \ + gcry_md_info( (a), GCRYCTL_IS_SECURE, NULL, NULL ) + +#define gcry_md_test_algo(a) \ + gcry_md_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL ) + diff --git a/doc/gcryptref-misc.sgml b/doc/gcryptref-misc.sgml new file mode 100644 index 000000000..881931869 --- /dev/null +++ b/doc/gcryptref-misc.sgml @@ -0,0 +1,20 @@ + + diff --git a/doc/gcryptref-pubkey.sgml b/doc/gcryptref-pubkey.sgml new file mode 100644 index 000000000..881931869 --- /dev/null +++ b/doc/gcryptref-pubkey.sgml @@ -0,0 +1,20 @@ + + diff --git a/doc/gcryptref.sgml b/doc/gcryptref.sgml new file mode 100644 index 000000000..6161e8610 --- /dev/null +++ b/doc/gcryptref.sgml @@ -0,0 +1,76 @@ + + + + + + + +]> + + + + +&libgcrypt; Reference Pages + +Symmetric Cipher Functions +&cipherref; + +Hash Functions +&digestref; + +Public Key Functions +&pubkeyref; + + +Miscellaneous Functions +&miscref; + + +