libnds
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
sha1.h File Reference

DSi SHA1 functions. More...

#include <stddef.h>
#include <nds/ndstypes.h>

Data Structures

struct  swiSHA1context
 Context that holds information about an active SHA1 calculation. More...
 

Typedefs

typedef struct swiSHA1context swiSHA1context_t
 Context that holds information about an active SHA1 calculation.
 

Functions

void swiSHA1Calc (void *digest, const void *data, size_t len)
 SHA-1 checksum.
 
void swiSHA1Final (void *digest, swiSHA1context_t *ctx)
 SHA-1 final digest.
 
void swiSHA1Init (swiSHA1context_t *ctx)
 SHA-1 context setup.
 
void swiSHA1Update (swiSHA1context_t *ctx, const void *data, size_t len)
 SHA-1 process buffer.
 
int swiSHA1Verify (const void *digest1, const void *digest2)
 SHA-1 verify.
 

Detailed Description

DSi SHA1 functions.

Function Documentation

◆ swiSHA1Calc()

void swiSHA1Calc ( void *  digest,
const void *  data,
size_t  len 
)

SHA-1 checksum.

Parameters
digestBuffer to hold SHA-1 checksum result.
dataBuffer to process.
lenLength of data.

◆ swiSHA1Final()

void swiSHA1Final ( void *  digest,
swiSHA1context_t ctx 
)

SHA-1 final digest.

Parameters
digestBuffer to hold SHA-1 checksum result
ctxSHA-1 context

◆ swiSHA1Init()

void swiSHA1Init ( swiSHA1context_t ctx)

SHA-1 context setup.

Parameters
ctxContext to be initialized

◆ swiSHA1Update()

void swiSHA1Update ( swiSHA1context_t ctx,
const void *  data,
size_t  len 
)

SHA-1 process buffer.

Parameters
ctxSHA-1 context.
dataBuffer to process.
lenLength of data.

◆ swiSHA1Verify()

int swiSHA1Verify ( const void *  digest1,
const void *  digest2 
)

SHA-1 verify.

Parameters
digest1Buffer containing hash to verify.
digest2Buffer containing hash to verify.
Returns
1 if they match, else 0. If either pointer is NULL it returns 0.