• Home
  • Raw
  • Download

Lines Matching refs:sctx

31 static void octeon_sha1_store_hash(struct sha1_state *sctx)  in octeon_sha1_store_hash()  argument
33 u64 *hash = (u64 *)sctx->state; in octeon_sha1_store_hash()
37 } hash_tail = { { sctx->state[4], } }; in octeon_sha1_store_hash()
45 static void octeon_sha1_read_hash(struct sha1_state *sctx) in octeon_sha1_read_hash() argument
47 u64 *hash = (u64 *)sctx->state; in octeon_sha1_read_hash()
56 sctx->state[4] = hash_tail.word[0]; in octeon_sha1_read_hash()
76 struct sha1_state *sctx = shash_desc_ctx(desc); in octeon_sha1_init() local
78 sctx->state[0] = SHA1_H0; in octeon_sha1_init()
79 sctx->state[1] = SHA1_H1; in octeon_sha1_init()
80 sctx->state[2] = SHA1_H2; in octeon_sha1_init()
81 sctx->state[3] = SHA1_H3; in octeon_sha1_init()
82 sctx->state[4] = SHA1_H4; in octeon_sha1_init()
83 sctx->count = 0; in octeon_sha1_init()
88 static void __octeon_sha1_update(struct sha1_state *sctx, const u8 *data, in __octeon_sha1_update() argument
95 partial = sctx->count % SHA1_BLOCK_SIZE; in __octeon_sha1_update()
96 sctx->count += len; in __octeon_sha1_update()
103 memcpy(sctx->buffer + partial, data, in __octeon_sha1_update()
105 src = sctx->buffer; in __octeon_sha1_update()
116 memcpy(sctx->buffer + partial, src, len - done); in __octeon_sha1_update()
122 struct sha1_state *sctx = shash_desc_ctx(desc); in octeon_sha1_update() local
131 if ((sctx->count % SHA1_BLOCK_SIZE) + len < SHA1_BLOCK_SIZE) in octeon_sha1_update()
135 octeon_sha1_store_hash(sctx); in octeon_sha1_update()
137 __octeon_sha1_update(sctx, data, len); in octeon_sha1_update()
139 octeon_sha1_read_hash(sctx); in octeon_sha1_update()
147 struct sha1_state *sctx = shash_desc_ctx(desc); in octeon_sha1_final() local
158 bits = cpu_to_be64(sctx->count << 3); in octeon_sha1_final()
161 index = sctx->count & 0x3f; in octeon_sha1_final()
165 octeon_sha1_store_hash(sctx); in octeon_sha1_final()
167 __octeon_sha1_update(sctx, padding, pad_len); in octeon_sha1_final()
170 __octeon_sha1_update(sctx, (const u8 *)&bits, sizeof(bits)); in octeon_sha1_final()
172 octeon_sha1_read_hash(sctx); in octeon_sha1_final()
177 dst[i] = cpu_to_be32(sctx->state[i]); in octeon_sha1_final()
180 memset(sctx, 0, sizeof(*sctx)); in octeon_sha1_final()
187 struct sha1_state *sctx = shash_desc_ctx(desc); in octeon_sha1_export() local
189 memcpy(out, sctx, sizeof(*sctx)); in octeon_sha1_export()
195 struct sha1_state *sctx = shash_desc_ctx(desc); in octeon_sha1_import() local
197 memcpy(sctx, in, sizeof(*sctx)); in octeon_sha1_import()