Home | History | Annotate | Download | only in crc

Lines Matching refs:sctx

230 void fio_sha256_init(struct fio_sha256_ctx *sctx)
232 sctx->state[0] = H0;
233 sctx->state[1] = H1;
234 sctx->state[2] = H2;
235 sctx->state[3] = H3;
236 sctx->state[4] = H4;
237 sctx->state[5] = H5;
238 sctx->state[6] = H6;
239 sctx->state[7] = H7;
240 sctx->count = 0;
243 void fio_sha256_update(struct fio_sha256_ctx *sctx, const uint8_t *data,
249 partial = sctx->count & 0x3f;
250 sctx->count += len;
257 memcpy(sctx->buf + partial, data, done + 64);
258 src = sctx->buf;
262 sha256_transform(sctx->state, src);
269 memcpy(sctx->buf + partial, src, len - done);
272 void fio_sha256_final(struct fio_sha256_ctx *sctx)
280 bits = (uint64_t) sctx->count << 3;
283 index = sctx->count & 0x3f;
285 fio_sha256_update(sctx, padding, pad_len);
288 fio_sha256_update(sctx, (const uint8_t *)&bits, sizeof(bits));
292 sctx->buf[i] = sctx->state[i];