BitPunch McEliece  v0.0.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sha512.h File Reference
#include <string.h>
#include <inttypes.h>

Go to the source code of this file.

Data Structures

struct  sha512_context
 SHA-512 context structure. More...
 

Macros

#define UL64(x)   x##ULL
 
#define POLARSSL_ERR_SHA512_FILE_IO_ERROR   -0x007A
 

Functions

void sha512_init (sha512_context *ctx)
 Initialize SHA-512 context. More...
 
void sha512_free (sha512_context *ctx)
 Clear SHA-512 context. More...
 
void sha512_starts (sha512_context *ctx, int is384)
 SHA-512 context setup. More...
 
void sha512_update (sha512_context *ctx, const unsigned char *input, size_t ilen)
 SHA-512 process buffer. More...
 
void sha512_finish (sha512_context *ctx, unsigned char output[64])
 SHA-512 final digest. More...
 
void sha512 (const unsigned char *input, size_t ilen, unsigned char output[64], int is384)
 Output = SHA-512( input buffer ) More...
 
int sha512_file (const char *path, unsigned char output[64], int is384)
 Output = SHA-512( file contents ) More...
 
void sha512_process (sha512_context *ctx, const unsigned char data[128])
 

Macro Definition Documentation

#define POLARSSL_ERR_SHA512_FILE_IO_ERROR   -0x007A

Read/write error in file.

Definition at line 38 of file sha512.h.

#define UL64 (   x)    x##ULL

Definition at line 35 of file sha512.h.

Function Documentation

void sha512 ( const unsigned char *  input,
size_t  ilen,
unsigned char  output[64],
int  is384 
)

Output = SHA-512( input buffer )

Parameters
inputbuffer holding the data
ilenlength of the input data
outputSHA-384/512 checksum result
is3840 = use SHA512, 1 = use SHA384

Definition at line 336 of file sha512.c.

int sha512_file ( const char *  path,
unsigned char  output[64],
int  is384 
)

Output = SHA-512( file contents )

Parameters
pathinput file name
outputSHA-384/512 checksum result
is3840 = use SHA512, 1 = use SHA384
Returns
0 if successful, or POLARSSL_ERR_SHA512_FILE_IO_ERROR
void sha512_finish ( sha512_context ctx,
unsigned char  output[64] 
)

SHA-512 final digest.

Parameters
ctxSHA-512 context
outputSHA-384/512 checksum result

Definition at line 298 of file sha512.c.

void sha512_free ( sha512_context ctx)

Clear SHA-512 context.

Parameters
ctxSHA-512 context to be cleared

Definition at line 130 of file sha512.c.

void sha512_init ( sha512_context ctx)

Initialize SHA-512 context.

Parameters
ctxSHA-512 context to be initialized

Definition at line 125 of file sha512.c.

void sha512_process ( sha512_context ctx,
const unsigned char  data[128] 
)

Definition at line 174 of file sha512.c.

void sha512_starts ( sha512_context ctx,
int  is384 
)

SHA-512 context setup.

Parameters
ctxcontext to be initialized
is3840 = use SHA512, 1 = use SHA384

Definition at line 141 of file sha512.c.

void sha512_update ( sha512_context ctx,
const unsigned char *  input,
size_t  ilen 
)

SHA-512 process buffer.

Parameters
ctxSHA-512 context
inputbuffer holding the data
ilenlength of the input data

Definition at line 246 of file sha512.c.