04d7f601 |
/*
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
* |
b78e7197 |
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or |
04d7f601 |
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either |
b78e7197 |
* version 2.1 of the License, or (at your option) any later version. |
04d7f601 |
* |
b78e7197 |
* FFmpeg is distributed in the hope that it will be useful, |
04d7f601 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public |
b78e7197 |
* License along with FFmpeg; if not, write to the Free Software |
04d7f601 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
|
19d7098c |
/**
* @file
* @ingroup lavu_md5
* Public header for MD5 hash function implementation.
*/
|
98790382 |
#ifndef AVUTIL_MD5_H
#define AVUTIL_MD5_H |
94d85eaf |
|
e435beb1 |
#include <stddef.h> |
99545457 |
#include <stdint.h>
|
9a92aea2 |
#include "attributes.h"
#include "version.h"
|
757cd8d8 |
/**
* @defgroup lavu_md5 MD5 |
19d7098c |
* @ingroup lavu_hash
* MD5 hash function implementation.
* |
757cd8d8 |
* @{
*/
|
ac090fa6 |
extern const int av_md5_size; |
94d85eaf |
struct AVMD5;
|
c4f932f4 |
/**
* Allocate an AVMD5 context.
*/ |
9a92aea2 |
struct AVMD5 *av_md5_alloc(void); |
c4f932f4 |
/**
* Initialize MD5 hashing.
*
* @param ctx pointer to the function context (of size av_md5_size)
*/ |
94d85eaf |
void av_md5_init(struct AVMD5 *ctx); |
c4f932f4 |
/**
* Update hash value.
*
* @param ctx hash function context
* @param src input data to update hash with
* @param len input data length
*/ |
651ee934 |
#if FF_API_CRYPTO_SIZE_T |
24c65eb2 |
void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len); |
651ee934 |
#else
void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, size_t len);
#endif |
c4f932f4 |
/**
* Finish hashing and output digest value.
*
* @param ctx hash function context
* @param dst buffer where output digest value is stored
*/ |
94d85eaf |
void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); |
c4f932f4 |
/**
* Hash an array of data.
*
* @param dst The output buffer to write the digest into
* @param src The data to hash
* @param len The length of the data, in bytes
*/ |
e435beb1 |
#if FF_API_CRYPTO_SIZE_T |
93d6aeb0 |
void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); |
e435beb1 |
#else
void av_md5_sum(uint8_t *dst, const uint8_t *src, size_t len);
#endif |
94d85eaf |
|
757cd8d8 |
/**
* @}
*/
|
98790382 |
#endif /* AVUTIL_MD5_H */ |