diff --git a/gen164/5/shax.c b/gen164/5/shax.c index 0c4f0e3065..02724cf8d6 100644 --- a/gen164/5/shax.c +++ b/gen164/5/shax.c @@ -5,9 +5,11 @@ #include "all.h" #include "../pit.h" -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - +#if defined(U2_OS_osx) +#include +#else #include +#endif /* functions */ @@ -21,11 +23,19 @@ u2_bytes(0, met_w, fat_y, a); { c3_y dig_y[32]; +#if defined(U2_OS_osx) + CC_SHA256_CTX ctx_h; + + CC_SHA256_Init(&ctx_h); + CC_SHA256_Update(&ctx_h, fat_y, met_w); + CC_SHA256_Final(dig_y, &ctx_h); +#else SHA256_CTX ctx_h; SHA256_Init(&ctx_h); SHA256_Update(&ctx_h, fat_y, met_w); SHA256_Final(dig_y, &ctx_h); +#endif free(fat_y); return u2_rl_bytes(wir_r, 32, dig_y); } @@ -42,11 +52,19 @@ u2_bytes(0, a, fat_y, b); { c3_y dig_y[64]; +#if defined(U2_OS_osx) + CC_SHA512_CTX ctx_h; + + CC_SHA512_Init(&ctx_h); + CC_SHA512_Update(&ctx_h, fat_y, a); + CC_SHA512_Final(dig_y, &ctx_h); +#else SHA512_CTX ctx_h; SHA512_Init(&ctx_h); SHA512_Update(&ctx_h, fat_y, a); SHA512_Final(dig_y, &ctx_h); +#endif free(fat_y); return u2_rl_bytes(wir_r, 64, dig_y); }