diff options
author | Ulf Möller <ulf@openssl.org> | 2000-02-03 18:22:01 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 2000-02-03 18:22:01 +0000 |
commit | 9dbc41d7eed7d69da54dc81082794845c50ad482 (patch) | |
tree | 3c59e6df13deb5eed99501dc7fffac681fb7e1eb /doc/crypto | |
parent | 82fc1d9c28e834549f61e4c91b3f6bbdf4c48153 (diff) |
Document hash functions.
Diffstat (limited to 'doc/crypto')
-rw-r--r-- | doc/crypto/DSA_generate_parameters.pod | 2 | ||||
-rw-r--r-- | doc/crypto/dsa.pod | 2 | ||||
-rw-r--r-- | doc/crypto/err.pod | 2 | ||||
-rw-r--r-- | doc/crypto/hmac.pod | 75 | ||||
-rw-r--r-- | doc/crypto/md5.pod | 81 | ||||
-rw-r--r-- | doc/crypto/mdc2.pod | 60 | ||||
-rw-r--r-- | doc/crypto/ripemd.pod | 62 | ||||
-rw-r--r-- | doc/crypto/sha.pod | 2 |
8 files changed, 282 insertions, 4 deletions
diff --git a/doc/crypto/DSA_generate_parameters.pod b/doc/crypto/DSA_generate_parameters.pod index 44c38b90c1..c6c0ee374f 100644 --- a/doc/crypto/DSA_generate_parameters.pod +++ b/doc/crypto/DSA_generate_parameters.pod @@ -10,7 +10,7 @@ DSA_generate_parameters - Generate DSA parameters DSA *DSA_generate_parameters(int bits, unsigned char *seed, int seed_len, int *counter_ret, unsigned long *h_ret, - void (*callback)(), void *cb_arg); + void (*callback)(int, int, void *), void *cb_arg); =head1 DESCRIPTION diff --git a/doc/crypto/dsa.pod b/doc/crypto/dsa.pod index e5ae42f5a1..2c09244899 100644 --- a/doc/crypto/dsa.pod +++ b/doc/crypto/dsa.pod @@ -15,7 +15,7 @@ dsa - Digital Signature Algorithm DSA * DSA_generate_parameters(int bits, unsigned char *seed, int seed_len, int *counter_ret, unsigned long *h_ret, - void (*callback)(), void *cb_arg); + void (*callback)(int, int, void *), void *cb_arg); DH * DSA_dup_DH(DSA *r); diff --git a/doc/crypto/err.pod b/doc/crypto/err.pod index 6273a62e15..a74b4eeb41 100644 --- a/doc/crypto/err.pod +++ b/doc/crypto/err.pod @@ -91,7 +91,7 @@ for an appropriate function name, if none is found it just uses the capitalized form such as "SSL23_READ" in the above example. The trailing section of a reason code (after the "_R_") is translated -into lower case and and underscores changed to spaces. +into lower case and underscores changed to spaces. When you are using new function or reason codes, run B<make errors>. The necessary B<#define>s will then automatically be added to the diff --git a/doc/crypto/hmac.pod b/doc/crypto/hmac.pod new file mode 100644 index 0000000000..45b6108c39 --- /dev/null +++ b/doc/crypto/hmac.pod @@ -0,0 +1,75 @@ +=pod + +=head1 NAME + +HMAC, HMAC_Init, HMAC_Update, HMAC_Final - HMAC message authentication code + +=head1 SYNOPSIS + + #include <openssl/hmac.h> + + unsigned char *HMAC(const EVP_MD *evp_md, const void *key, + int key_len, const unsigned char *d, int n, + unsigned char *md, unsigned int *md_len); + + void HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len, + const EVP_MD *md); + void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, int len); + void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); + + void HMAC_cleanup(HMAC_CTX *ctx); + +=head1 DESCRIPTION + +HMAC is a MAC (message authentication code), i.e. a keyed hash +function used for message authentication, which is based on a hash +function. + +HMAC() computes the message authentication code of the B<n> bytes at +B<d> using the hash function B<evp_md> and the key B<key> which is +B<key_len> bytes long. + +It places the result in B<md> (which must have space for the output of +the hash function, which is no more than B<EVP_MAX_MD_SIZE> bytes). +If B<md> is NULL, the digest is placed in a static array. The size of +the output is placed in B<md_len>, unless it is B<NULL>. + +B<evp_md> can be EVP_sha1(), EVP_ripemd160() etc. +B<key> and B<evp_md> may be B<NULL> if a key and hash function have +been set in a previous call to HMAC_Init() for that B<HMAC_CTX>. + +HMAC_cleanup() erases the key and other data from the B<HMAC_CTX>. + +The following functions may be used if the message is not completely +stored in memory: + +HMAC_Init() initializes a B<HMAC_CTX> structure to use the hash +function B<evp_md> and the key B<key> which is B<key_len> bytes long. + +HMAC_Update() can be called repeatedly with chunks of the message to +be authenticated (B<len> bytes at B<data>). + +HMAC_Final() places the message authentication code in B<md>, which +must have space for the hash function output. + +=head1 RETURN VALUES + +HMAC() returns a pointer to the message authentication code. + +HMAC_Init(), HMAC_Update(), HMAC_Final() and HMAC_cleanup() do not +return values. + +=head1 CONFORMING TO + +RFC 2104 + +=head1 SEE ALSO + +L<sha(3)|sha(3)>, L<evp(3)|evp(3)> + +=head1 HISTORY + +HMAC(), HMAC_Init(), HMAC_Update(), HMAC_Final() and HMAC_cleanup() +are available since SSLeay 0.9.0. + +=cut diff --git a/doc/crypto/md5.pod b/doc/crypto/md5.pod new file mode 100644 index 0000000000..8993004a30 --- /dev/null +++ b/doc/crypto/md5.pod @@ -0,0 +1,81 @@ +=pod + +=head1 NAME + +MD2, MD5, MD2_Init, MD2_Update, MD2_Final, MD5_Init, MD5_Update, +MD5_Final - MD2 and MD5 hash functions + +=head1 SYNOPSIS + + #include <openssl/md2.h> + + unsigned char *MD2(const unsigned char *d, unsigned long n, + unsigned char *md); + + void MD2_Init(MD2_CTX *c); + void MD2_Update(MD2_CTX *c, const unsigned char *data, + unsigned long len); + void MD2_Final(unsigned char *md, MD2_CTX *c); + + + #include <openssl/md5.h> + + unsigned char *MD5(const unsigned char *d, unsigned long n, + unsigned char *md); + + void MD5_Init(MD5_CTX *c); + void MD5_Update(MD5_CTX *c, const unsigned char *data, + unsigned long len); + void MD5_Final(unsigned char *md, MD5_CTX *c); + +=head1 DESCRIPTION + +MD2 and MD5 are cryptographic hashs function with a 128 bit output. + +MD2() and MD5() compute the MD2 and MD5 message digest of the B<n> +bytes at B<d> and place it in B<md> (which must have space for +MD2_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16 bytes of output). If +B<md> is NULL, the digest is placed in a static array. + +The following functions may be used if the message is not completely +stored in memory: + +MD2_Init() initializes a B<MD2_CTX> structure. + +MD2_Update() can be called repeatedly with chunks of the message to +be hashed (B<len> bytes at B<data>). + +MD2_Final() places the message digest in B<md>, which must have space +for MD2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MD2_CTX>. + +MD5_Init(), MD5_Update() and MD5_Final() are analogous using an +B<MD5_CTX> structure. + +=head1 NOTE + +MD2 and MD5 are recommended only for compatibility with existing +applications. In new applications, SHA-1 or RIPEMD-160 should be +preferred. + +=head1 RETURN VALUES + +MD2() and MD5() return pointers to the hash value. + +MD2_Init(), MD2_Update() MD2_Final(), MD5_Init(), MD5_Update() and +MD5_Final() do not return values. + +=head1 CONFORMING TO + +RFC 1319, RFC 1321 + +=head1 SEE ALSO + +L<sha(3)|sha(3)>, L<ripemd(3)|ripemd(3)> + +=head1 HISTORY + +MD2(), MD2_Init(), MD2_Update() MD2_Final(), MD5(), MD5_Init(), +MD5_Update() and MD5_Final() are available in all versions of SSLeay +and OpenSSL. + +=cut diff --git a/doc/crypto/mdc2.pod b/doc/crypto/mdc2.pod new file mode 100644 index 0000000000..1deeb7f582 --- /dev/null +++ b/doc/crypto/mdc2.pod @@ -0,0 +1,60 @@ +=pod + +=head1 NAME + +MDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function + +=head1 SYNOPSIS + + #include <openssl/mdc2.h> + + unsigned char *MDC2(const unsigned char *d, unsigned long n, + unsigned char *md); + + void MDC2_Init(MDC2_CTX *c); + void MDC2_Update(MDC2_CTX *c, const unsigned char *data, + unsigned long len); + void MDC2_Final(unsigned char *md, MDC2_CTX *c); + +=head1 DESCRIPTION + +MDC2 is a method to construct hash functions with 128 bit output from +block ciphers. These functions are an implementation of MDC2 with +DES. + +MDC2() computes the MDC2 message digest of the B<n> +bytes at B<d> and places it in B<md> (which must have space for +MDC2_DIGEST_LENGTH == 16 bytes of output). If B<md> is NULL, the digest +is placed in a static array. + +The following functions may be used if the message is not completely +stored in memory: + +MDC2_Init() initializes a B<MDC2_CTX> structure. + +MDC2_Update() can be called repeatedly with chunks of the message to +be hashed (B<len> bytes at B<data>). + +MDC2_Final() places the message digest in B<md>, which must have space +for MDC2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MDC2_CTX>. + +=head1 RETURN VALUES + +MDC2() returns a pointer to the hash value. + +MDC2_Init(), MDC2_Update() and MDC2_Final() do not return values. + +=head1 CONFORMING TO + +ISO/IEC 10118-2, with DES + +=head1 SEE ALSO + +L<sha(3)|sha(3)> + +=head1 HISTORY + +MDC2(), MDC2_Init(), MDC2_Update() and MDC2_Final() are available since +SSLeay 0.8. + +=cut diff --git a/doc/crypto/ripemd.pod b/doc/crypto/ripemd.pod new file mode 100644 index 0000000000..4a6a7e1b4a --- /dev/null +++ b/doc/crypto/ripemd.pod @@ -0,0 +1,62 @@ +=pod + +=head1 NAME + +RIPEMD160, RIPEMD160_Init, RIPEMD160_Update, RIPEMD160_Final - +RIPEMD-160 hash function + +=head1 SYNOPSIS + + #include <openssl/ripemd.h> + + unsigned char *RIPEMD160(const unsigned char *d, unsigned long n, + unsigned char *md); + + void RIPEMD160_Init(RIPEMD160_CTX *c); + void RIPEMD160_Update(RIPEMD_CTX *c, const unsigned char *data, + unsigned long len); + void RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); + +=head1 DESCRIPTION + +RIPEMD-160 is a cryptographic hash function with a +160 bit output. + +RIPEMD160() computes the RIPEMD-160 message digest of the B<n> +bytes at B<d> and places it in B<md> (which must have space for +RIPEMD160_DIGEST_LENGTH == 20 bytes of output). If B<md> is NULL, the digest +is placed in a static array. + +The following functions may be used if the message is not completely +stored in memory: + +RIPEMD160_Init() initializes a B<RIPEMD160_CTX> structure. + +RIPEMD160_Update() can be called repeatedly with chunks of the message to +be hashed (B<len> bytes at B<data>). + +RIPEMD160_Final() places the message digest in B<md>, which must have +space for RIPEMD160_DIGEST_LENGTH == 20 bytes of output, and erases +the B<RIPEMD160_CTX>. + +=head1 RETURN VALUES + +RIPEMD160() returns a pointer to the hash value. + +RIPEMD160_Init(), RIPEMD160_Update() and RIPEMD160_Final() do not +return values. + +=head1 CONFORMING TO + +ISO/IEC 10118-3 (draft) (??) + +=head1 SEE ALSO + +L<sha(3)|sha(3)>, L<hmac(3)|hmac(3)> + +=head1 HISTORY + +RIPEMD160(), RIPEMD160_Init(), RIPEMD160_Update() and +RIPEMD160_Final() are available since SSLeay 0.9.0. + +=cut diff --git a/doc/crypto/sha.pod b/doc/crypto/sha.pod index defc442808..39ceb5c679 100644 --- a/doc/crypto/sha.pod +++ b/doc/crypto/sha.pod @@ -56,7 +56,7 @@ ANSI X9.30 =head1 SEE ALSO -L<ripemd(3)|ripemd(3)> +L<ripemd(3)|ripemd(3)>, L<hmac(3)|hmac(3)> =head1 HISTORY |