RSA BSAFE Cert-C Micro Edition

The power of PKI for the smallest of devices

nat_meth.h

Go to the documentation of this file.
00001 /* $Id: nat_meth.h,v 1.24 2002/07/28 22:36:14 mfscott Exp $ */
00002 /*
00003  * Copyright (C) 1998-2002 RSA Security Inc. All rights reserved.
00004  *
00005  * This work contains proprietary information of RSA Security.
00006  * Distribution is limited to authorized licensees of RSA
00007  * Security. Any unauthorized reproduction, distribution or
00008  * modification of this work is strictly prohibited.
00009  *
00010  */
00011 /**
00012  * @file nat_meth.h
00013  * This file contains the methods and functions used for the native
00014  * implementations of the cryptographic module. Functions in this
00015  * file should not be called directly.
00016  */
00017 
00018 #ifndef HEADER_COMMON_NAT_METH_H
00019 #define HEADER_COMMON_NAT_METH_H
00020 
00021 #ifdef  __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 typedef const void *(R_CR_IMPL_RETRIEVER_FUNC)(void);
00026 
00027 /**
00028  * This structure is used for implementing method objects.
00029  */
00030 struct r_cr_imp_method_st
00031 {
00032     /**
00033      * The cryptographic operation identifier.
00034      * @see @ref R_CR_TYPE.
00035      */
00036     int type;                           /* algorithm type */
00037     /**
00038      * The cryptographic identifier.
00039      * @see @ref R_CR_IDS.
00040      */
00041     int id;                             /* specific algorithm */
00042     /**
00043      * The cryptographic operation subtype identifier.
00044      * @see @ref R_CR_SUB.
00045      */
00046     int sub;                            /* algortihm subtype */
00047     /**
00048      * The pointer to the specific method used by <i>id</i>,<i>type</i> and
00049      * <i>sub</i>.
00050      */
00051     R_CR_IMPL_RETRIEVER_FUNC *imp_meth; /* retrieve pointer to specific */
00052                                         /* implementation */
00053     /**
00054      * The cryptographic implemenation-dependent data.
00055      */
00056     const void *imp_meth_data;          /* generic data   */
00057 };
00058 
00059 
00060 /* asymetric methods */
00061 R_CR_IMPL_RETRIEVER_FUNC r_crn_asym_rsa;
00062 R_CR_IMPL_RETRIEVER_FUNC r_crn_asym_rsa_public;
00063 R_CR_IMPL_RETRIEVER_FUNC r_crn_asym_rsa_private;
00064 R_CR_IMPL_RETRIEVER_FUNC r_crn_asym_rsa_pkcs1;
00065 R_CR_IMPL_RETRIEVER_FUNC r_crn_asym_rsa_pkcs1_public;
00066 R_CR_IMPL_RETRIEVER_FUNC r_crn_asym_rsa_pkcs1_private;
00067 R_CR_IMPL_RETRIEVER_FUNC r_crn_asym_rsa_pkcs1_oaep;
00068 R_CR_IMPL_RETRIEVER_FUNC r_crn_asym_rsa_pkcs1_oaep_pub;
00069 R_CR_IMPL_RETRIEVER_FUNC r_crn_asym_rsa_pkcs1_oaep_priv;
00070 R_CR_IMPL_RETRIEVER_FUNC r_crn_asym_rsa_pkcs1_ssl;
00071 
00072 /* symmetric cipher methods */
00073 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_null;
00074 
00075 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_cbc;
00076 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_ede;
00077 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_ede3;
00078 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_cfb;
00079 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_ede_cfb;
00080 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_ede3_cfb;
00081 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_ofb;
00082 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_ede_ofb;
00083 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_ede3_ofb;
00084 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_ede_cbc;
00085 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_ede3_cbc;
00086 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_ecb;
00087 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_40_cbc;
00088 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_des_40_cfb;
00089 
00090 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc2_cbc;
00091 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc2_ecb;
00092 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc2_cfb;
00093 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc2_ofb;
00094 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc2_40_cbc;
00095 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc2_64_cbc;
00096 
00097 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc4;
00098 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc4_40;
00099 
00100 /**
00101  * X86 CPU methods
00102  */
00103 #ifdef CPU_X86
00104 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc4_586;
00105 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc4_40_586;
00106 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc4_686;
00107 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc4_40_686;
00108 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc4_786;
00109 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc4_40_786;
00110 #endif
00111 
00112 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc5f_cbc;
00113 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc5_cbc;
00114 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc5_ecb;
00115 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc5_cfb;
00116 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc5_ofb;
00117 
00118 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc6_cbc;
00119 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc6_ecb;
00120 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc6_cfb;
00121 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc6_ofb;
00122 
00123 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc6_s_cbc;
00124 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc6_s_ecb;
00125 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc6_s_cfb;
00126 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_rc6_s_ofb;
00127 
00128 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_cbc;
00129 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_ecb;
00130 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_cfb;
00131 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_ofb;
00132 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_m_cbc;
00133 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_m_ecb;
00134 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_m_cfb;
00135 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_m_ofb;
00136 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_s_cbc;
00137 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_s_ecb;
00138 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_s_cfb;
00139 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes128_s_ofb;
00140 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_cbc;
00141 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_ecb;
00142 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_cfb;
00143 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_ofb;
00144 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_m_cbc;
00145 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_m_ecb;
00146 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_m_cfb;
00147 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_m_ofb;
00148 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_s_cbc;
00149 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_s_ecb;
00150 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_s_cfb;
00151 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes192_s_ofb;
00152 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_cbc;
00153 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_ecb;
00154 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_cfb;
00155 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_ofb;
00156 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_m_cbc;
00157 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_m_ecb;
00158 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_m_cfb;
00159 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_m_ofb;
00160 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_s_cbc;
00161 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_s_ecb;
00162 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_s_cfb;
00163 R_CR_IMPL_RETRIEVER_FUNC r_crn_ciph_aes256_s_ofb;
00164 
00165 /* hash mac digests */
00166 R_CR_IMPL_RETRIEVER_FUNC r_crn_hmac_md5;
00167 R_CR_IMPL_RETRIEVER_FUNC r_crn_hmac_sha1;
00168 
00169 /* digests */
00170 R_CR_IMPL_RETRIEVER_FUNC r_crn_dgst_sha1;
00171 R_CR_IMPL_RETRIEVER_FUNC r_crn_dgst_sha2_256;
00172 R_CR_IMPL_RETRIEVER_FUNC r_crn_dgst_sha2_384;
00173 R_CR_IMPL_RETRIEVER_FUNC r_crn_dgst_sha2_512;
00174 R_CR_IMPL_RETRIEVER_FUNC r_crn_dgst_null;
00175 R_CR_IMPL_RETRIEVER_FUNC r_crn_dgst_md2;
00176 R_CR_IMPL_RETRIEVER_FUNC r_crn_dgst_md5;
00177 
00178 /* signature methods table */
00179 R_CR_IMPL_RETRIEVER_FUNC r_crn_sign_vfy;
00180 
00181 /* random methods */
00182 R_CR_IMPL_RETRIEVER_FUNC r_crn_random_mth;
00183 R_CR_IMPL_RETRIEVER_FUNC r_crn_random_sys_mth;
00184 
00185 /* key exchange methods */
00186 R_CR_IMPL_RETRIEVER_FUNC r_crn_ke_