Lines Matching refs:tctx
466 static void tgr192_transform(struct tgr192_ctx *tctx, const u8 * data) in tgr192_transform() argument
477 a = aa = tctx->a; in tgr192_transform()
478 b = bb = tctx->b; in tgr192_transform()
479 c = cc = tctx->c; in tgr192_transform()
493 tctx->a = a; in tgr192_transform()
494 tctx->b = b; in tgr192_transform()
495 tctx->c = c; in tgr192_transform()
500 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_init() local
502 tctx->a = 0x0123456789abcdefULL; in tgr192_init()
503 tctx->b = 0xfedcba9876543210ULL; in tgr192_init()
504 tctx->c = 0xf096a5b4c3b2e187ULL; in tgr192_init()
505 tctx->nblocks = 0; in tgr192_init()
506 tctx->count = 0; in tgr192_init()
517 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_update() local
519 if (tctx->count == 64) { /* flush the buffer */ in tgr192_update()
520 tgr192_transform(tctx, tctx->hash); in tgr192_update()
521 tctx->count = 0; in tgr192_update()
522 tctx->nblocks++; in tgr192_update()
527 if (tctx->count) { in tgr192_update()
528 for (; len && tctx->count < 64; len--) { in tgr192_update()
529 tctx->hash[tctx->count++] = *inbuf++; in tgr192_update()
539 tgr192_transform(tctx, inbuf); in tgr192_update()
540 tctx->count = 0; in tgr192_update()
541 tctx->nblocks++; in tgr192_update()
545 for (; len && tctx->count < 64; len--) { in tgr192_update()
546 tctx->hash[tctx->count++] = *inbuf++; in tgr192_update()
557 struct tgr192_ctx *tctx = shash_desc_ctx(desc); in tgr192_final() local
566 t = tctx->nblocks; in tgr192_final()
572 if ((lsb = t + tctx->count) < t) { /* add the count */ in tgr192_final()
581 if (tctx->count < 56) { /* enough room */ in tgr192_final()
582 tctx->hash[tctx->count++] = 0x01; /* pad */ in tgr192_final()
583 while (tctx->count < 56) { in tgr192_final()
584 tctx->hash[tctx->count++] = 0; /* pad */ in tgr192_final()
587 tctx->hash[tctx->count++] = 0x01; /* pad character */ in tgr192_final()
588 while (tctx->count < 64) { in tgr192_final()
589 tctx->hash[tctx->count++] = 0; in tgr192_final()
592 memset(tctx->hash, 0, 56); /* fill next block with zeroes */ in tgr192_final()
595 le32p = (__le32 *)&tctx->hash[56]; in tgr192_final()
599 tgr192_transform(tctx, tctx->hash); in tgr192_final()
601 be64p = (__be64 *)tctx->hash; in tgr192_final()
602 dst[0] = be64p[0] = cpu_to_be64(tctx->a); in tgr192_final()
603 dst[1] = be64p[1] = cpu_to_be64(tctx->b); in tgr192_final()
604 dst[2] = be64p[2] = cpu_to_be64(tctx->c); in tgr192_final()