Commit 099a2893 authored by Josh Coalson's avatar Josh Coalson
Browse files

minor tweaks to private md5 interface

parent f299910d
#ifndef FLAC__PRIVATE__MD5_H
#define FLAC__PRIVATE__MD5_H
/* /*
* This is the header file for the MD5 message-digest algorithm. * This is the header file for the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was * The algorithm is due to Ron Rivest. This code was
...@@ -20,29 +23,22 @@ ...@@ -20,29 +23,22 @@
* Still in the public domain. * Still in the public domain.
* *
* Josh Coalson: made some changes to integrate with libFLAC. * Josh Coalson: made some changes to integrate with libFLAC.
* Still in the public domain. * Still in the public domain, with no warranty.
*/ */
#ifndef FLAC__PRIVATE__MD5_H
#define FLAC__PRIVATE__MD5_H
#define md5byte unsigned char
#include "FLAC/ordinals.h" #include "FLAC/ordinals.h"
struct FLAC__MD5Context { typedef struct {
FLAC__uint32 buf[4]; FLAC__uint32 buf[4];
FLAC__uint32 bytes[2]; FLAC__uint32 bytes[2];
FLAC__uint32 in[16]; FLAC__uint32 in[16];
FLAC__byte *internal_buf; FLAC__byte *internal_buf;
unsigned capacity; unsigned capacity;
}; } FLAC__MD5Context;
void FLAC__MD5Init(struct FLAC__MD5Context *context); void FLAC__MD5Init(FLAC__MD5Context *context);
void FLAC__MD5Update(struct FLAC__MD5Context *context, md5byte const *buf, unsigned len); void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *context);
void FLAC__MD5Final(md5byte digest[16], struct FLAC__MD5Context *context);
void FLAC__MD5Transform(FLAC__uint32 buf[4], FLAC__uint32 const in[16]);
FLAC__bool FLAC__MD5Accumulate(struct FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], unsigned channels, unsigned samples, unsigned bytes_per_sample); FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], unsigned channels, unsigned samples, unsigned bytes_per_sample);
#endif /* !MD5_H */ #endif
...@@ -192,7 +192,7 @@ typedef struct FLAC__StreamDecoderPrivate { ...@@ -192,7 +192,7 @@ typedef struct FLAC__StreamDecoderPrivate {
FLAC__bool do_md5_checking; /* initially gets protected_->md5_checking but is turned off after a seek or if the metadata has a zero MD5 */ FLAC__bool do_md5_checking; /* initially gets protected_->md5_checking but is turned off after a seek or if the metadata has a zero MD5 */
FLAC__bool internal_reset_hack; /* used only during init() so we can call reset to set up the decoder without rewinding the input */ FLAC__bool internal_reset_hack; /* used only during init() so we can call reset to set up the decoder without rewinding the input */
FLAC__bool is_seeking; FLAC__bool is_seeking;
struct FLAC__MD5Context md5context; FLAC__MD5Context md5context;
FLAC__byte computed_md5sum[16]; /* this is the sum we computed from the decoded data */ FLAC__byte computed_md5sum[16]; /* this is the sum we computed from the decoded data */
/* (the rest of these are only used for seeking) */ /* (the rest of these are only used for seeking) */
FLAC__Frame last_frame; /* holds the info of the last frame we seeked to */ FLAC__Frame last_frame; /* holds the info of the last frame we seeked to */
......
...@@ -361,7 +361,7 @@ typedef struct FLAC__StreamEncoderPrivate { ...@@ -361,7 +361,7 @@ typedef struct FLAC__StreamEncoderPrivate {
FLAC__StreamMetadata_SeekTable *seek_table; /* pointer into encoder->protected_->metadata_ where the seek table is */ FLAC__StreamMetadata_SeekTable *seek_table; /* pointer into encoder->protected_->metadata_ where the seek table is */
unsigned current_sample_number; unsigned current_sample_number;
unsigned current_frame_number; unsigned current_frame_number;
struct FLAC__MD5Context md5context; FLAC__MD5Context md5context;
FLAC__CPUInfo cpuinfo; FLAC__CPUInfo cpuinfo;
#ifndef FLAC__INTEGER_ONLY_LIBRARY #ifndef FLAC__INTEGER_ONLY_LIBRARY
unsigned (*local_fixed_compute_best_predictor)(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]); unsigned (*local_fixed_compute_best_predictor)(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment