2010-08-23 19:10:28 -05:00
|
|
|
//
|
|
|
|
// MGMSHA384.h
|
|
|
|
//
|
|
|
|
// Created by Mr. Gecko <GRMrGecko@gmail.com> on 2/24/10.
|
|
|
|
// No Copyright Claimed. Public Domain.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef _MD_SHA384
|
|
|
|
#define _MD_SHA384
|
|
|
|
|
|
|
|
#ifdef __NEXT_RUNTIME__
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
|
|
|
extern NSString * const MDNSHA384;
|
|
|
|
|
|
|
|
@interface NSString (MGMSHA384)
|
|
|
|
- (NSString *)SHA384;
|
|
|
|
- (NSString *)pathSHA384;
|
|
|
|
@end
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-08-09 22:54:43 -05:00
|
|
|
extern const struct MGMHashDescription SHA384Desc;
|
|
|
|
|
2010-08-23 19:10:28 -05:00
|
|
|
char *SHA384String(const char *string, int length);
|
|
|
|
char *SHA384File(const char *path);
|
|
|
|
|
|
|
|
#define SHA384Length 48
|
2013-08-09 22:54:43 -05:00
|
|
|
#define SHA384BufferSize 128
|
2010-08-23 19:10:28 -05:00
|
|
|
|
|
|
|
struct SHA384Context {
|
2013-08-09 22:54:43 -05:00
|
|
|
uint64_t length, state[8];
|
|
|
|
unsigned long curlen;
|
|
|
|
unsigned char buf[SHA384BufferSize];
|
2010-08-23 19:10:28 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
void SHA384Init(struct SHA384Context *context);
|
|
|
|
void SHA384Update(struct SHA384Context *context, const unsigned char *buf, uint64_t len);
|
|
|
|
void SHA384Final(unsigned char digest[SHA384Length], struct SHA384Context *context);
|
2013-08-09 22:54:43 -05:00
|
|
|
void SHA384Transform(struct SHA384Context *context, unsigned char *buf);
|
|
|
|
int SHA384Test();
|
2010-08-23 19:10:28 -05:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|