1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2011-2012 x265 project
6 * Authors: Min Chen <chenm003@163.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation;
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
21 * This program is also available under a commercial proprietary license.
22 * For more information, contact us at chenm003@163.com.
23 *****************************************************************************/
31 //private x265 namespace
33 typedef struct MD5Context
40 void MD5Init(MD5Context
*context
);
41 void MD5Update(MD5Context
*context
, unsigned char *buf
, uint32_t len
);
42 void MD5Final(MD5Context
*ctx
, uint8_t *digest
);
49 * initialize digest state
57 * compute digest over buf of length len.
58 * multiple calls may extend the digest over more data.
60 void update(unsigned char *buf
, unsigned len
)
62 MD5Update(&m_state
, buf
, len
);
66 * flush any outstanding MD5 data, write the digest into digest.
68 void finalize(unsigned char digest
[16])
70 MD5Final(&m_state
, digest
);
79 #endif // ifndef X265_MD5_H