diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-12-31 07:12:27 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-12-31 07:12:27 +0000 |
commit | 051645c92924bf915d82bf219f2ed67309b5577a (patch) | |
tree | 4aae126dd8e5a18c6a9926a5468d1561e6038a07 /lib/mesa/src/util/mesa-sha1.h | |
parent | 2dae6fe6f74cf7fb9fd65285302c0331d9786b00 (diff) |
Merge Mesa 17.2.8
Diffstat (limited to 'lib/mesa/src/util/mesa-sha1.h')
-rw-r--r-- | lib/mesa/src/util/mesa-sha1.h | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/lib/mesa/src/util/mesa-sha1.h b/lib/mesa/src/util/mesa-sha1.h index 0be5485f3..bde50ba1e 100644 --- a/lib/mesa/src/util/mesa-sha1.h +++ b/lib/mesa/src/util/mesa-sha1.h @@ -20,27 +20,38 @@ * DEALINGS IN THE SOFTWARE. */ -#ifndef SHA1_H -#define SHA1_H +#ifndef MESA_SHA1_H +#define MESA_SHA1_H #include <stdlib.h> +#include "c99_compat.h" +#include "sha1/sha1.h" #ifdef __cplusplus extern "C" { #endif -struct mesa_sha1; +#define mesa_sha1 _SHA1_CTX -struct mesa_sha1 * -_mesa_sha1_init(void); +static inline void +_mesa_sha1_init(struct mesa_sha1 *ctx) +{ + SHA1Init(ctx); +} -int -_mesa_sha1_update(struct mesa_sha1 *ctx, const void *data, int size); +static inline void +_mesa_sha1_update(struct mesa_sha1 *ctx, const void *data, size_t size) +{ + SHA1Update(ctx, (const unsigned char *)data, size); +} -int -_mesa_sha1_final(struct mesa_sha1 *ctx, unsigned char result[20]); +static inline void +_mesa_sha1_final(struct mesa_sha1 *ctx, unsigned char result[20]) +{ + SHA1Final(result, ctx); +} -char * +void _mesa_sha1_format(char *buf, const unsigned char *sha1); void |