Lines Matching +full:sha +full:- +full:256
1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * SHA-224 and SHA-256 Secure Hash Algorithm.
11 * Copyright (c) Jean-Luc Cooke <jlcooke@certainkey.com>
27 #include "octeon-crypto.h"
30 * We pass everything as 64-bit. OCTEON can handle misaligned data.
35 u64 *hash = (u64 *)sctx->state; in octeon_sha256_store_hash()
45 u64 *hash = (u64 *)sctx->state; in octeon_sha256_read_hash()
74 partial = sctx->count % SHA256_BLOCK_SIZE; in __octeon_sha256_update()
75 sctx->count += len; in __octeon_sha256_update()
81 done = -partial; in __octeon_sha256_update()
82 memcpy(sctx->buf + partial, data, in __octeon_sha256_update()
84 src = sctx->buf; in __octeon_sha256_update()
95 memcpy(sctx->buf + partial, src, len - done); in __octeon_sha256_update()
110 if ((sctx->count % SHA256_BLOCK_SIZE) + len < SHA256_BLOCK_SIZE) in octeon_sha256_update()
137 bits = cpu_to_be64(sctx->count << 3); in octeon_sha256_final()
140 index = sctx->count & 0x3f; in octeon_sha256_final()
141 pad_len = (index < 56) ? (56 - index) : ((64+56) - index); in octeon_sha256_final()
156 dst[i] = cpu_to_be32(sctx->state[i]); in octeon_sha256_final()
203 .cra_driver_name= "octeon-sha256",
216 .cra_driver_name= "octeon-sha224",
225 return -ENOTSUPP; in octeon_sha256_mod_init()
240 MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm (OCTEON)");