Lines Matching +full:sha +full:- +full:512

1 // SPDX-License-Identifier: GPL-2.0-only
6 * Copyright (c) Jean-Luc Cooke <jlcooke@certainkey.com>
34 if ((sctx->count[0] += len) < len) in __sha512_sparc64_update()
35 sctx->count[1]++; in __sha512_sparc64_update()
37 done = SHA512_BLOCK_SIZE - partial; in __sha512_sparc64_update()
38 memcpy(sctx->buf + partial, data, done); in __sha512_sparc64_update()
39 sha512_sparc64_transform(sctx->state, sctx->buf, 1); in __sha512_sparc64_update()
41 if (len - done >= SHA512_BLOCK_SIZE) { in __sha512_sparc64_update()
42 const unsigned int rounds = (len - done) / SHA512_BLOCK_SIZE; in __sha512_sparc64_update()
44 sha512_sparc64_transform(sctx->state, data + done, rounds); in __sha512_sparc64_update()
48 memcpy(sctx->buf, data + done, len - done); in __sha512_sparc64_update()
55 unsigned int partial = sctx->count[0] % SHA512_BLOCK_SIZE; in sha512_sparc64_update()
59 if ((sctx->count[0] += len) < len) in sha512_sparc64_update()
60 sctx->count[1]++; in sha512_sparc64_update()
61 memcpy(sctx->buf + partial, data, len); in sha512_sparc64_update()
77 bits[1] = cpu_to_be64(sctx->count[0] << 3); in sha512_sparc64_final()
78 bits[0] = cpu_to_be64(sctx->count[1] << 3 | sctx->count[0] >> 61); in sha512_sparc64_final()
81 index = sctx->count[0] % SHA512_BLOCK_SIZE; in sha512_sparc64_final()
82 padlen = (index < 112) ? (112 - index) : ((SHA512_BLOCK_SIZE+112) - index); in sha512_sparc64_final()
86 if ((sctx->count[0] += padlen) < padlen) in sha512_sparc64_final()
87 sctx->count[1]++; in sha512_sparc64_final()
88 memcpy(sctx->buf + index, padding, padlen); in sha512_sparc64_final()
96 dst[i] = cpu_to_be64(sctx->state[i]); in sha512_sparc64_final()
124 .cra_driver_name= "sha512-sparc64",
139 .cra_driver_name= "sha384-sparc64",
173 pr_info("Using sparc64 sha512 opcode optimized SHA-512/SHA-384 implementation\n"); in sha512_sparc64_mod_init()
177 return -ENODEV; in sha512_sparc64_mod_init()
190 MODULE_DESCRIPTION("SHA-384 and SHA-512 Secure Hash Algorithm, sparc64 sha512 opcode accelerated");