Browse Source

[core] define SHA*_DIGEST_LENGTH macros if missing

master
Glenn Strauss 2 months ago
parent
commit
5ec13918d3
1 changed files with 14 additions and 3 deletions
  1. +14
    -3
      src/sys-crypto-md.h

+ 14
- 3
src/sys-crypto-md.h View File

@ -104,9 +104,6 @@ SHA256_Update(SHA256_CTX *ctx, const void *data, size_t length)
}
#define USE_LIB_CRYPTO_SHA512_256
#ifndef SHA512_256_DIGEST_LENGTH
#define SHA512_256_DIGEST_LENGTH 32
#endif
typedef struct sha512_256_ctx SHA512_CTX; /*(yes, SHA512_CTX)*/
static inline int
SHA512_256_Init(SHA512_CTX *ctx)
@ -679,4 +676,18 @@ NSS_gen_hashfuncs(SHA256, HASH_AlgSHA256);
#endif
#ifdef USE_LIB_CRYPTO_SHA256
#ifndef SHA256_DIGEST_LENGTH
#define SHA256_DIGEST_LENGTH 32
#endif
#endif
#ifdef USE_LIB_CRYPTO_SHA512_256
#ifndef SHA512_256_DIGEST_LENGTH
#define SHA512_256_DIGEST_LENGTH 32
#endif
#endif
#endif /* LI_SYS_CRYPTO_MD_H */

Loading…
Cancel
Save