api.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_CRYPTO_API_H
#define _SYS_CRYPTO_API_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
typedef long crypto_req_id_t;
typedef void *crypto_bc_t;
typedef void *crypto_context_t;
typedef void *crypto_ctx_template_t;
typedef uint32_t crypto_call_flag_t;
/* crypto_call_flag's values */
typedef struct {
void (*cr_callback_func)(void *, int);
void *cr_callback_arg;
/*
* Returns the mechanism type corresponding to a mechanism name.
*/
/*
* Create and destroy context templates.
*/
/*
* Single and multi-part digest operations.
*/
/*
* Single and multi-part MAC operations.
*/
/*
* Single and multi-part sign with private key operations.
*/
/*
* Single and multi-part verify with public key operations.
*/
/*
* Single and multi-part encryption operations.
*/
/*
* Single and multi-part decryption operations.
*/
/*
*/
/*
*/
/*
* Routines to cancel a single asynchronous request or all asynchronous
* requests associated with a particular context.
*/
/*
* crypto_get_mech_list(9F) allocates and returns the list of currently
* supported cryptographic mechanisms.
*/
/*
* A kernel consumer can request to be notified when some particular event
* occurs. The valid events, callback function type, and functions to
* be called to register or unregister for notification are defined below.
*/
#define CRYPTO_EVENT_PROVIDERS_CHANGE 0x00000001
typedef enum crypto_provider_type {
/* The event_arg argument structure for CRYPTO_EVENT_PROVIDERS_CHANGE event */
typedef struct crypto_notify_event_change {
typedef void *crypto_notify_handle_t;
extern void crypto_unnotify_events(crypto_notify_handle_t);
/*
* crypto_bufcall(9F) group of routines.
*/
extern crypto_bc_t crypto_bufcall_alloc(void);
/*
* To obtain the list of key size ranges supported by a mechanism.
*/
#define CRYPTO_MECH_USAGE_ENCRYPT 0x00000001
#define CRYPTO_MECH_USAGE_DECRYPT 0x00000002
#define CRYPTO_MECH_USAGE_MAC 0x00000004
typedef uint32_t crypto_mech_usage_t;
typedef struct crypto_mechanism_info {
extern int crypto_get_all_mech_info(crypto_mech_type_t,
crypto_mechanism_info_t **, uint_t *, int);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_CRYPTO_API_H */