Lines Matching refs:hs
300 struct xec_symcr_hash_session *hs = NULL; in xec_symcr_do_hash() local
310 hs = (struct xec_symcr_hash_session *)ctx->drv_sessn_state; in xec_symcr_do_hash()
311 c = &hs->mhctx; in xec_symcr_do_hash()
312 cstate = &hs->mhstate; in xec_symcr_do_hash()
314 if (!hs->open) { in xec_symcr_do_hash()
324 if (!finish && ((hs->blklen + pkt->in_len) < hs->blksz)) { in xec_symcr_do_hash()
325 memcpy(&hs->blockbuf[hs->blklen], pkt->in_buf, pkt->in_len); in xec_symcr_do_hash()
326 hs->blklen += pkt->in_len; in xec_symcr_do_hash()
330 ret = init_rom_hash_context(hs->rom_algo, c); in xec_symcr_do_hash()
344 rem_len = pkt->in_len & (hs->blksz - 1u); in xec_symcr_do_hash()
345 fill_len = pkt->in_len & ~(hs->blksz - 1u); in xec_symcr_do_hash()
346 if (hs->blklen) { in xec_symcr_do_hash()
347 fill_len = ((hs->blklen + pkt->in_len) & ~(hs->blksz - 1u)) - hs->blklen; in xec_symcr_do_hash()
352 if (hs->blklen) { in xec_symcr_do_hash()
353 ret = mchp_xec_rom_hash_feed_wrapper(c, (const uint8_t *)hs->blockbuf, hs->blklen); in xec_symcr_do_hash()
358 hs->blklen = 0; /* consumed */ in xec_symcr_do_hash()
386 hs->blklen = 0; in xec_symcr_do_hash()
388 memcpy(hs->blockbuf, &pkt->in_buf[fill_len], rem_len); in xec_symcr_do_hash()
389 hs->blklen = rem_len; in xec_symcr_do_hash()
399 struct xec_symcr_hash_session *hs = NULL; in xec_symcr_hash_session_begin() local
423 hs = &data->hash_sessions[session_idx]; in xec_symcr_hash_session_begin()
425 hs->algo = algo; in xec_symcr_hash_session_begin()
426 hs->rom_algo = rom_algo; in xec_symcr_hash_session_begin()
427 hs->open = false; in xec_symcr_hash_session_begin()
428 hs->blklen = 0; in xec_symcr_hash_session_begin()
429 hs->blksz = hash_block_size(algo); in xec_symcr_hash_session_begin()
431 ctx->drv_sessn_state = hs; in xec_symcr_hash_session_begin()
442 c = &hs->mhctx; in xec_symcr_hash_session_begin()
443 cstate = &hs->mhstate; in xec_symcr_hash_session_begin()
445 ret = init_rom_hash_context(hs->rom_algo, c); in xec_symcr_hash_session_begin()
451 ret = mchp_xec_rom_hash_init_state_wrapper(c, cstate, hs->statebuf); in xec_symcr_hash_session_begin()
456 hs->open = true; in xec_symcr_hash_session_begin()
472 struct xec_symcr_hash_session *hs = NULL; in xec_symcr_hash_session_free() local
481 hs = (struct xec_symcr_hash_session *)ctx->drv_sessn_state; in xec_symcr_hash_session_free()
483 memset(hs, 0, sizeof(struct xec_symcr_hash_session)); in xec_symcr_hash_session_free()