xref: /aosp_15_r20/external/flac/src/libFLAC/include/private/md5.h (revision 600f14f40d737144c998e2ec7a483122d3776fbc)
1*600f14f4SXin Li #ifndef FLAC__PRIVATE__MD5_H
2*600f14f4SXin Li #define FLAC__PRIVATE__MD5_H
3*600f14f4SXin Li 
4*600f14f4SXin Li /*
5*600f14f4SXin Li  * This is the header file for the MD5 message-digest algorithm.
6*600f14f4SXin Li  * The algorithm is due to Ron Rivest.  This code was
7*600f14f4SXin Li  * written by Colin Plumb in 1993, no copyright is claimed.
8*600f14f4SXin Li  * This code is in the public domain; do with it what you wish.
9*600f14f4SXin Li  *
10*600f14f4SXin Li  * Equivalent code is available from RSA Data Security, Inc.
11*600f14f4SXin Li  * This code has been tested against that, and is equivalent,
12*600f14f4SXin Li  * except that you don't need to include two pages of legalese
13*600f14f4SXin Li  * with every copy.
14*600f14f4SXin Li  *
15*600f14f4SXin Li  * To compute the message digest of a chunk of bytes, declare an
16*600f14f4SXin Li  * MD5Context structure, pass it to MD5Init, call MD5Update as
17*600f14f4SXin Li  * needed on buffers full of bytes, and then call MD5Final, which
18*600f14f4SXin Li  * will fill a supplied 16-byte array with the digest.
19*600f14f4SXin Li  *
20*600f14f4SXin Li  * Changed so as no longer to depend on Colin Plumb's `usual.h'
21*600f14f4SXin Li  * header definitions; now uses stuff from dpkg's config.h
22*600f14f4SXin Li  *  - Ian Jackson <[email protected]>.
23*600f14f4SXin Li  * Still in the public domain.
24*600f14f4SXin Li  *
25*600f14f4SXin Li  * Josh Coalson: made some changes to integrate with libFLAC.
26*600f14f4SXin Li  * Still in the public domain, with no warranty.
27*600f14f4SXin Li  */
28*600f14f4SXin Li 
29*600f14f4SXin Li #include "FLAC/ordinals.h"
30*600f14f4SXin Li 
31*600f14f4SXin Li typedef union {
32*600f14f4SXin Li 	FLAC__byte *p8;
33*600f14f4SXin Li 	FLAC__int16 *p16;
34*600f14f4SXin Li 	FLAC__int32 *p32;
35*600f14f4SXin Li } FLAC__multibyte;
36*600f14f4SXin Li 
37*600f14f4SXin Li typedef struct {
38*600f14f4SXin Li 	FLAC__uint32 in[16];
39*600f14f4SXin Li 	FLAC__uint32 buf[4];
40*600f14f4SXin Li 	FLAC__uint32 bytes[2];
41*600f14f4SXin Li 	FLAC__multibyte internal_buf;
42*600f14f4SXin Li 	size_t capacity;
43*600f14f4SXin Li } FLAC__MD5Context;
44*600f14f4SXin Li 
45*600f14f4SXin Li void FLAC__MD5Init(FLAC__MD5Context *context);
46*600f14f4SXin Li void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *context);
47*600f14f4SXin Li 
48*600f14f4SXin Li FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], uint32_t channels, uint32_t samples, uint32_t bytes_per_sample);
49*600f14f4SXin Li 
50*600f14f4SXin Li #endif
51