Lines Matching refs:tctx

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