GOST public key algorithm ENGINE donated to the OpenSSL by Cryptocom.
[openssl.git] / engines / ccgost / gostkeyx.h
1 #ifndef GOSTKEYX_H
2 #define GOSTKEYX_H
3 /**********************************************************************
4  *                             gostkeyx.h                            *
5  *             Copyright (c) 2005-2006 Cryptocom LTD                  *
6  *       This file is distributed under the same license as OpenSSL   *
7  *                                                                    *
8  *      Declaration of the key transport functions for GOST pkey methods  *
9  *                                                                                                                                        *
10  *          Requires OpenSSL 0.9.9 for compilation                    *
11  **********************************************************************/
12 #include <openssl/evp.h>
13 #include "gost89.h"
14 /* EVP_PKEY_METHOD callbacks */
15 /* From gost94_keyx.c */
16 int pkey_GOST94cp_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, const unsigned char* key, size_t key_len );
17 int pkey_GOST94cc_encrypt (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,  const unsigned char *   key,size_t key_len);
18
19 int pkey_GOST94cp_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, const unsigned char* in, size_t in_len );
20 int pkey_GOST94cc_decrypt (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,  const unsigned char *   in,size_t in_len);
21 /* From gost2001_keyx.c */
22 int pkey_GOST01cp_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, const unsigned char* key, size_t key_len );
23 int pkey_GOST01cc_encrypt (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen,  const unsigned char *   key,size_t key_len);
24
25 int pkey_GOST01cp_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, const unsigned char* in, size_t in_len );
26 int pkey_GOST01cc_decrypt (EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, const unsigned char *   in,size_t in_len);
27
28 /* Internal functions to make error processing happy */
29 int decrypt_cryptocom_key(unsigned char *sess_key,int max_key_len,
30                 const unsigned char *crypted_key,int crypted_key_len, gost_ctx *ctx);
31 int encrypt_cryptocom_key(const unsigned char *sess_key,int key_len,
32                 unsigned char *crypted_key, gost_ctx *ctx);
33 /*int compute_pair_key_le(unsigned char *pair_key,BIGNUM *pub_key,DH *dh) ;*/
34 /*
35  * Computes 256 bit key exchange key for CryptoCom variation of GOST 94
36  * algorithm
37  *//*
38 int make_gost_shared_key(DH *dh,EVP_PKEY *pubk,unsigned char *shared_key) ;
39 DH *make_ephemeral_key(EVP_PKEY *pubk,BIGNUM *ephemeral_key);
40 int make_cp_exchange_key(DH *dh,EVP_PKEY *pubk, unsigned char *shared_key);
41 */
42 #endif