1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 #ifndef _SHS_DEFINED 3 4 #include "crypto_int.h" 5 6 #define _SHS_DEFINED 7 8 /* Some useful types */ 9 10 typedef krb5_octet SHS_BYTE; 11 typedef krb5_ui_4 SHS_LONG; 12 13 /* Define the following to use the updated SHS implementation */ 14 #define NEW_SHS /**/ 15 16 /* The SHS block size and message digest sizes, in bytes */ 17 18 #define SHS_DATASIZE 64 19 #define SHS_DIGESTSIZE 20 20 21 /* The structure for storing SHS info */ 22 23 typedef struct { 24 SHS_LONG digest[ 5 ]; /* Message digest */ 25 SHS_LONG countLo, countHi; /* 64-bit bit count */ 26 SHS_LONG data[ 16 ]; /* SHS data buffer */ 27 } SHS_INFO; 28 29 /* Message digest functions (shs.c) */ 30 void shsInit(SHS_INFO *shsInfo); 31 void shsUpdate(SHS_INFO *shsInfo, const SHS_BYTE *buffer, unsigned int count); 32 void shsFinal(SHS_INFO *shsInfo); 33 34 35 /* Keyed Message digest functions (hmac_sha.c) */ 36 krb5_error_code hmac_sha(krb5_octet *text, 37 int text_len, 38 krb5_octet *key, 39 int key_len, 40 krb5_octet *digest); 41 42 43 #define NIST_SHA_CKSUM_LENGTH SHS_DIGESTSIZE 44 #define HMAC_SHA_CKSUM_LENGTH SHS_DIGESTSIZE 45 46 #endif /* _SHS_DEFINED */ 47