X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/3e170ce000f1506b7b5d2c5c7faec85ceabb573d..3903760236c30e3b5ace7a4eefac3a269d68957c:/libkern/crypto/corecrypto_sha2.c?ds=inline diff --git a/libkern/crypto/corecrypto_sha2.c b/libkern/crypto/corecrypto_sha2.c index 3143c0161..786a895b2 100644 --- a/libkern/crypto/corecrypto_sha2.c +++ b/libkern/crypto/corecrypto_sha2.c @@ -31,6 +31,8 @@ #include #include +#if defined(CRYPTO_SHA2) + void SHA256_Init(SHA256_CTX *ctx) { const struct ccdigest_info *di; @@ -115,3 +117,25 @@ void SHA512_Final(void *digest, SHA512_CTX *ctx) ccdigest_final(di, ctx->ctx, digest); } + +#else + +/* As these are part of the KPI, we need to stub them out for any kernle cofiguration that does not support SHA2. */ + +void SHA384_Init(__unused SHA384_CTX *ctx) +{ + panic("SHA384_Init"); +} + +void SHA384_Update(__unused SHA384_CTX *ctx, __unused const void *data, __unused size_t len) +{ + panic("SHA384_Update"); +} + +void SHA384_Final(__unused void *digest, __unused SHA384_CTX *ctx) +{ + panic("SHA384_Final"); +} + +#endif +