Lines Matching refs:sctx

32 static void octeon_sha512_store_hash(struct sha512_state *sctx)  in octeon_sha512_store_hash()  argument
34 write_octeon_64bit_hash_sha512(sctx->state[0], 0); in octeon_sha512_store_hash()
35 write_octeon_64bit_hash_sha512(sctx->state[1], 1); in octeon_sha512_store_hash()
36 write_octeon_64bit_hash_sha512(sctx->state[2], 2); in octeon_sha512_store_hash()
37 write_octeon_64bit_hash_sha512(sctx->state[3], 3); in octeon_sha512_store_hash()
38 write_octeon_64bit_hash_sha512(sctx->state[4], 4); in octeon_sha512_store_hash()
39 write_octeon_64bit_hash_sha512(sctx->state[5], 5); in octeon_sha512_store_hash()
40 write_octeon_64bit_hash_sha512(sctx->state[6], 6); in octeon_sha512_store_hash()
41 write_octeon_64bit_hash_sha512(sctx->state[7], 7); in octeon_sha512_store_hash()
44 static void octeon_sha512_read_hash(struct sha512_state *sctx) in octeon_sha512_read_hash() argument
46 sctx->state[0] = read_octeon_64bit_hash_sha512(0); in octeon_sha512_read_hash()
47 sctx->state[1] = read_octeon_64bit_hash_sha512(1); in octeon_sha512_read_hash()
48 sctx->state[2] = read_octeon_64bit_hash_sha512(2); in octeon_sha512_read_hash()
49 sctx->state[3] = read_octeon_64bit_hash_sha512(3); in octeon_sha512_read_hash()
50 sctx->state[4] = read_octeon_64bit_hash_sha512(4); in octeon_sha512_read_hash()
51 sctx->state[5] = read_octeon_64bit_hash_sha512(5); in octeon_sha512_read_hash()
52 sctx->state[6] = read_octeon_64bit_hash_sha512(6); in octeon_sha512_read_hash()
53 sctx->state[7] = read_octeon_64bit_hash_sha512(7); in octeon_sha512_read_hash()
78 static void __octeon_sha512_update(struct sha512_state *sctx, const u8 *data, in __octeon_sha512_update() argument
86 index = sctx->count[0] % SHA512_BLOCK_SIZE; in __octeon_sha512_update()
89 if ((sctx->count[0] += len) < len) in __octeon_sha512_update()
90 sctx->count[1]++; in __octeon_sha512_update()
96 memcpy(&sctx->buf[index], data, part_len); in __octeon_sha512_update()
97 octeon_sha512_transform(sctx->buf); in __octeon_sha512_update()
109 memcpy(&sctx->buf[index], &data[i], len - i); in __octeon_sha512_update()
115 struct sha512_state *sctx = shash_desc_ctx(desc); in octeon_sha512_update() local
124 if ((sctx->count[0] % SHA512_BLOCK_SIZE) + len < SHA512_BLOCK_SIZE) in octeon_sha512_update()
128 octeon_sha512_store_hash(sctx); in octeon_sha512_update()
130 __octeon_sha512_update(sctx, data, len); in octeon_sha512_update()
132 octeon_sha512_read_hash(sctx); in octeon_sha512_update()
140 struct sha512_state *sctx = shash_desc_ctx(desc); in octeon_sha512_final() local
151 bits[1] = cpu_to_be64(sctx->count[0] << 3); in octeon_sha512_final()
152 bits[0] = cpu_to_be64(sctx->count[1] << 3 | sctx->count[0] >> 61); in octeon_sha512_final()
155 index = sctx->count[0] & 0x7f; in octeon_sha512_final()
159 octeon_sha512_store_hash(sctx); in octeon_sha512_final()
161 __octeon_sha512_update(sctx, padding, pad_len); in octeon_sha512_final()
164 __octeon_sha512_update(sctx, (const u8 *)bits, sizeof(bits)); in octeon_sha512_final()
166 octeon_sha512_read_hash(sctx); in octeon_sha512_final()
171 dst[i] = cpu_to_be64(sctx->state[i]); in octeon_sha512_final()
174 memset(sctx, 0, sizeof(struct sha512_state)); in octeon_sha512_final()