2013-03-25 14:23:07 +00:00
|
|
|
/*
|
2020-01-28 14:32:34 +00:00
|
|
|
* (C) Copyright 2005- ECMWF.
|
2013-03-25 14:23:07 +00:00
|
|
|
*
|
|
|
|
* This software is licensed under the terms of the Apache Licence Version 2.0
|
|
|
|
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
|
|
*
|
|
|
|
* In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
|
|
|
|
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
|
|
|
*/
|
|
|
|
|
2019-09-06 15:36:01 +00:00
|
|
|
#ifndef md5_H
|
|
|
|
#define md5_H
|
|
|
|
|
2013-03-25 12:04:10 +00:00
|
|
|
#include <stdlib.h>
|
2019-01-11 12:49:31 +00:00
|
|
|
#include <stdint.h>
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2020-01-29 10:16:32 +00:00
|
|
|
typedef struct grib_md5_state
|
|
|
|
{
|
2019-09-06 15:36:01 +00:00
|
|
|
uint64_t size;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2019-09-06 15:36:01 +00:00
|
|
|
unsigned long words[64];
|
|
|
|
unsigned long word_count;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2019-09-06 15:36:01 +00:00
|
|
|
unsigned char bytes[4];
|
|
|
|
unsigned long byte_count;
|
2013-03-25 12:04:10 +00:00
|
|
|
|
2019-09-06 15:36:01 +00:00
|
|
|
unsigned long h0;
|
|
|
|
unsigned long h1;
|
|
|
|
unsigned long h2;
|
|
|
|
unsigned long h3;
|
2013-03-25 12:04:10 +00:00
|
|
|
} grib_md5_state;
|
|
|
|
|
|
|
|
void grib_md5_init(grib_md5_state* s);
|
2019-09-06 15:36:01 +00:00
|
|
|
void grib_md5_add(grib_md5_state* s, const void* data, size_t len);
|
2020-01-29 10:16:32 +00:00
|
|
|
void grib_md5_end(grib_md5_state* s, char* digest);
|
2013-03-25 12:04:10 +00:00
|
|
|
|
|
|
|
#endif
|