Lines Matching refs:tctx
462 static void tgr192_transform(struct tgr192_ctx *tctx, const u8 * data) in tgr192_transform() argument
472 a = aa = tctx->a; in tgr192_transform()
473 b = bb = tctx->b; in tgr192_transform()
474 c = cc = tctx->c; in tgr192_transform()
488 tctx->a = a; in tgr192_transform()
489 tctx->b = b; in tgr192_transform()
490 tctx->c = c; in tgr192_transform()
495 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_init() local
497 tctx->a = 0x0123456789abcdefULL; in tgr192_init()
498 tctx->b = 0xfedcba9876543210ULL; in tgr192_init()
499 tctx->c = 0xf096a5b4c3b2e187ULL; in tgr192_init()
500 tctx->nblocks = 0; in tgr192_init()
501 tctx->count = 0; in tgr192_init()
512 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_update() local
514 if (tctx->count == 64) { /* flush the buffer */ in tgr192_update()
515 tgr192_transform(tctx, tctx->hash); in tgr192_update()
516 tctx->count = 0; in tgr192_update()
517 tctx->nblocks++; in tgr192_update()
522 if (tctx->count) { in tgr192_update()
523 for (; len && tctx->count < 64; len--) { in tgr192_update()
524 tctx->hash[tctx->count++] = *inbuf++; in tgr192_update()
534 tgr192_transform(tctx, inbuf); in tgr192_update()
535 tctx->count = 0; in tgr192_update()
536 tctx->nblocks++; in tgr192_update()
540 for (; len && tctx->count < 64; len--) { in tgr192_update()
541 tctx->hash[tctx->count++] = *inbuf++; in tgr192_update()
552 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_final() local
561 t = tctx->nblocks; in tgr192_final()
567 if ((lsb = t + tctx->count) < t) { /* add the count */ in tgr192_final()
576 if (tctx->count < 56) { /* enough room */ in tgr192_final()
577 tctx->hash[tctx->count++] = 0x01; /* pad */ in tgr192_final()
578 while (tctx->count < 56) { in tgr192_final()
579 tctx->hash[tctx->count++] = 0; /* pad */ in tgr192_final()
582 tctx->hash[tctx->count++] = 0x01; /* pad character */ in tgr192_final()
583 while (tctx->count < 64) { in tgr192_final()
584 tctx->hash[tctx->count++] = 0; in tgr192_final()
587 memset(tctx->hash, 0, 56); /* fill next block with zeroes */ in tgr192_final()
590 le32p = (__le32 *)&tctx->hash[56]; in tgr192_final()
594 tgr192_transform(tctx, tctx->hash); in tgr192_final()
596 be64p = (__be64 *)tctx->hash; in tgr192_final()
597 dst[0] = be64p[0] = cpu_to_be64(tctx->a); in tgr192_final()
598 dst[1] = be64p[1] = cpu_to_be64(tctx->b); in tgr192_final()
599 dst[2] = be64p[2] = cpu_to_be64(tctx->c); in tgr192_final()