/*** SHA384 ***/ static OSStatus HashSHA384Init(SSLBuffer *digestCtx, SSLContext *sslCtx) { assert(digestCtx->length >= sizeof(CC_SHA512_CTX)); CC_SHA512_CTX *ctx = (CC_SHA512_CTX *)digestCtx->data; CC_SHA384_Init(ctx); dgprintf(("###HashSHA384Init ctx %p\n", ctx)); return noErr; }
static int _do_reset(void) { dgprintf( "##Reseting ...\n\n" ); __wdt_select_extalclk(); __wdt_select_clk_div64(); __wdt_set_data(100); __wdt_set_count(0); __tcu_start_wdt_clock(); __wdt_start(); REG_EMC_DMCR |= EMC_DMCR_RMODE | EMC_DMCR_RFSH; dgprintf("To exit\n"); //while(1); dgprintf("*** reset failed ***\n"); return 0; }
static OSStatus HashSHA384Final(SSLBuffer *digestCtx, SSLBuffer *digest) { assert(digestCtx->length >= sizeof(CC_SHA512_CTX)); CC_SHA512_CTX *ctx = (CC_SHA512_CTX *)digestCtx->data; dgprintf(("###HashSHA384Final ctx %p\n", ctx)); assert(digest->length >= CC_SHA384_DIGEST_LENGTH); //if (digest->length < CC_SHA384_DIGEST_LENGTH) // return errSSLCrypto; CC_SHA384_Final(digest->data, ctx); digest->length = CC_SHA384_DIGEST_LENGTH; return noErr; }
static OSStatus HashSHA384Clone(const SSLBuffer *src, SSLBuffer *dst) { CC_SHA512_CTX *srcCtx; CC_SHA512_CTX *dstCtx; assert(src->length >= sizeof(CC_SHA512_CTX)); assert(dst->length >= sizeof(CC_SHA512_CTX)); srcCtx = (CC_SHA512_CTX *)src->data; dstCtx = (CC_SHA512_CTX *)dst->data; dgprintf(("###HashSHA384Clone srcCtx %p dstCtx %p\n", srcCtx, dstCtx)); memcpy(dstCtx, srcCtx, sizeof(CC_SHA512_CTX)); return noErr; }