gsasl  1.8.0
Functions
crypto.c File Reference
#include "internal.h"
#include "gc.h"

Go to the source code of this file.

Functions

int gsasl_nonce (char *data, size_t datalen)
int gsasl_random (char *data, size_t datalen)
int gsasl_md5 (const char *in, size_t inlen, char *out[16])
int gsasl_hmac_md5 (const char *key, size_t keylen, const char *in, size_t inlen, char *outhash[16])
int gsasl_sha1 (const char *in, size_t inlen, char *out[20])
int gsasl_hmac_sha1 (const char *key, size_t keylen, const char *in, size_t inlen, char *outhash[20])

Function Documentation

int gsasl_hmac_md5 ( const char *  key,
size_t  keylen,
const char *  in,
size_t  inlen,
char *  outhash[16] 
)

gsasl_hmac_md5:

Parameters:
keyinput character array with key to use.
keylenlength of input character array with key to use.
ininput character array of data to hash.
inlenlength of input character array of data to hash.
outhashnewly allocated character array with keyed hash of data.

Compute keyed checksum of data using HMAC-MD5. The buffer must be deallocated by the caller.

Return value: Returns GSASL_OK iff successful.

Definition at line 92 of file crypto.c.

int gsasl_hmac_sha1 ( const char *  key,
size_t  keylen,
const char *  in,
size_t  inlen,
char *  outhash[20] 
)

gsasl_hmac_sha1:

Parameters:
keyinput character array with key to use.
keylenlength of input character array with key to use.
ininput character array of data to hash.
inlenlength of input character array of data to hash.
outhashnewly allocated character array with keyed hash of data.

Compute keyed checksum of data using HMAC-SHA1. The buffer must be deallocated by the caller.

Return value: Returns GSASL_OK iff successful.

Since: 1.3

Definition at line 139 of file crypto.c.

int gsasl_md5 ( const char *  in,
size_t  inlen,
char *  out[16] 
)

gsasl_md5:

Parameters:
ininput character array of data to hash.
inlenlength of input character array of data to hash.
outnewly allocated character array with hash of data.

Compute hash of data using MD5. The buffer must be deallocated by the caller.

Return value: Returns GSASL_OK iff successful.

Definition at line 70 of file crypto.c.

int gsasl_nonce ( char *  data,
size_t  datalen 
)

gsasl_nonce:

Parameters:
dataoutput array to be filled with unpredictable random data.
datalensize of output array.

Store unpredictable data of given size in the provided buffer.

Return value: Returns GSASL_OK iff successful.

Definition at line 37 of file crypto.c.

int gsasl_random ( char *  data,
size_t  datalen 
)

gsasl_random:

Parameters:
dataoutput array to be filled with strong random data.
datalensize of output array.

Store cryptographically strong random data of given size in the provided buffer.

Return value: Returns GSASL_OK iff successful.

Definition at line 53 of file crypto.c.

int gsasl_sha1 ( const char *  in,
size_t  inlen,
char *  out[20] 
)

gsasl_sha1:

Parameters:
ininput character array of data to hash.
inlenlength of input character array of data to hash.
outnewly allocated character array with hash of data.

Compute hash of data using SHA1. The buffer must be deallocated by the caller.

Return value: Returns GSASL_OK iff successful.

Since: 1.3

Definition at line 115 of file crypto.c.