/External/Mysql-5.0/include/my_md5.h

http://awoe.googlecode.com/ · C++ Header · 92 lines · 26 code · 13 blank · 53 comment · 0 complexity · fb25c123f9d70a47c31ee70fb94bac00 MD5 · raw file

  1. /* Copyright (C) 2000 MySQL AB
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  12. /* MD5.H - header file for MD5C.C
  13. */
  14. /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
  15. rights reserved.
  16. License to copy and use this software is granted provided that it
  17. is identified as the "RSA Data Security, Inc. MD5 Message-Digest
  18. Algorithm" in all material mentioning or referencing this software
  19. or this function.
  20. License is also granted to make and use derivative works provided
  21. that such works are identified as "derived from the RSA Data
  22. Security, Inc. MD5 Message-Digest Algorithm" in all material
  23. mentioning or referencing the derived work.
  24. RSA Data Security, Inc. makes no representations concerning either
  25. the merchantability of this software or the suitability of this
  26. software for any particular purpose. It is provided "as is"
  27. without express or implied warranty of any kind.
  28. These notices must be retained in any copies of any part of this
  29. documentation and/or software.
  30. */
  31. /* GLOBAL.H - RSAREF types and constants
  32. */
  33. /* PROTOTYPES should be set to one if and only if the compiler supports
  34. function argument prototyping.
  35. The following makes PROTOTYPES default to 0 if it has not already
  36. been defined with C compiler flags.
  37. */
  38. /* egcs 1.1.2 under linux didn't defined it.... :( */
  39. #ifndef PROTOTYPES
  40. #define PROTOTYPES 1 /* Assume prototypes */
  41. #endif
  42. /* POINTER defines a generic pointer type */
  43. typedef unsigned char *POINTER;
  44. /* UINT2 defines a two byte word */
  45. typedef uint16 UINT2; /* Fix for MySQL / Alpha */
  46. /* UINT4 defines a four byte word */
  47. typedef uint32 UINT4; /* Fix for MySQL / Alpha */
  48. /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
  49. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
  50. returns an empty list.
  51. */
  52. #if PROTOTYPES
  53. #define PROTO_LIST(list) list
  54. #else
  55. #define PROTO_LIST(list) ()
  56. #endif
  57. /* MD5 context. */
  58. typedef struct {
  59. UINT4 state[4]; /* state (ABCD) */
  60. UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
  61. unsigned char buffer[64]; /* input buffer */
  62. } my_MD5_CTX;
  63. #ifdef __cplusplus
  64. extern "C" {
  65. #endif
  66. void my_MD5Init PROTO_LIST ((my_MD5_CTX *));
  67. void my_MD5Update PROTO_LIST
  68. ((my_MD5_CTX *, unsigned char *, unsigned int));
  69. void my_MD5Final PROTO_LIST ((unsigned char [16], my_MD5_CTX *));
  70. #ifdef __cplusplus
  71. }
  72. #endif