From: Erik M. <er...@us...> - 2002-01-06 18:59:43
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv26911/include/blob Modified Files: Makefile.am main.h Added Files: md5.h md5support.h Log Message: MD5 support by Chris Hoover --- NEW FILE: md5.h --- /* Taken from textutils-2.0 -ch */ /* $Id: md5.h,v 1.1 2002/01/06 18:59:40 erikm Exp $ */ /* md5.h - Declaration of functions and data types used for MD5 sum computing library functions. Copyright (C) 1995, 1996 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug...@pr.... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef BLOB_MD5_H #define BLOB_MD5_H #include <blob/types.h> typedef u32 md5_uint32; #undef __P #if defined (__STDC__) && __STDC__ #define __P(x) x #else #define __P(x) () #endif /* Structure to save state of computation between the single steps. */ struct md5_ctx { md5_uint32 A; md5_uint32 B; md5_uint32 C; md5_uint32 D; md5_uint32 total[2]; md5_uint32 buflen; char buffer[128]; }; /* * The following three functions are build up the low level used in * the functions `md5_stream' and `md5_buffer'. */ /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ extern void md5_init_ctx __P ((struct md5_ctx *ctx)); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is necessary that LEN is a multiple of 64!!! */ extern void md5_process_block __P ((const void *buffer, size_t len, struct md5_ctx *ctx)); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is NOT required that LEN is a multiple of 64. */ extern void md5_process_bytes __P ((const void *buffer, size_t len, struct md5_ctx *ctx)); /* Process the remaining bytes in the buffer and put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); /* Put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); #endif --- NEW FILE: md5support.h --- /* * md5support.h: MD5 support function * * Copyright (C) 2001 Hewlett-Packard Company * Written by Christopher Hoover <ch...@hp...> * Minor modifications by Erik Mouw * * $Id: md5support.h,v 1.1 2002/01/06 18:59:40 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: md5support.h,v 1.1 2002/01/06 18:59:40 erikm Exp $" #ifndef BLOB_MD5SUPPORT_H #define BLOB_MD5SUPPORT_H #include <blob/types.h> int print_md5_digest(const u32 *digest); #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.am 2002/01/05 20:21:49 1.12 +++ Makefile.am 2002/01/06 18:59:40 1.13 @@ -27,6 +27,8 @@ led.h \ linux.h \ main.h \ + md5.h \ + md5support.h \ memory.h \ memsetup.h \ param_block.h \ Index: main.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/main.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- main.h 2002/01/03 16:07:17 1.5 +++ main.h 2002/01/06 18:59:40 1.6 @@ -48,15 +48,19 @@ typedef struct { int kernelSize; block_source_t kernelType; + u32 kernel_md5_digest[4]; int paramSize; block_source_t paramType; + u32 param_md5_digest[4]; int ramdiskSize; block_source_t ramdiskType; + u32 ramdisk_md5_digest[4]; int blobSize; block_source_t blobType; + u32 blob_md5_digest[4]; serial_baud_t downloadSpeed; serial_baud_t terminalSpeed; |