bsafe2.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 1999-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* Copyright (C) RSA Data Security, Inc. created 1990, 1996. This is an
unpublished work protected as such under copyright law. This work
contains proprietary, confidential, and trade secret information of
RSA Data Security, Inc. Use, disclosure or reproduction without the
express written authorization of RSA Data Security, Inc. is
prohibited.
*/
#ifndef _BSAFE_H_
#define _BSAFE_H_ 1
#ifndef T_CALL
#define T_CALL
#endif
#include "atypes.h"
#ifdef __cplusplus
extern "C" {
#endif
#define BE_ALGORITHM_ALREADY_SET 0x0200
#define BE_ALGORITHM_INFO 0x0201
#define BE_ALGORITHM_NOT_INITIALIZED 0x0202
#define BE_ALGORITHM_NOT_SET 0x0203
#define BE_ALGORITHM_OBJ 0x0204
#define BE_ALG_OPERATION_UNKNOWN 0x0205
#define BE_ALLOC 0x0206
#define BE_CANCEL 0x0207
#define BE_DATA 0x0208
#define BE_EXPONENT_EVEN 0x0209
#define BE_EXPONENT_LEN 0x020a
#define BE_HARDWARE 0x020b
#define BE_INPUT_DATA 0x020c
#define BE_INPUT_LEN 0x020d
#define BE_KEY_ALREADY_SET 0x020e
#define BE_KEY_INFO 0x020f
#define BE_KEY_LEN 0x0210
#define BE_KEY_NOT_SET 0x0211
#define BE_KEY_OBJ 0x0212
#define BE_KEY_OPERATION_UNKNOWN 0x0213
#define BE_MEMORY_OBJ 0x0214
#define BE_MODULUS_LEN 0x0215
#define BE_NOT_INITIALIZED 0x0216
#define BE_NOT_SUPPORTED 0x0217
#define BE_OUTPUT_LEN 0x0218
#define BE_OVER_32K 0x0219
#define BE_RANDOM_NOT_INITIALIZED 0x021a
#define BE_RANDOM_OBJ 0x021b
#define BE_SIGNATURE 0x021c
#define BE_WRONG_ALGORITHM_INFO 0x021d
#define BE_WRONG_KEY_INFO 0x021e
#define BE_INPUT_COUNT 0x021f
#define BE_OUTPUT_COUNT 0x0220
#define BE_METHOD_NOT_IN_CHOOSER 0x221
typedef POINTER B_ALGORITHM_OBJ;
typedef struct B_ALGORITHM_METHOD B_ALGORITHM_METHOD;
typedef B_ALGORITHM_METHOD **B_ALGORITHM_CHOOSER;
/* Routines supplied by the implementor.
*/
/* The key object.
*/
/* The algorithm object.
*/
unsigned int B_IntegerBits PROTO_LIST ((unsigned char *, unsigned int));
/* Algorithm operations.
*/
((B_ALGORITHM_OBJ, unsigned char *, unsigned int, A_SURRENDER_CTX *));
((B_ALGORITHM_OBJ, unsigned char *, unsigned int, A_SURRENDER_CTX *));
((B_ALGORITHM_OBJ, const unsigned char *, unsigned int, A_SURRENDER_CTX *));
((B_ALGORITHM_OBJ, unsigned char *, unsigned int *, unsigned int,
A_SURRENDER_CTX *));
((B_ALGORITHM_OBJ, unsigned char *, unsigned int *, unsigned int,
unsigned char *, unsigned int, B_ALGORITHM_OBJ, A_SURRENDER_CTX *));
((B_ALGORITHM_OBJ, unsigned char *, unsigned int *, unsigned int,
((B_ALGORITHM_OBJ, unsigned char *, unsigned int *, unsigned int,
const unsigned char *, unsigned int, B_ALGORITHM_OBJ, A_SURRENDER_CTX *));
((B_ALGORITHM_OBJ, unsigned char *, unsigned int *, unsigned int,
A_SURRENDER_CTX *));
/* Information for password-based encryption (PBE) algorithms.
*/
typedef struct {
unsigned char *salt; /* salt value */
unsigned int iterationCount; /* iteration count */
} B_PBE_PARAMS;
/* Information for MAC algorithm.
*/
typedef struct {
unsigned int macLen; /* length of MAC value */
} B_MAC_PARAMS;
/* Information for BSAFE 1.x compatible encryption algorithms.
*/
typedef struct {
unsigned int threshold; /* share threshold */
/* Key Info Types.
*/
/* Algorithm Info Types.
*/
/* Algorithm methods for use int the algorithm chooser.
*/
#ifdef __cplusplus
}
#endif
#endif