X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Futil%2Fmesa-sha1.h;h=bde50ba1eb4f5c97528d13314318178a5282d620;hb=04ed3522c9093472461cad78380d5d66ac8a2519;hp=0be5485f3132974efd5e30ee8b8a80a3e40215ae;hpb=2af3a0ca6f4ad34774dfba64f2e95344d1f336c0;p=mesa.git diff --git a/src/util/mesa-sha1.h b/src/util/mesa-sha1.h index 0be5485f313..bde50ba1eb4 100644 --- a/src/util/mesa-sha1.h +++ b/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 +#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