libalpm
Arch Linux Package Manager Library
Data Structures | Functions
sha2.h File Reference
#include <string.h>
Include dependency graph for sha2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sha2_context
 SHA-256 context structure. More...

Functions

void sha2 (const unsigned char *input, size_t ilen, unsigned char output[32], int is224)
 Output = SHA-256( input buffer )
int sha2_file (const char *path, unsigned char output[32], int is224)
 Output = SHA-256( file contents )

Function Documentation

void sha2 ( const unsigned char *  input,
size_t  ilen,
unsigned char  output[32],
int  is224 
)

Output = SHA-256( input buffer )

Parameters:
inputbuffer holding the data
ilenlength of the input data
outputSHA-224/256 checksum result
is2240 = use SHA256, 1 = use SHA224

Definition at line 328 of file sha2.c.

int sha2_file ( const char *  path,
unsigned char  output[32],
int  is224 
)

Output = SHA-256( file contents )

Parameters:
pathinput file name
outputSHA-224/256 checksum result
is2240 = use SHA256, 1 = use SHA224
Returns:
0 if successful, 1 if fopen failed, or 2 if fread failed

Definition at line 343 of file sha2.c.

Referenced by alpm_compute_sha256sum().

Here is the caller graph for this function: