4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or https://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 2022 Tino Reichardt <milky-zfs@mcmilk.de>
30 #include <sys/types.h>
40 #define SHA224_BLOCK_LENGTH 64
41 #define SHA256_BLOCK_LENGTH 64
42 #define SHA384_BLOCK_LENGTH 128
43 #define SHA512_BLOCK_LENGTH 128
45 #define SHA224_DIGEST_LENGTH 28
46 #define SHA256_DIGEST_LENGTH 32
47 #define SHA384_DIGEST_LENGTH 48
48 #define SHA512_DIGEST_LENGTH 64
50 #define SHA512_224_DIGEST_LENGTH 28
51 #define SHA512_256_DIGEST_LENGTH 32
53 #define SHA256_HMAC_BLOCK_SIZE 64
54 #define SHA512_HMAC_BLOCK_SIZE 128
62 /* const sha256_ops_t *ops */
72 /* const sha256_ops_t *ops */
87 /* SHA2 algorithm types */
88 typedef enum sha2_mech_type
{
89 SHA512_HMAC_MECH_INFO_TYPE
, /* SUN_CKM_SHA512_HMAC */
91 /* Not true KCF mech types; used by direct callers to SHA2Init */
97 /* SHA2 Init function */
98 extern void SHA2Init(int algotype
, SHA2_CTX
*ctx
);
100 /* SHA2 Update function */
101 extern void SHA2Update(SHA2_CTX
*ctx
, const void *data
, size_t len
);
103 /* SHA2 Final function */
104 extern void SHA2Final(void *digest
, SHA2_CTX
*ctx
);
110 #endif /* SYS_SHA2_H */