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