Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* -*- buffer-read-only: t -*- vi: set ro: */ 00002 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 00003 /* Declaration of functions and data types used for MD5 sum computing 00004 library functions. 00005 Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2011 Free Software 00006 Foundation, Inc. 00007 This file is part of the GNU C Library. 00008 00009 This program is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU General Public License as published by the 00011 Free Software Foundation; either version 3, or (at your option) any 00012 later version. 00013 00014 This program is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program; if not, write to the Free Software Foundation, 00021 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 00022 00023 #ifndef _MD5_H 00024 #define _MD5_H 1 00025 00026 #include <stdio.h> 00027 #include <stdint.h> 00028 00029 #define MD5_DIGEST_SIZE 16 00030 #define MD5_BLOCK_SIZE 64 00031 00032 #ifndef __GNUC_PREREQ 00033 # if defined __GNUC__ && defined __GNUC_MINOR__ 00034 # define __GNUC_PREREQ(maj, min) \ 00035 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) 00036 # else 00037 # define __GNUC_PREREQ(maj, min) 0 00038 # endif 00039 #endif 00040 00041 #ifndef __THROW 00042 # if defined __cplusplus && __GNUC_PREREQ (2,8) 00043 # define __THROW throw () 00044 # else 00045 # define __THROW 00046 # endif 00047 #endif 00048 00049 #ifndef _LIBC 00050 # define __md5_buffer md5_buffer 00051 # define __md5_finish_ctx md5_finish_ctx 00052 # define __md5_init_ctx md5_init_ctx 00053 # define __md5_process_block md5_process_block 00054 # define __md5_process_bytes md5_process_bytes 00055 # define __md5_read_ctx md5_read_ctx 00056 # define __md5_stream md5_stream 00057 #endif 00058 00059 # ifdef __cplusplus 00060 extern "C" { 00061 # endif 00062 00063 /* Structure to save state of computation between the single steps. */ 00064 struct md5_ctx 00065 { 00066 uint32_t A; 00067 uint32_t B; 00068 uint32_t C; 00069 uint32_t D; 00070 00071 uint32_t total[2]; 00072 uint32_t buflen; 00073 uint32_t buffer[32]; 00074 }; 00075 00076 /* 00077 * The following three functions are build up the low level used in 00078 * the functions `md5_stream' and `md5_buffer'. 00079 */ 00080 00081 /* Initialize structure containing state of computation. 00082 (RFC 1321, 3.3: Step 3) */ 00083 extern void __md5_init_ctx (struct md5_ctx *ctx) __THROW; 00084 00085 /* Starting with the result of former calls of this function (or the 00086 initialization function update the context for the next LEN bytes 00087 starting at BUFFER. 00088 It is necessary that LEN is a multiple of 64!!! */ 00089 extern void __md5_process_block (const void *buffer, size_t len, 00090 struct md5_ctx *ctx) __THROW; 00091 00092 /* Starting with the result of former calls of this function (or the 00093 initialization function update the context for the next LEN bytes 00094 starting at BUFFER. 00095 It is NOT required that LEN is a multiple of 64. */ 00096 extern void __md5_process_bytes (const void *buffer, size_t len, 00097 struct md5_ctx *ctx) __THROW; 00098 00099 /* Process the remaining bytes in the buffer and put result from CTX 00100 in first 16 bytes following RESBUF. The result is always in little 00101 endian byte order, so that a byte-wise output yields to the wanted 00102 ASCII representation of the message digest. */ 00103 extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW; 00104 00105 00106 /* Put result from CTX in first 16 bytes following RESBUF. The result is 00107 always in little endian byte order, so that a byte-wise output yields 00108 to the wanted ASCII representation of the message digest. */ 00109 extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW; 00110 00111 00112 /* Compute MD5 message digest for bytes read from STREAM. The 00113 resulting message digest number will be written into the 16 bytes 00114 beginning at RESBLOCK. */ 00115 extern int __md5_stream (FILE *stream, void *resblock) __THROW; 00116 00117 /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The 00118 result is always in little endian byte order, so that a byte-wise 00119 output yields to the wanted ASCII representation of the message 00120 digest. */ 00121 extern void *__md5_buffer (const char *buffer, size_t len, 00122 void *resblock) __THROW; 00123 00124 # ifdef __cplusplus 00125 } 00126 # endif 00127 00128 #endif /* md5.h */