• Home
  • Raw
  • Download

Lines Matching refs:sctx

36 static void octeon_sha256_store_hash(struct sha256_state *sctx)  in octeon_sha256_store_hash()  argument
38 u64 *hash = (u64 *)sctx->state; in octeon_sha256_store_hash()
46 static void octeon_sha256_read_hash(struct sha256_state *sctx) in octeon_sha256_read_hash() argument
48 u64 *hash = (u64 *)sctx->state; in octeon_sha256_read_hash()
72 struct sha256_state *sctx = shash_desc_ctx(desc); in octeon_sha224_init() local
74 sctx->state[0] = SHA224_H0; in octeon_sha224_init()
75 sctx->state[1] = SHA224_H1; in octeon_sha224_init()
76 sctx->state[2] = SHA224_H2; in octeon_sha224_init()
77 sctx->state[3] = SHA224_H3; in octeon_sha224_init()
78 sctx->state[4] = SHA224_H4; in octeon_sha224_init()
79 sctx->state[5] = SHA224_H5; in octeon_sha224_init()
80 sctx->state[6] = SHA224_H6; in octeon_sha224_init()
81 sctx->state[7] = SHA224_H7; in octeon_sha224_init()
82 sctx->count = 0; in octeon_sha224_init()
89 struct sha256_state *sctx = shash_desc_ctx(desc); in octeon_sha256_init() local
91 sctx->state[0] = SHA256_H0; in octeon_sha256_init()
92 sctx->state[1] = SHA256_H1; in octeon_sha256_init()
93 sctx->state[2] = SHA256_H2; in octeon_sha256_init()
94 sctx->state[3] = SHA256_H3; in octeon_sha256_init()
95 sctx->state[4] = SHA256_H4; in octeon_sha256_init()
96 sctx->state[5] = SHA256_H5; in octeon_sha256_init()
97 sctx->state[6] = SHA256_H6; in octeon_sha256_init()
98 sctx->state[7] = SHA256_H7; in octeon_sha256_init()
99 sctx->count = 0; in octeon_sha256_init()
104 static void __octeon_sha256_update(struct sha256_state *sctx, const u8 *data, in __octeon_sha256_update() argument
111 partial = sctx->count % SHA256_BLOCK_SIZE; in __octeon_sha256_update()
112 sctx->count += len; in __octeon_sha256_update()
119 memcpy(sctx->buf + partial, data, in __octeon_sha256_update()
121 src = sctx->buf; in __octeon_sha256_update()
132 memcpy(sctx->buf + partial, src, len - done); in __octeon_sha256_update()
138 struct sha256_state *sctx = shash_desc_ctx(desc); in octeon_sha256_update() local
147 if ((sctx->count % SHA256_BLOCK_SIZE) + len < SHA256_BLOCK_SIZE) in octeon_sha256_update()
151 octeon_sha256_store_hash(sctx); in octeon_sha256_update()
153 __octeon_sha256_update(sctx, data, len); in octeon_sha256_update()
155 octeon_sha256_read_hash(sctx); in octeon_sha256_update()
163 struct sha256_state *sctx = shash_desc_ctx(desc); in octeon_sha256_final() local
174 bits = cpu_to_be64(sctx->count << 3); in octeon_sha256_final()
177 index = sctx->count & 0x3f; in octeon_sha256_final()
181 octeon_sha256_store_hash(sctx); in octeon_sha256_final()
183 __octeon_sha256_update(sctx, padding, pad_len); in octeon_sha256_final()
186 __octeon_sha256_update(sctx, (const u8 *)&bits, sizeof(bits)); in octeon_sha256_final()
188 octeon_sha256_read_hash(sctx); in octeon_sha256_final()
193 dst[i] = cpu_to_be32(sctx->state[i]); in octeon_sha256_final()
196 memset(sctx, 0, sizeof(*sctx)); in octeon_sha256_final()
215 struct sha256_state *sctx = shash_desc_ctx(desc); in octeon_sha256_export() local
217 memcpy(out, sctx, sizeof(*sctx)); in octeon_sha256_export()
223 struct sha256_state *sctx = shash_desc_ctx(desc); in octeon_sha256_import() local
225 memcpy(sctx, in, sizeof(*sctx)); in octeon_sha256_import()