/home/dko/projects/mobilec/trunk/src/security/xyssl-0.9/include/xyssl/sha4.h File Reference
Go to the source code of this file.
 
Data Structures
 
Defines
 
Functions
  SHA-512 context setup. 
  SHA-512 process buffer. 
  SHA-512 final digest. 
 void 
sha4 (unsigned char *input, 
int ilen, unsigned char output[64], 
int is384)
  Output = SHA-512( input buffer ). 
  Output = SHA-512( file contents ). 
  SHA-512 HMAC context setup. 
  SHA-512 HMAC process buffer. 
  SHA-512 HMAC final digest. 
 void 
sha4_hmac (unsigned char *key, 
int keylen, unsigned char *input, 
int ilen, unsigned char output[64], 
int is384)
  Output = HMAC-SHA-512( hmac key, input buffer ). 
  Checkup routine. 
Detailed Description
Definition in file sha4.h.
Define Documentation
 
  #define UL64 
 (
 x 
  
  ) 
   x##ULL
 
 
 
 
Function Documentation
 
  void sha4 
 (
 unsigned char * 
  input, 
 
 
  
 
 unsigned char 
  output[64], 
 
 
  
 )
  
 
 
 
Output = SHA-512( input buffer ). 
- Parameters:
- 
 
  input buffer holding the data   ilen length of the input data   output SHA-384/512 checksum result   is384 0 = use SHA512, 1 = use SHA384  
 
 
 
  int sha4_file 
 (
 char * 
  
path, 
 
 
  
 
 unsigned char 
  output[64], 
 
 
  
 )
  
 
 
 
Output = SHA-512( file contents ). 
- Parameters:
- 
 
  path input file name   output SHA-384/512 checksum result   is384 0 = use SHA512, 1 = use SHA384 
- Returns:
- 0 if successful, 1 if fopen failed, or 2 if fread failed 
 
 
 
 
  
 
 unsigned char 
  output[64] 
 
  
 )
  
 
 
 
SHA-512 final digest. 
- Parameters:
- 
 
  ctx SHA-512 context   output SHA-384/512 checksum result  
 
 
 
  void sha4_hmac 
 (
 unsigned char * 
  key, 
 
 
  
 
 unsigned char * 
  input, 
 
 
  
 
 unsigned char 
  output[64], 
 
 
  
 )
  
 
 
 
Output = HMAC-SHA-512( hmac key, input buffer ). 
- Parameters:
- 
 
  key HMAC secret key   keylen length of the HMAC key   input buffer holding the data   ilen length of the input data   output HMAC-SHA-384/512 result   is384 0 = use SHA512, 1 = use SHA384  
 
 
 
 
  
 
 unsigned char 
  output[64] 
 
  
 )
  
 
 
 
SHA-512 HMAC final digest. 
- Parameters:
- 
 
  ctx HMAC context   output SHA-384/512 HMAC checksum result  
 
 
SHA-512 HMAC context setup. 
- Parameters:
- 
 
  ctx HMAC context to be initialized   is384 0 = use SHA512, 1 = use SHA384   key HMAC secret key   keylen length of the HMAC key  
 
 
SHA-512 HMAC process buffer. 
- Parameters:
- 
 
  ctx HMAC context   input buffer holding the data   ilen length of the input data  
 
 
 
  int sha4_self_test 
 (
 
int 
  verbose 
  ) 
 
 
 
 
 
Checkup routine. 
- Returns:
- 0 if successful, or 1 if the test failed 
Referenced by main().
 
 
SHA-512 context setup. 
- Parameters:
- 
 
  ctx context to be initialized   is384 0 = use SHA512, 1 = use SHA384  
 
 
SHA-512 process buffer. 
- Parameters:
- 
 
  ctx SHA-512 context   input buffer holding the data   ilen length of the input data