*/
#include <string.h>
+
+#include "attributes.h"
#include "avutil.h"
#include "bswap.h"
#include "sha.h"
#include "intreadwrite.h"
+#include "mem.h"
/** hash context */
typedef struct AVSHA {
void (*transform)(uint32_t *state, const uint8_t buffer[64]);
} AVSHA;
+#if FF_API_CONTEXT_SIZE
const int av_sha_size = sizeof(AVSHA);
+#endif
+
+struct AVSHA *av_sha_alloc(void)
+{
+ return av_mallocz(sizeof(struct AVSHA));
+}
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
}
-int av_sha_init(AVSHA* ctx, int bits)
+av_cold int av_sha_init(AVSHA *ctx, int bits)
{
ctx->digest_len = bits >> 5;
switch (bits) {
#ifdef TEST
#include <stdio.h>
-#undef printf
int main(void)
{