1*ba5f469cSkrishna /*
2*ba5f469cSkrishna  * CDDL HEADER START
3*ba5f469cSkrishna  *
4*ba5f469cSkrishna  * The contents of this file are subject to the terms of the
5*ba5f469cSkrishna  * Common Development and Distribution License (the "License").
6*ba5f469cSkrishna  * You may not use this file except in compliance with the License.
7*ba5f469cSkrishna  *
8*ba5f469cSkrishna  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*ba5f469cSkrishna  * or http://www.opensolaris.org/os/licensing.
10*ba5f469cSkrishna  * See the License for the specific language governing permissions
11*ba5f469cSkrishna  * and limitations under the License.
12*ba5f469cSkrishna  *
13*ba5f469cSkrishna  * When distributing Covered Code, include this CDDL HEADER in each
14*ba5f469cSkrishna  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*ba5f469cSkrishna  * If applicable, add the following below this CDDL HEADER, with the
16*ba5f469cSkrishna  * fields enclosed by brackets "[]" replaced with your own identifying
17*ba5f469cSkrishna  * information: Portions Copyright [yyyy] [name of copyright owner]
18*ba5f469cSkrishna  *
19*ba5f469cSkrishna  * CDDL HEADER END
20*ba5f469cSkrishna  */
21*ba5f469cSkrishna 
22*ba5f469cSkrishna /*
23*ba5f469cSkrishna  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24*ba5f469cSkrishna  * Use is subject to license terms.
25*ba5f469cSkrishna  */
26*ba5f469cSkrishna 
27*ba5f469cSkrishna #ifndef	_KERNEL_SOFT_COMMON_H
28*ba5f469cSkrishna #define	_KERNEL_SOFT_COMMON_H
29*ba5f469cSkrishna 
30*ba5f469cSkrishna #ifdef __cplusplus
31*ba5f469cSkrishna extern "C" {
32*ba5f469cSkrishna #endif
33*ba5f469cSkrishna 
34*ba5f469cSkrishna #include <sys/crypto/ioctl.h>
35*ba5f469cSkrishna #include <security/cryptoki.h>
36*ba5f469cSkrishna 
37*ba5f469cSkrishna #define	OP_INIT		0x01
38*ba5f469cSkrishna #define	OP_UPDATE	0x02
39*ba5f469cSkrishna #define	OP_FINAL 	0x04
40*ba5f469cSkrishna #define	OP_SINGLE 	0x08
41*ba5f469cSkrishna #define	OP_DIGEST	0x10
42*ba5f469cSkrishna #define	OP_SIGN		0x20
43*ba5f469cSkrishna #define	OP_VERIFY	0x40
44*ba5f469cSkrishna 
45*ba5f469cSkrishna void free_soft_ctx(void *s, int opflag);
46*ba5f469cSkrishna CK_RV do_soft_digest(void **s, CK_MECHANISM_PTR pMechanism, CK_BYTE_PTR pBuf,
47*ba5f469cSkrishna     CK_ULONG ulBufLen, CK_BYTE_PTR pDigest,
48*ba5f469cSkrishna     CK_ULONG_PTR pulDigestLen, int opflag);
49*ba5f469cSkrishna 
50*ba5f469cSkrishna CK_RV do_soft_hmac_init(void **s, CK_MECHANISM_PTR pMechanism, CK_BYTE_PTR kval,
51*ba5f469cSkrishna     CK_ULONG klen, int opflag);
52*ba5f469cSkrishna CK_RV do_soft_hmac_update(void **s, CK_BYTE_PTR pBuf,
53*ba5f469cSkrishna     CK_ULONG ulBufLen, int opflag);
54*ba5f469cSkrishna CK_RV do_soft_hmac_sign(void **s, CK_BYTE_PTR pBuf, CK_ULONG ulBufLen,
55*ba5f469cSkrishna     CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen, int opflag);
56*ba5f469cSkrishna CK_RV do_soft_hmac_verify(void **s, CK_BYTE_PTR pBuf, CK_ULONG ulBufLen,
57*ba5f469cSkrishna     CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen, int opflag);
58*ba5f469cSkrishna 
59*ba5f469cSkrishna #ifdef __cplusplus
60*ba5f469cSkrishna }
61*ba5f469cSkrishna #endif
62*ba5f469cSkrishna 
63*ba5f469cSkrishna #endif /* _KERNEL_SOFT_COMMON_H */
64