md5_utils.h revision 90d3ed91ae9228e1c8bab561b6138d4cb8c1e4fd
1/* 2 * Copyright (c) 2010 The VP8 project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license and patent 5 * grant that can be found in the LICENSE file in the root of the source 6 * tree. All contributing project authors may be found in the AUTHORS 7 * file in the root of the source tree. 8 */ 9 10/* 11Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 12rights reserved. 13 14License to copy and use this software is granted provided that it 15is identified as the "RSA Data Security, Inc. MD5 Message-Digest 16Algorithm" in all material mentioning or referencing this software 17or this function. 18 19License is also granted to make and use derivative works provided 20that such works are identified as "derived from the RSA Data 21Security, Inc. MD5 Message-Digest Algorithm" in all material 22mentioning or referencing the derived work. 23 24RSA Data Security, Inc. makes no representations concerning either 25the merchantability of this software or the suitability of this 26software for any particular purpose. It is provided "as is" 27without express or implied warranty of any kind. 28 29These notices must be retained in any copies of any part of this 30documentation and/or software. 31*/ 32#ifndef HAVE_VPX_PORTS 33#define HAVE_VPX_PORTS 0 34#endif 35#if HAVE_VPX_PORTS 36#include "vpx_ports/vpx_integer.h" 37#else 38#include "vpx_integer.h" 39#endif 40 41/* MD5 context. */ 42typedef struct 43{ 44 uint32_t state[4]; /* state (ABCD) */ 45 uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ 46 uint8_t buffer[64]; /* input buffer */ 47} md5_ctx_t; 48 49void md5_init(md5_ctx_t *ctx); 50void md5_update(md5_ctx_t *ctx, const uint8_t *buf, unsigned int len); 51void md5_finalize(md5_ctx_t *ctx, uint8_t md5[16]); 52