2010-08-23 19:10:28 -05:00
|
|
|
//
|
|
|
|
// MGMSHA224.h
|
|
|
|
//
|
|
|
|
// Created by Mr. Gecko <GRMrGecko@gmail.com> on 2/24/10.
|
|
|
|
// No Copyright Claimed. Public Domain.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef _MD_SHA224
|
|
|
|
#define _MD_SHA224
|
|
|
|
|
|
|
|
#ifdef __NEXT_RUNTIME__
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
|
|
|
extern NSString * const MDNSHA224;
|
|
|
|
|
|
|
|
@interface NSString (MGMSHA224)
|
|
|
|
- (NSString *)SHA224;
|
|
|
|
- (NSString *)pathSHA224;
|
|
|
|
@end
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-08-09 22:54:43 -05:00
|
|
|
extern const struct MGMHashDescription SHA224Desc;
|
|
|
|
|
2010-08-23 19:10:28 -05:00
|
|
|
char *SHA224String(const char *string, int length);
|
|
|
|
char *SHA224File(const char *path);
|
|
|
|
|
|
|
|
#define SHA224Length 28
|
2013-08-09 22:54:43 -05:00
|
|
|
#define SHA224BufferSize 64
|
2010-08-23 19:10:28 -05:00
|
|
|
|
|
|
|
struct SHA224Context {
|
2013-08-09 22:54:43 -05:00
|
|
|
uint64_t length;
|
|
|
|
uint32_t state[8], curlen;
|
|
|
|
unsigned char buf[SHA224BufferSize];
|
2010-08-23 19:10:28 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
void SHA224Init(struct SHA224Context *context);
|
|
|
|
void SHA224Update(struct SHA224Context *context, const unsigned char *buf, unsigned int len);
|
|
|
|
void SHA224Final(unsigned char digest[SHA224Length], struct SHA224Context *context);
|
2013-08-09 22:54:43 -05:00
|
|
|
void SHA224Transform(struct SHA224Context *context, unsigned char *buf);
|
|
|
|
int SHA224Test();
|
2010-08-23 19:10:28 -05:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|