diff options
Diffstat (limited to 'source4/heimdal/lib/hcrypto/sha.h')
-rw-r--r-- | source4/heimdal/lib/hcrypto/sha.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source4/heimdal/lib/hcrypto/sha.h b/source4/heimdal/lib/hcrypto/sha.h index 39e33cf8d0..fbc1810b4a 100644 --- a/source4/heimdal/lib/hcrypto/sha.h +++ b/source4/heimdal/lib/hcrypto/sha.h @@ -43,6 +43,12 @@ #define SHA256_Init hc_SHA256_Init #define SHA256_Update hc_SHA256_Update #define SHA256_Final hc_SHA256_Final +#define SHA384_Init hc_SHA384_Init +#define SHA384_Update hc_SHA384_Update +#define SHA384_Final hc_SHA384_Final +#define SHA512_Init hc_SHA512_Init +#define SHA512_Update hc_SHA512_Update +#define SHA512_Final hc_SHA512_Final /* * SHA-1 @@ -80,4 +86,30 @@ void SHA256_Init (SHA256_CTX *); void SHA256_Update (SHA256_CTX *, const void *, size_t); void SHA256_Final (void *, SHA256_CTX *); +/* + * SHA-2 512 + */ + +#define SHA512_DIGEST_LENGTH 64 + +struct hc_sha512state { + uint64_t sz[2]; + uint64_t counter[8]; + unsigned char save[128]; +}; + +typedef struct hc_sha512state SHA512_CTX; + +void SHA512_Init (SHA512_CTX *); +void SHA512_Update (SHA512_CTX *, const void *, size_t); +void SHA512_Final (void *, SHA512_CTX *); + +#define SHA384_DIGEST_LENGTH 48 + +typedef struct hc_sha512state SHA384_CTX; + +void SHA384_Init (SHA384_CTX *); +void SHA384_Update (SHA384_CTX *, const void *, size_t); +void SHA384_Final (void *, SHA384_CTX *); + #endif /* HEIM_SHA_H */ |