Lines Matching defs:sha

26 #include <crypto/sha.h>
129 struct ccp_sha_op sha;
157 /* The CCP cannot perform zero-length sha operations so the caller
159 * sha operation for a message with a total length of zero is valid
328 | (op->u.sha.type << REQ1_SHA_TYPE_SHIFT)
338 cr[4] = lower_32_bits(op->u.sha.msg_bits);
339 cr[5] = upper_32_bits(op->u.sha.msg_bits);
1363 struct ccp_sha_engine *sha = &cmd->u.sha;
1369 if (sha->ctx_len != CCP_SHA_CTXSIZE)
1372 if (!sha->ctx)
1375 if (!sha->final && (sha->src_len & (CCP_SHA_BLOCKSIZE - 1)))
1378 if (!sha->src_len) {
1382 if (!sha->final)
1385 /* CCP can't do a zero length sha operation so the caller
1388 if (sha->msg_bits)
1391 /* A sha operation for a message with a total length of zero,
1394 switch (sha->type) {
1408 scatterwalk_map_and_copy((void *)sha_zero, sha->ctx, 0,
1409 sha->ctx_len, 1);
1414 if (!sha->src)
1423 op.u.sha.type = sha->type;
1424 op.u.sha.msg_bits = sha->msg_bits;
1436 if (sha->first) {
1439 switch (sha->type) {
1455 ccp_set_dm_area(&ctx, 0, sha->ctx, 0, sha->ctx_len);
1465 ret = ccp_init_data(&src, cmd_q, sha->src, sha->src_len,
1472 if (sha->final && !src.sg_wa.bytes_left)
1494 ccp_get_dm_area(&ctx, 0, sha->ctx, 0, sha->ctx_len);
1496 if (sha->final && sha->opad) {
1503 switch (sha->type) {
1521 if (sha->opad_len != block_size) {
1533 scatterwalk_map_and_copy(hmac_buf, sha->opad, 0, block_size, 0);
1538 hmac_cmd.u.sha.type = sha->type;
1539 hmac_cmd.u.sha.ctx = sha->ctx;
1540 hmac_cmd.u.sha.ctx_len = sha->ctx_len;
1541 hmac_cmd.u.sha.src = &sg;
1542 hmac_cmd.u.sha.src_len = block_size + digest_size;
1543 hmac_cmd.u.sha.opad = NULL;
1544 hmac_cmd.u.sha.opad_len = 0;
1545 hmac_cmd.u.sha.first = 1;
1546 hmac_cmd.u.sha.final = 1;
1547 hmac_cmd.u.sha.msg_bits = (block_size + digest_size) << 3;