MD5.pod 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. =pod
  2. =head1 NAME
  3. MD2, MD4, MD5, MD2_Init, MD2_Update, MD2_Final, MD4_Init, MD4_Update,
  4. MD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions
  5. =head1 SYNOPSIS
  6. #include <openssl/md2.h>
  7. unsigned char *MD2(const unsigned char *d, unsigned long n, unsigned char *md);
  8. int MD2_Init(MD2_CTX *c);
  9. int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len);
  10. int MD2_Final(unsigned char *md, MD2_CTX *c);
  11. #include <openssl/md4.h>
  12. unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md);
  13. int MD4_Init(MD4_CTX *c);
  14. int MD4_Update(MD4_CTX *c, const void *data, unsigned long len);
  15. int MD4_Final(unsigned char *md, MD4_CTX *c);
  16. #include <openssl/md5.h>
  17. unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md);
  18. int MD5_Init(MD5_CTX *c);
  19. int MD5_Update(MD5_CTX *c, const void *data, unsigned long len);
  20. int MD5_Final(unsigned char *md, MD5_CTX *c);
  21. =head1 DESCRIPTION
  22. MD2, MD4, and MD5 are cryptographic hash functions with a 128 bit output.
  23. MD2(), MD4(), and MD5() compute the MD2, MD4, and MD5 message digest
  24. of the B<n> bytes at B<d> and place it in B<md> (which must have space
  25. for MD2_DIGEST_LENGTH == MD4_DIGEST_LENGTH == MD5_DIGEST_LENGTH == 16
  26. bytes of output). If B<md> is NULL, the digest is placed in a static
  27. array.
  28. The following functions may be used if the message is not completely
  29. stored in memory:
  30. MD2_Init() initializes a B<MD2_CTX> structure.
  31. MD2_Update() can be called repeatedly with chunks of the message to
  32. be hashed (B<len> bytes at B<data>).
  33. MD2_Final() places the message digest in B<md>, which must have space
  34. for MD2_DIGEST_LENGTH == 16 bytes of output, and erases the B<MD2_CTX>.
  35. MD4_Init(), MD4_Update(), MD4_Final(), MD5_Init(), MD5_Update(), and
  36. MD5_Final() are analogous using an B<MD4_CTX> and B<MD5_CTX> structure.
  37. Applications should use the higher level functions
  38. L<EVP_DigestInit(3)>
  39. etc. instead of calling the hash functions directly.
  40. =head1 NOTE
  41. MD2, MD4, and MD5 are recommended only for compatibility with existing
  42. applications. In new applications, SHA-1 or RIPEMD-160 should be
  43. preferred.
  44. =head1 RETURN VALUES
  45. MD2(), MD4(), and MD5() return pointers to the hash value.
  46. MD2_Init(), MD2_Update(), MD2_Final(), MD4_Init(), MD4_Update(),
  47. MD4_Final(), MD5_Init(), MD5_Update(), and MD5_Final() return 1 for
  48. success, 0 otherwise.
  49. =head1 CONFORMING TO
  50. RFC 1319, RFC 1320, RFC 1321
  51. =head1 SEE ALSO
  52. L<EVP_DigestInit(3)>
  53. =head1 COPYRIGHT
  54. Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
  55. Licensed under the OpenSSL license (the "License"). You may not use
  56. this file except in compliance with the License. You can obtain a copy
  57. in the file LICENSE in the source distribution or at
  58. L<https://www.openssl.org/source/license.html>.
  59. =cut