that output may be written as uint32_t since output buffer may not be aligned
(and it's silly to force alignment on it) and it does not work in that case
properly on some architectures.
Originally committed as revision 21754 to svn://svn.ffmpeg.org/ffmpeg/trunk
#include "avutil.h"
#include "bswap.h"
#include "sha.h"
+#include "intreadwrite.h"
/** hash context */
typedef struct AVSHA {
av_sha_update(ctx, "", 1);
av_sha_update(ctx, (uint8_t *)&finalcount, 8); /* Should cause a transform() */
for (i = 0; i < ctx->digest_len; i++)
- ((uint32_t*)digest)[i] = be2me_32(ctx->state[i]);
+ AV_WN32(digest + i*4, be2me_32(ctx->state[i]));
}
#if LIBAVUTIL_VERSION_MAJOR < 51