NETCalcHMAC*

C Specification

#include <revolution/net.h>

void NETCalcHMACMD5(void *digest, const void *data, u32 dataLength, const void *key, u32 keyLength);
void NETCalcHMACSHA1(void *digest, const void *data, u32 dataLength, const void *key, u32 keyLength);

Arguments

digest Pointer to the memory location that holds the calculated keyed-hash value.
data Pointer to the input data.
dataLength Size of the input data.
key Pointer to the key.
keyLength The key size.

Return Values

None.

Description

This function calculates a hash message authentication code (HMAC) using MD5 or SHA-1. The length of the hash with a generated key differs depending on the algorithm selected. Pass a memory region with enough capacity to store the hash value to digest argument.
For the hash length associated with each algorithm, see the item hash algorithm.

Any size and alignment position can be used for the input data and key. However, if the key is smaller than the hash length, intensity weakens, but even if it is larger than the hash length, it does not contribute too much to intensity strength.

A stack having a size equivalent to the context structure plus about 100 bytes is used for internal processing. Make sure sufficient stack is available when calling.
HMAC is a keyed-hashing algorithm for message authentication. For details, see RFC 2104.

See Also

Hash algorithm

Revision History

2007/10/31 Changed argument types.
2006/09/01 Initial version.


CONFIDENTIAL