toolkit.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 1999-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Cylink Corporation � 1998
*
* This software is licensed by Cylink to the Internet Software Consortium to
* promote implementation of royalty free public key cryptography within IETF
* standards. Cylink wishes to expressly thank the contributions of Dr.
* Martin Hellman, Whitfield Diffie, Ralph Merkle and Stanford University for
* their contributions to Internet Security. In accordance with the terms of
* this license, ISC is authorized to distribute and sublicense this software
* for the practice of IETF standards.
*
* The software includes BigNum, written by Colin Plumb and licensed by Philip
* R. Zimmermann for royalty free use and distribution with Cylink's
* software. Use of BigNum as a stand alone product or component is
* specifically prohibited.
*
* Disclaimer of All Warranties. THIS SOFTWARE IS BEING PROVIDED "AS IS",
* WITHOUT ANY EXPRESSED OR IMPLIED WARRANTY OF ANY KIND WHATSOEVER. IN
* PARTICULAR, WITHOUT LIMITATION ON THE GENERALITY OF THE FOREGOING, CYLINK
* MAKES NO REPRESENTATION OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
* PURPOSE.
*
* Cylink or its representatives shall not be liable for tort, indirect,
* special or consequential damages such as loss of profits or loss of
* goodwill from the use or inability to use the software for any purpose or
* for any reason whatsoever.
*
* EXPORT LAW: Export of the Foundations Suite may be subject to compliance
* with the rules and regulations promulgated from time to time by the Bureau
* of Export Administration, United States Department of Commerce, which
* restrict the export and re-export of certain products and technical data.
* If the export of the Foundations Suite is controlled under such rules and
* regulations, then the Foundations Suite shall not be exported or
* re-exported, directly or indirectly, (a) without all export or re-export
* licenses and governmental approvals required by any applicable laws, or (b)
* in violation of any applicable prohibition against the export or re-export
* of any part of the Foundations Suite. All export licenses for software
* containing the Foundations Suite are the sole responsibility of the licensee.
*/
/****************************************************************************
* FILENAME: toolkit.h PRODUCT NAME: CRYPTOGRAPHIC TOOLKIT
*
* FILE STATUS:
*
* DESCRIPTION: Cryptographic Toolkit Functions Header File
*
* USAGE: File should be included to use Toolkit Functions
*
*
* Copyright (c) Cylink Corporation 1994. All rights reserved.
*
* REVISION HISTORY:
*
* 23 Aug 94 KPZ Initial release
* 24 Sep 94 KPZ Added prototypes of Toolkit functions
* 14 Oct 94 GKL Second version (big endian support)
* 08 Dec 94 GKL Added YIELD_context to GenDSSParameters
*
****************************************************************************/
#ifndef TOOLKIT_H /* Prevent multiple inclusions of same header file */
#define TOOLKIT_H
#pragma ident "%Z%%M% %I% %E% SMI"
/* Error types */
#define SUCCESS 0 /* no errors */
/* additional error types for CEPA */
/* Lengths of variables */
/* Number of random bases for Miller test */
#define TEST_COUNT 40
#define LITTLE_ORDER 0
#define BIG_ORDER 1
/* Key lengths */ /* add to toolkit.h */
#define CEPA_MAX_ROUNDS 12
/* Operation codes for MultiPrecArithm() */
#define EXPO 0x21
#define MUL 0x22
/*#define ADD 0x23*/
/****************************************************************************
* INCLUDE FILES
****************************************************************************/
/* system files */
#include "cylink.h"
#include "ctk_endian.h"
/* callback function */
#ifdef VXD
typedef int (* YIELD_PROC)( void );
#else
typedef int (* YIELD_PROC)(int ); /*TKL00601*/
#endif
typedef struct { /*TKL00601*/
void * handle; /* Application specific information */
/* Secure Hash Algorithm structure */
typedef struct
{
} SHA_context;
#ifdef __cplusplus
extern "C" {
#endif
/* Copy Cylink DSS Common Parameters */ /*TKL01201*/
/* Compute a Secure Hash Function */
uchar *hash_result );
/* Initialize Secure Hash Function */
/* Update Secure Hash Function */
/* Finalize Secure Hash Function */
uchar *hash_result );
/* Compute a DSS Signature */
uchar *hash_result );
/* Verify a DSS Signature */
/* Initialize Random number Generator */
/* Generate random number */
/* Generate secret number */
/* Compute a Diffie-Hellman Shared number */
uchar *DH_modulus );
/* Set Key by Diffie_Hellman shared number */
uchar *K );
/* Expand DES key */
/* Encrypt a block of data with single DES */
/* Decrypt a block of data with single DES */
/* One-Time-Pad Signature with a Diffie-Hellman shared number */
/* Compute a Diffie-Hellman pair */
/* Generate DSS Common Parameters */
/* Produce a Shamir Key-Sharing Triplet for Secret Number */
/* Reconstract a Secret Number from Shamir Key-Sharing Duplex */
uchar *SecretNumber );
/* Check DES key weakness */
/* Non-Pipelined Triple DES encrypt*/
/* Non-Pipelined Triple DES decrypt*/
/*Pipeline Triple DES encrypt*/
/*Pipeline Triple DES decrypt*/
uchar *expanded_key );
u_int16_t r,
u_int16_t r,
void BigNumInit(void);
uchar *DH_modulus);
uchar *expanded_key );
ord *Z);
ord *Z);
ord *Z);
#ifdef __cplusplus
}
#endif
#endif /* TOOLKIT_H */