RSA BSAFE Cert-C Micro Edition

The power of PKI for the smallest of devices

cryp_mod.h

Go to the documentation of this file.
00001 /* $Id: cryp_mod.h,v 1.109.2.2 2002/12/16 06:04:46 cmueller 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 /**
00013  * @file cryp_mod.h
00014  * This file contains the public definitions and function
00015  * declarations of the cryptographic module.
00016  *
00017  * @see @ref CRYPTO_DIGEST_SIZE, @ref CRYPTO_CIPHER_SIZE, 
00018  * @ref CRYPTO_ALG_SUP_RET, @ref R_CR_IDS, @ref R_CR_TYPE,
00019  * @ref R_CR_SUB, @ref R_CR_INFO_ID, @ref R_CR_FLAG
00020  * and @ref CRYPTO_CTX_INFO.
00021  */
00022 
00023 #ifndef HEADER_COMMON_CRYP_MOD_H
00024 #define HEADER_COMMON_CRYP_MOD_H
00025 
00026 #ifdef  __cplusplus
00027 extern "C" {
00028 #endif
00029 
00030 #include "r_lib.h"
00031 #include "r_com.h"
00032 #include "r_nid.h"
00033 #include "r_pkey.h"
00034 #include "r_skey.h"
00035 
00036 #include "nat_meth.h"
00037 /**
00038  * @defgroup CRYPTO_MODULE Cryptographic Module Operations
00039  * This section details the resources, functions, types and identifiers
00040  * used by the cryptographic module.
00041  * @{
00042  */
00043 /**
00044  * Indicates the type of the cryptographic algorithm identifier.
00045  * See @ref R_CR_IDS for more information.
00046  */
00047 typedef int R_CR_ALG_ID;
00048 /**
00049  * Indicates the type of the cryptographic algorithm operation type.
00050  * See @ref R_CR_TYPE for more information.
00051  */
00052 typedef int R_CR_ALG_TYPE;
00053 /**
00054  * Indicates the type of the cryptographic algorithm operation subtype.
00055  * See @ref R_CR_SUB for more information.
00056  */
00057 typedef int R_CR_ALG_SUB;
00058 
00059 /**
00060  * @}
00061  */
00062 /**
00063  * @defgroup CRYP_OBJ_ID Cryptographic Object Identifiers
00064  * This section contains the identifiers used in the creation of a 
00065  * cryptographic object. The instantiation of a new cryptographic 
00066  * object requires three components:<br>
00067  * <li> The algorithm operation type.</li>
00068  * <li> The algorithm operation subtype.</li>
00069  * <li> The algorithm identifier.</li>
00070  *
00071  * @ingroup CRYPTO_MODULE
00072  * @{
00073  */
00074 /**
00075  * @}
00076  */
00077 /**
00078  * @defgroup CRYPTO_DIGEST_SIZE Cryptographic Digest Size Defines
00079  * This section details the hash functions, message digests and digital
00080  * signature defines used by the cryptographic library.
00081  * @ingroup CRYPTO_MODULE
00082  *
00083  * @{
00084  */
00085 /**
00086  * Indicates the length of the generated MD5 digest.
00087  */
00088 #define R_CR_DIGEST_MD5_LEN                 16
00089 /**
00090  * Indicates the length of the generated SHA-1 digest.
00091  */
00092 #define R_CR_DIGEST_SHA1_LEN                20
00093 /**
00094  * Indicates the length of the generated SHA-256 digest.
00095  */
00096 #define R_CR_DIGEST_SHA256_LEN              32
00097 /**
00098  * Indicates the length of the generated SHA-384 digest.
00099  */
00100 #define R_CR_DIGEST_SHA384_LEN              48
00101 /**
00102  * Indicates the length of the generated SHA-512 digest.
00103  */
00104 #define R_CR_DIGEST_SHA512_LEN              64
00105 #ifndef NO_SHA512
00106 /**
00107  * Indicates the maximum length of the available digest types.
00108  */
00109 #define R_CR_DIGEST_MAX_LEN                 R_CR_DIGEST_SHA512_LEN
00110 #elif !defined(NO_SHA384)
00111 #define R_CR_DIGEST_MAX_LEN                 R_CR_DIGEST_SHA384_LEN
00112 #elif !defined(NO_SHA256)
00113 #define R_CR_DIGEST_MAX_LEN                 R_CR_DIGEST_SHA256_LEN
00114 #elif !defined(NO_SHA1)
00115 #define R_CR_DIGEST_MAX_LEN                 R_CR_DIGEST_SHA1_LEN
00116 #elif !defined(NO_MD5)
00117 #define R_CR_DIGEST_MAX_LEN                 R_CR_DIGEST_MD5_LEN
00118 #else 
00119 #define R_CR_DIGEST_MAX_LEN                 16
00120 #endif
00121 /**
00122  * @}
00123  */
00124 /**
00125  * @defgroup CRYPTO_CIPHER_SIZE Cryptographic Symmetric Cipher Size Defines
00126  * This section details the symmetric cipher key and Initialization Vector (IV)
00127  * lengths utilized by the cryptographic library.
00128  * @ingroup CRYPTO_MODULE
00129  * @{
00130  */
00131 /**
00132  * Indicates the maximum symmetric cipher key length.
00133  */
00134 #define R_CR_CIPHER_KEY_MAX_LEN             32 /* AES is the biggest */
00135 /**
00136  * Indicates the maximum symmetric cipher Initialization Vector (IV) length.
00137  */
00138 #define R_CR_CIPHER_IV_MAX_LEN              32 /* AES is the biggest */
00139 
00140 /**
00141  * @}
00142  */
00143 
00144 /**
00145  * @defgroup CRYPTO_ALG_SUP_RET Cryptographic Algorithm Support Return Values
00146  * This section details the defines used in determining the availability
00147  * of algorithms at program run time.
00148  * @ingroup CRYPTO_MODULE
00149  * @{
00150  */
00151 /**
00152  * Indicates the algorithm availability status is not supported.
00153  */
00154 #define R_CR_NOT_SUPPORTED                  0
00155 /**
00156  * Indicates the algorithm availability status is not available.
00157  */
00158 #define R_CR_NOT_AVAIL                      1
00159 /**
00160  * Indicates the algorithm availability status is supported.
00161  */
00162 #define R_CR_SUPPORTED                      2
00163 
00164 /**
00165  * @}
00166  */
00167 
00168 /**
00169  * @defgroup R_CR_TYPE Operation Types
00170  * This section details the cryptographic algorithms and their
00171  * associated types.
00172  * The following table details the strings that are interpreted by
00173  * R_CR_TYPE_from_string() and output by R_CR_TYPE_to_string().
00174  * @br
00175  * <table><tr>
00176  * <td><b>Identifier</b></tr>
00177  * <td><b>String</b></tr>
00178  * </tr><tr>
00179  * <td>#R_CR_TYPE_NONE</td>
00180  * <td><tt>"NONE"</tt></td>
00181  * </tr><tr>
00182  * <td>#R_CR_TYPE_ASYM</td>
00183  * <td><tt>"ASYM"</tt></td>
00184  * </tr><tr>
00185  * <td>#R_CR_TYPE_CIPHER</td>
00186  * <td><tt>"CIPHER"</tt></td>
00187  * </tr><tr>
00188  * <td>#R_CR_TYPE_DIGEST</td>
00189  * <td><tt>"DIGEST"</tt></td>
00190  * </tr><tr>
00191  * <td>#R_CR_TYPE_RANDOM</td>
00192  * <td><tt>"RANDOM"</tt></td>
00193  * </tr><tr>
00194  * <td>#R_CR_TYPE_KEY_EXCHANGE</td>
00195  * <td><tt>"KEY_EXCHANGE"</tt></td>
00196  * </tr><tr>
00197  * <td>#R_CR_TYPE_SIGNATURE</td>
00198  * <td><tt>"SIGNATURE"</tt></td>
00199  * </tr><tr>
00200  * <td>#R_CR_TYPE_MAC</td>
00201  * <td><tt>"MAC"</tt></td>
00202  * </tr><tr>
00203  * <td>#R_CR_TYPE_KEYGEN</td>
00204  * <td><tt>"KEYGEN"</tt></td>
00205  * </tr><tr>
00206  * <td>#R_CR_TYPE_PARAMGEN</td>
00207  * <td><tt>"PARAMGEN"</tt></td>
00208  * </tr><tr>
00209  * <td>#R_CR_TYPE_MAX</td>
00210  * <td><tt>"MAX"</tt></td>
00211  * </tr><tr>
00212  * </tr></table>
00213  * @br
00214  *
00215  * @see R_CR_new() and R_CR_CTX_alg_supported().
00216  *
00217  * @ingroup CRYP_OBJ_ID
00218  * @{
00219  */
00220 /**
00221  * Indicates that the operation type is none.
00222  * The following table details the usage of the identifier
00223  * in @ref R_CR_CTX_FN.
00224  * @br
00225  * <table><tr>
00226  * <td><b>Function</b></td>
00227  * <td><b>String</b></td>
00228  * <td><b>Description</b></td>
00229  * </tr><tr>
00230  * <td>R_CR_TYPE_from_string()</td>
00231  * <td><tt>"NONE"</tt></td>
00232  * <td>This string is interpreted as the <tt>NONE</tt> type.</td>
00233  * </tr><tr>
00234  * <td>R_CR_TYPE_to_string()</td>
00235  * <td><tt>"NONE"</tt></td>
00236  * <td>The string that represents a <tt>NONE</tt> type.</td>
00237  * </tr></table>
00238  */
00239 #define R_CR_TYPE_NONE                      0
00240 /**
00241  * Indicates an asymmetric operation type.
00242  * The following table details the usage of the identifier
00243  * in @ref R_CR_CTX_FN.
00244  * @br
00245  * <table><tr>
00246  * <td><b>Function</b></td>
00247  * <td><b>String</b></td>
00248  * <td><b>Description</b></td>
00249  * </tr><tr>
00250  * <td>R_CR_TYPE_from_string()</td>
00251  * <td><tt>"ASYM"</tt></td>
00252  * <td>This string is interpreted as the <tt>ASYM</tt> type.</td>
00253  * </tr><tr>
00254  * <td>R_CR_TYPE_to_string()</td>
00255  * <td><tt>"ASYM"</tt></td>
00256  * <td>The string that represents an <tt>ASYM</tt> type.</td>
00257  * </tr></table>
00258  */
00259 #define R_CR_TYPE_ASYM                      1
00260 /**
00261  * Indicates a symmetric operation type.
00262  * The following table details the usage of the identifier
00263  * in @ref R_CR_CTX_FN.
00264  * @br
00265  * <table><tr>
00266  * <td><b>Function</b></td>
00267  * <td><b>String</b></td>
00268  * <td><b>Description</b></td>
00269  * </tr><tr>
00270  * <td>R_CR_TYPE_from_string()</td>
00271  * <td><tt>"CIPHER"</tt></td>
00272  * <td>This string is interpreted as the <tt>CIPHER</tt> type.</td>
00273  * </tr><tr>
00274  * <td>R_CR_TYPE_to_string()</td>
00275  * <td><tt>"CIPHER"</tt></td>
00276  * <td>The string that represents a <tt>CIPHER</tt> type.</td>
00277  * </tr></table>
00278  */
00279 #define R_CR_TYPE_CIPHER                    2
00280 /**
00281  * Indicates a digest operation type.
00282  * The following table details the usage of the identifier
00283  * in @ref R_CR_CTX_FN.
00284  * @br
00285  * <table><tr>
00286  * <td><b>Function</b></td>
00287  * <td><b>String</b></td>
00288  * <td><b>Description</b></td>
00289  * </tr><tr>
00290  * <td>R_CR_TYPE_from_string()</td>
00291  * <td><tt>"DIGEST"</tt></td>
00292  * <td>This string is interpreted as the <tt>DIGEST</tt> type.</td>
00293  * </tr><tr>
00294  * <td>R_CR_TYPE_to_string()</td>
00295  * <td><tt>"DIGEST"</tt></td>
00296  * <td>The string that represents a <tt>DIGEST</tt> type.</td>
00297  * </tr></table>
00298  */
00299 #define R_CR_TYPE_DIGEST                    3
00300 /**
00301  * Indicates a random operation type.
00302  * The following table details the usage of the identifier
00303  * in @ref R_CR_CTX_FN.
00304  * @br
00305  * <table><tr>
00306  * <td><b>Function</b></td>
00307  * <td><b>String</b></td>
00308  * <td><b>Description</b></td>
00309  * </tr><tr>
00310  * <td>R_CR_TYPE_from_string()</td>
00311  * <td><tt>"RANDOM"</tt></td>
00312  * <td>This string is interpreted as the <tt>RANDOM</tt> type.</td>
00313  * </tr><tr>
00314  * <td>R_CR_TYPE_to_string()</td>
00315  * <td><tt>"RANDOM"</tt></td>
00316  * <td>The string that represents a <tt>RANDOM</tt> type.</td>
00317  * </tr></table>
00318  */
00319 #define R_CR_TYPE_RANDOM                    4
00320 /**
00321  * Indicates a key agreement operation type.
00322  * The following table details the usage of the identifier
00323  * in @ref R_CR_CTX_FN.
00324  * @br
00325  * <table><tr>
00326  * <td><b>Function</b></td>
00327  * <td><b>String</b></td>
00328  * <td><b>Description</b></td>
00329  * </tr><tr>
00330  * <td>R_CR_TYPE_from_string()</td>
00331  * <td><tt>"KEY_EXCHANGE"</tt></td>
00332  * <td>This string is interpreted as the <tt>KEY_EXCHANGE</tt> type.</td>
00333  * </tr><tr>
00334  * <td>R_CR_TYPE_to_string()</td>
00335  * <td><tt>"KEY_EXCHANGE"</tt></td>
00336  * <td>The string that represents a <tt>KEY_EXCHANGE</tt> type.</td>
00337  * </tr></table>
00338  */
00339 #define R_CR_TYPE_KEY_EXCHANGE              5
00340 /**
00341  * Indicates a signature operation type.
00342  * The following table details the usage of the identifier
00343  * in @ref R_CR_CTX_FN.
00344  * @br
00345  * <table><tr>
00346  * <td><b>Function</b></td>
00347  * <td><b>String</b></td>
00348  * <td><b>Description</b></td>
00349  * </tr><tr>
00350  * <td>R_CR_TYPE_from_string()</td>
00351  * <td><tt>"SIGNATURE"</tt></td>
00352  * <td>This string is interpreted as the <tt>SIGNATURE</tt> type.</td>
00353  * </tr><tr>
00354  * <td>R_CR_TYPE_to_string()</td>
00355  * <td><tt>"SIGNATURE"</tt></td>
00356  * <td>The string that represents a <tt>SIGNATURE</tt> type.</td>
00357  * </tr></table>
00358  */
00359 #define R_CR_TYPE_SIGNATURE                 6
00360 /**
00361  * Indicates a Message Authentication Code (MAC) operation type.
00362  * The following table details the usage of the identifier
00363  * in @ref R_CR_CTX_FN.
00364  * @br
00365  * <table><tr>
00366  * <td><b>Function</b></td>
00367  * <td><b>String</b></td>
00368  * <td><b>Description</b></td>
00369  * </tr><tr>
00370  * <td>R_CR_TYPE_from_string()</td>
00371  * <td><tt>"MAC"</tt></td>
00372  * <td>This string is interpreted as the <tt>MAC</tt> type.</td>
00373  * </tr><tr>
00374  * <td>R_CR_TYPE_to_string()</td>
00375  * <td><tt>"MAC"</tt></td>
00376  * <td>The string that represents a <tt>MAC</tt> type.</td>
00377  * </tr></table>
00378  */
00379 #define R_CR_TYPE_MAC                       7
00380 /**
00381  * Indicates a key generation operation type.
00382  * The following table details the usage of the identifier
00383  * in @ref R_CR_CTX_FN.
00384  * @br
00385  * <table><tr>
00386  * <td><b>Function</b></td>
00387  * <td><b>String</b></td>
00388  * <td><b>Description</b></td>
00389  * </tr><tr>
00390  * <td>R_CR_TYPE_from_string()</td>
00391  * <td><tt>"KEYGEN"</tt></td>
00392  * <td>This string is interpreted as the <tt>KEYGEN</tt> type.</td>
00393  * </tr><tr>
00394  * <td>R_CR_TYPE_to_string()</td>
00395  * <td><tt>"KEYGEN"</tt></td>
00396  * <td>The string that represents a <tt>KEYGEN</tt> type.</td>
00397  * </tr></table>
00398  */
00399 #define R_CR_TYPE_KEYGEN                    8
00400 /**
00401  * Indicates a parameter generation operation type.
00402  * The following table details the usage of the identifier
00403  * in @ref R_CR_CTX_FN.
00404  * @br
00405  * <table><tr>
00406  * <td><b>Function</b></td>
00407  * <td><b>String</b></td>
00408  * <td><b>Description</b></td>
00409  * </tr><tr>
00410  * <td>R_CR_TYPE_from_string()</td>
00411  * <td><tt>"PARAMGEN"</tt></td>
00412  * <td>This string is interpreted as the <tt>PARAMGEN</tt> type.</td>
00413  * </tr><tr>
00414  * <td>R_CR_TYPE_to_string()</td>
00415  * <td><tt>"PARAMGEN"</tt></td>
00416  * <td>The string that represents a <tt>PARAMGEN</tt> type.</td>
00417  * </tr></table>
00418  */
00419 #define R_CR_TYPE_PARAMGEN                  9
00420 /**
00421  * Indicates an identifier maximum value operation type.
00422  * The following table details the usage of the identifier
00423  * in @ref R_CR_CTX_FN.
00424  * @br
00425  * <table><tr>
00426  * <td><b>Function</b></td>
00427  * <td><b>String</b></td>
00428  * <td><b>Description</b></td>
00429  * </tr><tr>
00430  * <td>R_CR_TYPE_from_string()</td>
00431  * <td><tt>"MAX"</tt></td>
00432  * <td>This string is interpreted as the <tt>MAX</tt> type.</td>
00433  * </tr><tr>
00434  * <td>R_CR_TYPE_to_string()</td>
00435  * <td><tt>"MAX"</tt></td>
00436  * <td>The string that represents a <tt>MAX</tt> type.</td>
00437  * </tr></table>
00438  */
00439 #define R_CR_TYPE_MAX                       9
00440 
00441 /**
00442  * @}
00443  */
00444 
00445 /* There are two sorts of sub-ids -- Those with a single bit set that can be
00446    combined by bit-wise or in a method table for methods that can handle more
00447    than one sub-id. For algorithms for which combinable sub-ids are not
00448    sensible, a range for scalar sub-id allocation is also reserved.
00449 
00450    Assuming a 32-bit integer, up to 30 single-bit sub-ids and 2^^31 - 2
00451    scalar sub-ids may be defined.
00452 
00453    The macros below have the effect of defining scalar sub-ids as odd numbers
00454    and single-bit sub-ids as even numbers. Using the low-order bit to
00455    distinguish scalar and bit ids ensures independence from integer size.
00456 */
00457 #define R_CR_SUB_BIT(n)                 (1<<((n)+1))
00458 #define R_CR_SUB_SCALAR(n)              (((n)<<1)|1)
00459 #define R_CR_IS_SUB_SCALAR(sub)         ((((sub)&1)==1)||(sub==R_CR_SUB_NONE))
00460 #define R_CR_IS_SUB_BIT(sub)            (!R_CR_IS_SUB_SCALAR(sub))
00461 
00462 /**
00463  * @defgroup R_CR_SUB Operation Subtypes
00464  * This section details the cryptographic algorithms and possible variations
00465  * denoted by a subtype identifier. The algorithm subtype is often used to
00466  * define the area of operation available to the algorithm type selected.
00467  * The following table details the strings that are interpreted by
00468  * R_CR_SUB_from_string() and output by R_CR_SUB_to_string().
00469  * @br
00470  * <table><tr>
00471  * <td><b>Identifier</b></tr>
00472  * <td><b>String</b></tr>
00473  * </tr><tr>
00474  * <td>#R_CR_SUB_NONE</td>
00475  * <td><tt>"NONE"</tt></td>
00476  * </tr><tr>
00477  * <td>#R_CR_SUB_SIGN</td>
00478  * <td><tt>"SIGN"</tt></td>
00479  * </tr><tr>
00480  * <td>#R_CR_SUB_VERIFY</td>
00481  * <td><tt>"VERIFY"</tt></td>
00482  * </tr><tr>
00483  * <td>#R_CR_SUB_ENCRYPT</td>
00484  * <td><tt>"ENCRYPT"</tt></td>
00485  * </tr><tr>
00486  * <td>#R_CR_SUB_DECRYPT</td>
00487  * <td><tt>"DECRYPT"</tt></td>
00488  * </tr><tr>
00489  * <td>#R_CR_SUB_PUBLIC</td>
00490  * <td><tt>"PUBLIC"</tt></td>
00491  * </tr><tr>
00492  * <td>#R_CR_SUB_PRIVATE</td>
00493  * <td><tt>"PRIVATE"</tt></td>
00494  * </tr><tr>
00495  * <td>#R_CR_SUB_MAC</td>
00496  * <td><tt>"MAC"</tt></td>
00497  * </tr><tr>
00498  * <td>#R_CR_SUB_PUB_ENC</td>
00499  * <td><tt>"PUB_ENC"</tt></td>
00500  * </tr><tr>
00501  * <td>#R_CR_SUB_PUB_DEC</td>
00502  * <td><tt>"PUB_DEC"</tt></td>
00503  * </tr><tr>
00504  * <td>#R_CR_SUB_PRIV_ENC</td>
00505  * <td><tt>"PRIV_ENC"</tt></td>
00506  * </tr><tr>
00507  * <td>#R_CR_SUB_PRIV_DEC</td>
00508  * <td><tt>"PRIV_DEC"</tt></td>
00509  * </tr><tr>
00510  * </tr></table>
00511  * @br
00512  *
00513  * @see R_CR_new() and R_CR_CTX_alg_supported().
00514  *
00515  * @ingroup CRYP_OBJ_ID
00516  * @{
00517  */
00518 /**
00519  * Indicates that the operation subtype identifier is none.
00520  * The following table details the usage of the identifier
00521  * in @ref R_CR_CTX_FN.
00522  * @br
00523  * <table><tr>
00524  * <td><b>Function</b></td>
00525  * <td><b>String</b></td>
00526  * <td><b>Description</b></td>
00527  * </tr><tr>
00528  * <td>R_CR_SUB_from_string()</td>
00529  * <td><tt>"NONE"</tt></td>
00530  * <td>This string is interpreted as the <tt>NONE</tt> type.</td>
00531  * </tr><tr>
00532  * <td>R_CR_SUB_to_string()</td>
00533  * <td><tt>"NONE"</tt></td>
00534  * <td>The string that represents a <tt>NONE</tt> type.</td>
00535  * </tr></table>
00536  * @br
00537  * @see #R_CR_TYPE_CIPHER, #R_CR_TYPE_DIGEST, #R_CR_TYPE_RANDOM,
00538  * #R_CR_TYPE_KEYGEN, #R_CR_TYPE_PARAMGEN and #R_CR_TYPE_KEY_EXCHANGE.<br>
00539  *
00540  */
00541 #define R_CR_SUB_NONE                   0
00542 /**
00543  * A subtype identifier which indicates a sign operation.
00544  * The following table details the usage of the identifier
00545  * in @ref R_CR_CTX_FN.
00546  * @br
00547  * <table><tr>
00548  * <td><b>Function</b></td>
00549  * <td><b>String</b></td>
00550  * <td><b>Description</b></td>
00551  * </tr><tr>
00552  * <td>R_CR_SUB_from_string()</td>
00553  * <td><tt>"SIGN"</tt></td>
00554  * <td>This string is interpreted as the <tt>SIGN</tt> type.</td>
00555  * </tr><tr>
00556  * <td>R_CR_SUB_to_string()</td>
00557  * <td><tt>"SIGN"</tt></td>
00558  * <td>The string that represents a <tt>SIGN</tt> type.</td>
00559  * </tr></table>
00560  * @br
00561  * @see #R_CR_TYPE_SIGNATURE.<br>
00562  */
00563 #define R_CR_SUB_SIGN                   R_CR_SUB_BIT(0)
00564 /**
00565  * A subtype identifier which indicates a signature verification operation.
00566  * The following table details the usage of the identifier
00567  * in @ref R_CR_CTX_FN.
00568  * @br
00569  * <table><tr>
00570  * <td><b>Function</b></td>
00571  * <td><b>String</b></td>
00572  * <td><b>Description</b></td>
00573  * </tr><tr>
00574  * <td>R_CR_SUB_from_string()</td>
00575  * <td><tt>"VERIFY"</tt></td>
00576  * <td>This string is interpreted as the <tt>VERIFY</tt> type.</td>
00577  * </tr><tr>
00578  * <td>R_CR_SUB_to_string()</td>
00579  * <td><tt>"VERIFY"</tt></td>
00580  * <td>The string that represents a <tt>VERIFY</tt> type.</td>
00581  * </tr></table>
00582  * @br
00583  * @see #R_CR_TYPE_SIGNATURE.<br>
00584  */
00585 #define R_CR_SUB_VERIFY                 R_CR_SUB_BIT(1)
00586 /**
00587  * A subtype identifier which indicates an encryption operation.
00588  * The following table details the usage of the identifier
00589  * in @ref R_CR_CTX_FN.
00590  * @br
00591  * <table><tr>
00592  * <td><b>Function</b></td>
00593  * <td><b>String</b></td>
00594  * <td><b>Description</b></td>
00595  * </tr><tr>
00596  * <td>R_CR_SUB_from_string()</td>
00597  * <td><tt>"ENCRYPT"</tt></td>
00598  * <td>This string is interpreted as the <tt>ENCRYPT</tt> type.</td>
00599  * </tr><tr>
00600  * <td>R_CR_SUB_to_string()</td>
00601  * <td><tt>"ENCRYPT"</tt></td>
00602  * <td>The string that represents an <tt>ENCRYPT</tt> type.</td>
00603  * </tr></table>
00604  * @br
00605  * @see #R_CR_TYPE_ASYM.<br>
00606  */
00607 #define R_CR_SUB_ENCRYPT                R_CR_SUB_BIT(2)
00608 /**
00609  * A subtype identifier which indicates a decryption operation.
00610  * The following table details the usage of the identifier
00611  * in @ref R_CR_CTX_FN.
00612  * @br
00613  * <table><tr>
00614  * <td><b>Function</b></td>
00615  * <td><b>String</b></td>
00616  * <td><b>Description</b></td>
00617  * </tr><tr>
00618  * <td>R_CR_SUB_from_string()</td>
00619  * <td><tt>"DECRYPT"</tt></td>
00620  * <td>This string is interpreted as the <tt>DECRYPT</tt> type.</td>
00621  * </tr><tr>
00622  * <td>R_CR_SUB_to_string()</td>
00623  * <td><tt>"DECRYPT"</tt></td>
00624  * <td>The string that represents a <tt>DECRYPT</tt> type.</td>
00625  * </tr></table>
00626  * @br
00627  * @see #R_CR_TYPE_ASYM.<br>
00628  */
00629 #define R_CR_SUB_DECRYPT                R_CR_SUB_BIT(3)
00630 /**
00631  * A subtype identifier which indicates a public key operation.
00632  * The following table details the usage of the identifier
00633  * in @ref R_CR_CTX_FN.
00634  * @br
00635  * <table><tr>
00636  * <td><b>Function</b></td>
00637  * <td><b>String</b></td>
00638  * <td><b>Description</b></td>
00639  * </tr><tr>
00640  * <td>R_CR_SUB_from_string()</td>
00641  * <td><tt>"PUBLIC"</tt></td>
00642  * <td>This string is interpreted as the <tt>PUBLIC</tt> type.</td>
00643  * </tr><tr>
00644  * <td>R_CR_SUB_to_string()</td>
00645  * <td><tt>"PUBLIC"</tt></td>
00646  * <td>The string that represents a <tt>PUBLIC</tt> type.</td>
00647  * </tr></table>
00648  * @br
00649  * @see #R_CR_TYPE_ASYM.<br>
00650  */
00651 #define R_CR_SUB_PUBLIC                 R_CR_SUB_BIT(4)
00652 /**
00653  * A subtype identifier which indicates a private key operation.
00654  * The following table details the usage of the identifier
00655  * in @ref R_CR_CTX_FN.
00656  * @br
00657  * <table><tr>
00658  * <td><b>Function</b></td>
00659  * <td><b>String</b></td>
00660  * <td><b>Description</b></td>
00661  * </tr><tr>
00662  * <td>R_CR_SUB_from_string()</td>
00663  * <td><tt>"PRIVATE"</tt></td>
00664  * <td>This string is interpreted as the <tt>PRIVATE</tt> type.</td>
00665  * </tr><tr>
00666  * <td>R_CR_SUB_to_string()</td>
00667  * <td><tt>"PRIVATE"</tt></td>
00668  * <td>The string that represents a <tt>PRIVATE</tt> type.</td>
00669  * </tr></table>
00670  * @br
00671  * @see #R_CR_TYPE_ASYM.<br>
00672  */
00673 #define R_CR_SUB_PRIVATE                R_CR_SUB_BIT(5)
00674 
00675 /**
00676  * A subtype identifier which indicates a Message Authentication Code (MAC)
00677  * operation.
00678  * The following table details the usage of the identifier
00679  * in @ref R_CR_CTX_FN.
00680  * @br
00681  * <table><tr>
00682  * <td><b>Function</b></td>
00683  * <td><b>String</b></td>
00684  * <td><b>Description</b></td>
00685  * </tr><tr>
00686  * <td>R_CR_SUB_from_string()</td>
00687  * <td><tt>"MAC"</tt></td>
00688  * <td>This string is interpreted as the <tt>MAC</tt> type.</td>
00689  * </tr><tr>
00690  * <td>R_CR_SUB_to_string()</td>
00691  * <td><tt>"MAC"</tt></td>
00692  * <td>The string that represents a <tt>MAC</tt> type.</td>
00693  * </tr></table>
00694  * @br
00695  * @see #R_CR_TYPE_MAC.<br>
00696  */
00697 #define R_CR_SUB_MAC                    R_CR_SUB_BIT(6)
00698 
00699 /**
00700  * A subtype identifier which indicates a public key encryption operation.
00701  * The following table details the usage of the identifier
00702  * in @ref R_CR_CTX_FN.<br>
00703  * <br>
00704  * <table><tr>
00705  * <td><b>Function</b></td>
00706  * <td><b>String</b></td>
00707  * <td><b>Description</b></td>
00708  * </tr><tr>
00709  * <td>R_CR_SUB_from_string()</td>
00710  * <td><tt>"PUB_ENC"</tt></td>
00711  * <td>This string is interpreted as the <tt>PUB_ENC</tt> type.</td>
00712  * </tr><tr>
00713  * <td>R_CR_SUB_to_string()</td>
00714  * <td><tt>"PUB_ENC"</tt></td>
00715  * <td>The string that represents a <tt>PUB_ENC</tt> type.</td>
00716  * </tr></table>
00717  * @br
00718  * @see #R_CR_TYPE_ASYM.<br>
00719  */
00720 #define R_CR_SUB_PUB_ENC                (R_CR_SUB_PUBLIC|R_CR_SUB_ENCRYPT)
00721 /**
00722  * A subtype identifier which indicates a public key decryption operation.
00723  * The following table details the usage of the identifier
00724  * in @ref R_CR_CTX_FN.<br>
00725  * <br>
00726  * <table><tr>
00727  * <td><b>Function</b></td>
00728  * <td><b>String</b></td>
00729  * <td><b>Description</b></td>
00730  * </tr><tr>
00731  * <td>R_CR_SUB_from_string()</td>
00732  * <td><tt>"PUB_DEC"</tt></td>
00733  * <td>This string is interpreted as the <tt>PUB_DEC</tt> type.</td>
00734  * </tr><tr>
00735  * <td>R_CR_SUB_to_string()</td>
00736  * <td><tt>"PUB_DEC"</tt></td>
00737  * <td>The string that represents a <tt>PUB_DEC</tt> type.</td>
00738  * </tr></table>
00739  * @br
00740  * @see #R_CR_TYPE_ASYM.<br>
00741  */
00742 #define R_CR_SUB_PUB_DEC                (R_CR_SUB_PUBLIC|R_CR_SUB_DECRYPT)
00743 /**
00744  * A subtype identifier which indicates a private key encryption operation.
00745  * The following table details the usage of the identifier
00746  * in @ref R_CR_CTX_FN.<br>
00747  * <br>
00748  * <table><tr>
00749  * <td><b>Function</b></td>
00750  * <td><b>String</b></td>
00751  * <td><b>Description</b></td>
00752  * </tr><tr>
00753  * <td>R_CR_SUB_from_string()</td>
00754  * <td><tt>"PRIV_ENC"</tt></td>
00755  * <td>This string is interpreted as the <tt>PRIV_ENC</tt> type.</td>
00756  * </tr><tr>
00757  * <td>R_CR_SUB_to_string()</td>
00758  * <td><tt>"PRIV_ENC"</tt></td>
00759  * <td>The string that represents a <tt>PRIV_ENC</tt> type.</td>
00760  * </tr></table>
00761  */
00762 #define R_CR_SUB_PRIV_ENC               (R_CR_SUB_PRIVATE|R_CR_SUB_ENCRYPT)
00763 /**
00764  * A subtype identifier which indicates a private key decryption operation.
00765  * The following table details the usage of the identifier
00766  * in @ref R_CR_CTX_FN.<br>
00767  * <br>
00768  * <table><tr>
00769  * <td><b>Function</b></td>
00770  * <td><b>String</b></td>
00771  * <td><b>Description</b></td>
00772  * </tr><tr>
00773  * <td>R_CR_SUB_from_string()</td>
00774  * <td><tt>"PRIV_DEC"</tt></td>
00775  * <td>This string is interpreted as the <tt>PRIV_DEC</tt> type.</td>
00776  * </tr><tr>
00777  * <td>R_CR_SUB_to_string()</td>
00778  * <td><tt>"PRIV_DEC"</tt></td>
00779  * <td>The string that represents a <tt>PRIV_DEC</tt> type.</td>
00780  * </tr></table>
00781  * @br
00782  * @see #R_CR_TYPE_ASYM.<br>
00783  */
00784 #define R_CR_SUB_PRIV_DEC               (R_CR_SUB_PRIVATE|R_CR_SUB_DECRYPT)
00785 
00786 /**
00787  * @}
00788  */
00789 /**
00790  * @defgroup R_CR_IDS Algorithm Identifiers
00791  * This section details the constants which specify the cryptographic algorithm
00792  * to use in a particular cryptographic operation.
00793  * The following table details the strings that are interpreted by
00794  * R_CR_ID_from_string() and output by R_CR_ID_to_string().
00795  * @br
00796  * <table><tr>
00797  * <td><b>Identifier</b></tr>
00798  * <td><b>String</b></tr>
00799  * </tr><tr>
00800  * <td>#R_CR_ID_UNKNOWN</td>
00801  * <td><tt>"UNKNOWN"</tt></td>
00802  * </tr><tr>
00803  * <td>#R_CR_ID_NULL</td>
00804  * <td><tt>"NULL"</tt></td>
00805  * </tr><tr>
00806  * <td>#R_CR_ID_RANDOM</td>
00807  * <td><tt>"RANDOM"</tt></td>
00808  * </tr><tr>
00809  * <td>#R_CR_ID_RANDOM_SYS</td>
00810  * <td><tt>"RANDOM_SYS"</tt></td>
00811  * </tr><tr>
00812  * <td>#R_CR_ID_DIGEST_NULL</td>
00813  * <td><tt>"DIGEST_NULL"</tt></td>
00814  * </tr><tr>
00815  * <td>#R_CR_ID_SHA1</td>
00816  * <td><tt>"SHA1"</tt></td>
00817  * </tr><tr>
00818  * <td>#R_CR_ID_SHA256</td>
00819  * <td><tt>"SHA256"</tt></td>
00820  * </tr><tr>
00821  * <td>#R_CR_ID_SHA384</td>
00822  * <td><tt>"SHA384"</tt></td>
00823  * </tr><tr>
00824  * <td>#R_CR_ID_SHA512</td>
00825  * <td><tt>"SHA512"</tt></td>
00826  * </tr><tr>
00827  * <td>#R_CR_ID_MD2</td>
00828  * <td><tt>"MD2"</tt></td>
00829  * </tr><tr>
00830  * <td>#R_CR_ID_MD5</td>
00831  * <td><tt>"MD5"</tt></td>
00832  * </tr><tr>
00833  * <td>#R_CR_ID_HMAC_MD5</td>
00834  * <td><tt>"HMAC_MD5"</tt></td>
00835  * </tr><tr>
00836  * <td>#R_CR_ID_HMAC_SHA1</td>
00837  * <td><tt>"HMAC_SHA1"</tt></td>
00838  * </tr><tr>
00839  * <td>#R_CR_ID_DES_CBC</td>
00840  * <td><tt>"DES_CBC"</tt></td>
00841  * </tr><tr>
00842  * <td>#R_CR_ID_DES_EDE</td>
00843  * <td><tt>"DES_EDE"</tt></td>
00844  * </tr><tr>
00845  * <td>#R_CR_ID_DES_ECB</td>
00846  * <td><tt>"DES_ECB"</tt></td>
00847  * </tr><tr>
00848  * <td>#R_CR_ID_DES_CFB64</td>
00849  * <td><tt>"DES_CFB64"</tt></td>
00850  * </tr><tr>
00851  * <td>#R_CR_ID_DES_EDE3</td>
00852  * <td><tt>"DES_EDE3"</tt></td>
00853  * </tr><tr>
00854  * <td>#R_CR_ID_DES_EDE_CBC</td>
00855  * <td><tt>"DES_EDE_CBC"</tt></td>
00856  * </tr><tr>
00857  * <td>#R_CR_ID_DES_EDE3_CBC</td>
00858  * <td><tt>"DES_EDE3_CBC"</tt></td>
00859  * </tr><tr>
00860  * <td>#R_CR_ID_DES_EDE_CFB64</td>
00861  * <td><tt>"DES_EDE_CFB64"</tt></td>
00862  * </tr><tr>
00863  * <td>#R_CR_ID_DES_EDE3_CFB64</td>
00864  * <td><tt>"DES_EDE3_CFB64"</tt></td>
00865  * </tr><tr>
00866  * <td>#R_CR_ID_DES_EDE_OFB64</td>
00867  * <td><tt>"DES_EDE_OFB64"</tt></td>
00868  * </tr><tr>
00869  * <td>#R_CR_ID_DES_EDE3_OFB64</td>
00870  * <td><tt>"DES_EDE3_OFB64"</tt></td>
00871  * </tr><tr>
00872  * <td>#R_CR_ID_DES_40_CBC</td>
00873  * <td><tt>"DES_40_CBC"</tt></td>
00874  * </tr><tr>
00875  * <td>#R_CR_ID_DES_40_CFB</td>
00876  * <td><tt>"DES_40_CFB"</tt></td>
00877  * </tr><tr>
00878  * <td>#R_CR_ID_DES_OFB</td>
00879  * <td><tt>"DES_OFB"</tt></td>
00880  * </tr><tr>
00881  * <td>#R_CR_ID_RC2_CBC</td>
00882  * <td><tt>"RC2_CBC"</tt></td>
00883  * </tr><tr>
00884  * <td>#R_CR_ID_RC2_ECB</td>
00885  * <td><tt>"RC2_ECB"</tt></td>
00886  * </tr><tr>
00887  * <td>#R_CR_ID_RC2_CFB</td>
00888  * <td><tt>"RC2_CFB"</tt></td>
00889  * </tr><tr>
00890  * <td>#R_CR_ID_RC2_OFB</td>
00891  * <td><tt>"RC2_OFB"</tt></td>
00892  * </tr><tr>
00893  * <td>#R_CR_ID_RC2_40_CBC</td>
00894  * <td><tt>"RC2_40_CBC"</tt></td>
00895  * </tr><tr>
00896  * <td>#R_CR_ID_RC4</td>
00897  * <td><tt>"RC4"</tt></td>
00898  * </tr><tr>
00899  * <td>#R_CR_ID_RC4_40</td>
00900  * <td><tt>"RC4_40"</tt></td>
00901  * </tr><tr>
00902  * <td>#R_CR_ID_RC5_CBC</td>
00903  * <td><tt>"RC5_CBC"</tt></td>
00904  * </tr><tr>
00905  * <td>#R_CR_ID_RC5_ECB</td>
00906  * <td><tt>"RC5_ECB"</tt></td>
00907  * </tr><tr>
00908  * <td>#R_CR_ID_RC5_CFB</td>
00909  * <td><tt>"RC5_CFB"</tt></td>
00910  * </tr><tr>
00911  * <td>#R_CR_ID_RC5_OFB</td>
00912  * <td><tt>"RC5_OFB"</tt></td>
00913  * </tr><tr>
00914  * <td>#R_CR_ID_AES_128_CBC</td>
00915  * <td><tt>"AES_128_CBC"</tt></td>
00916  * </tr><tr>
00917  * <td>#R_CR_ID_AES_128_ECB</td>
00918  * <td><tt>"AES_128_ECB"</tt></td>
00919  * </tr><tr>
00920  * <td>#R_CR_ID_AES_128_CFB</td>
00921  * <td><tt>"AES_128_CFB"</tt></td>
00922  * </tr><tr>
00923  * <td>#R_CR_ID_AES_128_OFB</td>
00924  * <td><tt>"AES_128_OFB"</tt></td>
00925  * </tr><tr>
00926  * <td>#R_CR_ID_AES_192_CBC</td>
00927  * <td><tt>"AES_192_CBC"</tt></td>
00928  * </tr><tr>
00929  * <td>#R_CR_ID_AES_192_ECB</td>
00930  * <td><tt>"AES_192_ECB"</tt></td>
00931  * </tr><tr>
00932  * <td>#R_CR_ID_AES_192_CFB</td>
00933  * <td><tt>"AES_192_CFB"</tt></td>
00934  * </tr><tr>
00935  * <td>#R_CR_ID_AES_192_OFB</td>
00936  * <td><tt>"AES_192_OFB"</tt></td>
00937  * </tr><tr>
00938  * <td>#R_CR_ID_AES_256_CBC</td>
00939  * <td><tt>"AES_256_CBC"</tt></td>
00940  * </tr><tr>
00941  * <td>#R_CR_ID_AES_256_ECB</td>
00942  * <td><tt>"AES_256_ECB"</tt></td>
00943  * </tr><tr>
00944  * <td>#R_CR_ID_AES_256_CFB</td>
00945  * <td><tt>"AES_256_CFB"</tt></td>
00946  * </tr><tr>
00947  * <td>#R_CR_ID_AES_256_OFB</td>
00948  * <td><tt>"AES_256_OFB"</tt></td>
00949  * </tr><tr>
00950  * <td>#R_CR_ID_RSA</td>
00951  * <td><tt>"RSA"</tt></td>
00952  * </tr><tr>
00953  * <td>#R_CR_ID_RSA_PKCS1</td>
00954  * <td><tt>"RSA_PKCS1"</tt></td>
00955  * </tr><tr>
00956  * <td>#R_CR_ID_RSA_PKCS1_OAEP</td>
00957  * <td><tt>"RSA_PKCS1_OAEP"</tt></td>
00958  * </tr><tr>
00959  * <td>#R_CR_ID_RSA_PKCS1_SSL</td>
00960  * <td><tt>"RSA_PKCS1_SSL"</tt></td>
00961  * </tr><tr>
00962  * <td>#R_CR_ID_DSA</td>
00963  * <td><tt>"DSA"</tt></td>
00964  * </tr><tr>
00965  * <td>#R_CR_ID_SHA1_DSA</td>
00966  * <td><tt>"SHA1_DSA"</tt></td>
00967  * </tr><tr>
00968  * <td>#R_CR_ID_SHA1_RSA</td>
00969  * <td><tt>"SHA1_RSA"</tt></td>
00970  * </tr><tr>
00971  * <td>#R_CR_ID_MD2_RSA</td>
00972  * <td><tt>"MD2_RSA"</tt></td>
00973  * </tr><tr>
00974  * <td>#R_CR_ID_MD5_RSA</td>
00975  * <td><tt>"MD5_RSA"</tt></td>
00976  * </tr><tr>
00977  * <td>#R_CR_ID_SIGNATURE_TYPE_NONE</td>
00978  * <td><tt>"SIGNATURE_TYPE_NONE"</tt></td>
00979  * </tr><tr>
00980  * <td>#R_CR_ID_SIGNATURE_TYPE_DER</td>
00981  * <td><tt>"SIGNATURE_TYPE_DER"</tt></td>
00982  * </tr><tr>
00983  * <td>#R_CR_ID_KE_DH</td>
00984  * <td><tt>"KE_DH"</tt></td>
00985  * </tr><tr>
00986  * <td>#R_CR_ID_RSA_KEY_GENERATION</td>
00987  * <td><tt>"RSA_KEY_GENERATION"</tt></td>
00988  * </tr><tr>
00989  * <td>#R_CR_ID_DSA_KEY_GENERATION</td>
00990  * <td><tt>"DSA_KEY_GENERATION"</tt></td>
00991  * </tr><tr>
00992  * <td>#R_CR_ID_DSA_PARAMETER_GENERATION</td>
00993  * <td><tt>"DSA_PARAMETER_GENERATION"</tt></td>
00994  * </tr><tr>
00995  * <td>#R_CR_ID_DH_PARAMETER_GENERATION</td>
00996  * <td><tt>"DH_PARAMETER_GENERATION"</tt></td>
00997  * </tr><tr>
00998  * </tr></table>
00999  * @br
01000  *
01001  * See R_CR_new(), R_CR_get_info() and R_CR_CTX_alg_supported().
01002  *
01003  * @ingroup CRYP_OBJ_ID
01004  * @{
01005  */
01006 /* Use this macro to define IDs that are meaningful only to the R_CR_xxx
01007    functions and not to lower layers (e.g., the nat_method layer. These IDs
01008    MUST NOT be passed to lower layers that expect some type of NID_xxx. The
01009    local IDs begin at 4096 to give wide berth to the NIDs defined in
01010    object.h (that currently end at 119.
01011 */
01012 #define R_CR_ID_LOCAL(local_id)             (4096 + (local_id))
01013 
01014 /* Define algorithm IDs and map them to NIDs where possible.
01015    In general, two names are defined for each ID -- one that includes the
01016    algorithm type and one that does not.
01017  */
01018 /**
01019  * Indicates that the cryptographic identifier is an unknown algorithm.
01020  * The following table details the usage of the identifier
01021  * in @ref R_CR_CTX_FN.
01022  * @br
01023  * <table><tr>
01024  * <td><b>Function</b></td>
01025  * <td><b>String</b></td>
01026  * <td><b>Description</b></td>
01027  * </tr><tr>
01028  * <td>R_CR_ID_from_string()</td>
01029  * <td><tt>"UNKNOWN"</tt></td>
01030  * <td>This string is interpreted as the <tt>UNKNOWN</tt> type.</td>
01031  * </tr><tr>
01032  * <td>R_CR_ID_to_string()</td>
01033  * <td><tt>"UNKNOWN"</tt></td>
01034  * <td>The string that represents an <tt>UNKNOWN</tt> type.</td>
01035  * </tr></table>
01036  */
01037 #define R_CR_ID_UNKNOWN                     (-1)
01038 /**
01039  * Indicates that the cryptographic identifier is <tt>NULL</tt>.
01040  * The following table details the usage of the identifier
01041  * in @ref R_CR_CTX_FN.
01042  * @br
01043  * <table><tr>
01044  * <td><b>Function</b></td>
01045  * <td><b>String</b></td>
01046  * <td><b>Description</b></td>
01047  * </tr><tr>
01048  * <td>R_CR_ID_from_string()</td>
01049  * <td><tt>"NULL"</tt></td>
01050  * <td>This string is interpreted as the <tt>NULL</tt> type.</td>
01051  * </tr><tr>
01052  * <td>R_CR_ID_to_string()</td>
01053  * <td><tt>"NULL"</tt></td>
01054  * <td>The string that represents a <tt>NULL</tt> type.</td>
01055  * </tr></table>
01056  */
01057 #define R_CR_ID_NULL                        0
01058 
01059 /**
01060  * Indicates a random cryptographic identifier.
01061  * The following table details the usage of the identifier
01062  * in @ref R_CR_CTX_FN.
01063  * @br
01064  * <table><tr>
01065  * <td><b>Function</b></td>
01066  * <td><b>String</b></td>
01067  * <td><b>Description</b></td>
01068  * </tr><tr>
01069  * <td>R_CR_ID_from_string()</td>
01070  * <td><tt>"RANDOM"</tt></td>
01071  * <td>This string is interpreted as the <tt>RANDOM</tt> type.</td>
01072  * </tr><tr>
01073  * <td>R_CR_ID_to_string()</td>
01074  * <td><tt>"RANDOM"</tt></td>
01075  * <td>The string that represents a <tt>RANDOM</tt> type.</td>
01076  * </tr></table>
01077  */
01078 #define R_CR_ID_RANDOM                      R_CR_ID_LOCAL(0)
01079 
01080 /**
01081  * Indicates that the cryptographic identifier is random and uses local system
01082  * random function calls.
01083  * The following table details the usage of the identifier
01084  * in @ref R_CR_CTX_FN.
01085  * @br
01086  * <table><tr>
01087  * <td><b>Function</b></td>
01088  * <td><b>String</b></td>
01089  * <td><b>Description</b></td>
01090  * </tr><tr>
01091  * <td>R_CR_ID_from_string()</td>
01092  * <td><tt>"RANDOM_SYS"</tt></td>
01093  * <td>This string is interpreted as the <tt>RANDOM_SYS</tt> type.</td>
01094  * </tr><tr>
01095  * <td>R_CR_ID_to_string()</td>
01096  * <td><tt>"RANDOM_SYS"</tt></td>
01097  * <td>The string that represents a <tt>RANDOM_SYS</tt> type.</td>
01098  * </tr></table>
01099  */
01100 #define R_CR_ID_RANDOM_SYS                  R_CR_ID_LOCAL(8)
01101 
01102 /**
01103  * A cryptographic identifier which indicates a null digest.
01104  * The following table details the usage of the identifier
01105  * in @ref R_CR_CTX_FN.
01106  * @br
01107  * <table><tr>
01108  * <td><b>Function</b></td>
01109  * <td><b>String</b></td>
01110  * <td><b>Description</b></td>
01111  * </tr><tr>
01112  * <td>R_CR_ID_from_string()</td>
01113  * <td><tt>"DIGEST_NULL"</tt></td>
01114  * <td>This string is interpreted as the <tt>DIGEST_NULL</tt> type.</td>
01115  * </tr><tr>
01116  * <td>R_CR_ID_to_string()</td>
01117  * <td><tt>"DIGEST_NULL"</tt></td>
01118  * <td>The string that represents a <tt>DIGEST_NULL</tt> type.</td>
01119  * </tr></table>
01120  */
01121 #define R_CR_ID_DIGEST_NULL                 R_CR_ID_NULL
01122 
01123 /**
01124  * A cryptographic identifier which indicates a SHA-1 digest.
01125  * The following table details the usage of the identifier
01126  * in @ref R_CR_CTX_FN.
01127  * @br
01128  * <table><tr>
01129  * <td><b>Function</b></td>
01130  * <td><b>String</b></td>
01131  * <td><b>Description</b></td>
01132  * </tr><tr>
01133  * <td>R_CR_ID_from_string()</td>
01134  * <td><tt>"SHA1"</tt></td>
01135  * <td>This string is interpreted as the <tt>SHA1</tt> type.</td>
01136  * </tr><tr>
01137  * <td>R_CR_ID_to_string()</td>
01138  * <td><tt>"SHA1"</tt></td>
01139  * <td>The string that represents a <tt>SHA1</tt> type.</td>
01140  * </tr></table>
01141  */
01142 #define R_CR_ID_SHA1                        NID_sha1
01143 /**
01144  * A cryptographic identifier which indicates a SHA-256 digest.
01145  * The following table details the usage of the identifier
01146  * in @ref R_CR_CTX_FN.
01147  * @br
01148  * <table><tr>
01149  * <td><b>Function</b></td>
01150  * <td><b>String</b></td>
01151  * <td><b>Description</b></td>
01152  * </tr><tr>
01153  * <td>R_CR_ID_from_string()</td>
01154  * <td><tt>"SHA256"</tt></td>
01155  * <td>This string is interpreted as the <tt>SHA256</tt> type.</td>
01156  * </tr><tr>
01157  * <td>R_CR_ID_to_string()</td>
01158  * <td><tt>"SHA256"</tt></td>
01159  * <td>The string that represents a <tt>SHA256</tt> type.</td>
01160  * </tr></table>
01161  */
01162 #define R_CR_ID_SHA256                      NID_sha256
01163 /**
01164  * A cryptographic identifier which indicates a SHA-384 digest.
01165  * The following table details the usage of the identifier
01166  * in @ref R_CR_CTX_FN.
01167  * @br
01168  * <table><tr>
01169  * <td><b>Function</b></td>
01170  * <td><b>String</b></td>
01171  * <td><b>Description</b></td>
01172  * </tr><tr>
01173  * <td>R_CR_ID_from_string()</td>
01174  * <td><tt>"SHA384"</tt></td>
01175  * <td>This string is interpreted as the <tt>SHA384</tt> type.</td>
01176  * </tr><tr>
01177  * <td>R_CR_ID_to_string()</td>
01178  * <td><tt>"SHA384"</tt></td>
01179  * <td>The string that represents a <tt>SHA384</tt> type.</td>
01180  * </tr></table>
01181  */
01182 #define R_CR_ID_SHA384                      NID_sha384
01183 /**
01184  * A cryptographic identifier which indicates a SHA-512 digest.
01185  * The following table details the usage of the identifier
01186  * in @ref R_CR_CTX_FN.
01187  * @br
01188  * <table><tr>
01189  * <td><b>Function</b></td>
01190  * <td><b>String</b></td>
01191  * <td><b>Description</b></td>
01192  * </tr><tr>
01193  * <td>R_CR_ID_from_string()</td>
01194  * <td><tt>"SHA512"</tt></td>
01195  * <td>This string is interpreted as the <tt>SHA512</tt> type.</td>
01196  * </tr><tr>
01197  * <td>R_CR_ID_to_string()</td>
01198  * <td><tt>"SHA512"</tt></td>
01199  * <td>The string that represents a <tt>SHA512</tt> type.</td>
01200  * </tr></table>
01201  */
01202 #define R_CR_ID_SHA512                      NID_sha512
01203 
01204 /**
01205  * A cryptographic identifier which indicates an MD2 digest.
01206  * The following table details the usage of the identifier
01207  * in @ref R_CR_CTX_FN.
01208  * @br
01209  * <table><tr>
01210  * <td><b>Function</b></td>
01211  * <td><b>String</b></td>
01212  * <td><b>Description</b></td>
01213  * </tr><tr>
01214  * <td>R_CR_ID_from_string()</td>
01215  * <td><tt>"MD2"</tt></td>
01216  * <td>This string is interpreted as the <tt>MD2</tt> type.</td>
01217  * </tr><tr>
01218  * <td>R_CR_ID_to_string()</td>
01219  * <td><tt>"MD2"</tt></td>
01220  * <td>The string that represents a <tt>MD2</tt> type.</td>
01221  * </tr></table>
01222  */
01223 #define R_CR_ID_MD2                         NID_md2
01224 /**
01225  * A cryptographic identifier which indicates an MD5 digest.
01226  * The following table details the usage of the identifier
01227  * in @ref R_CR_CTX_FN.
01228  * @br
01229  * <table><tr>
01230  * <td><b>Function</b></td>
01231  * <td><b>String</b></td>
01232  * <td><b>Description</b></td>
01233  * </tr><tr>
01234  * <td>R_CR_ID_from_string()</td>
01235  * <td><tt>"MD5"</tt></td>
01236  * <td>This string is interpreted as the <tt>MD5</tt> type.</td>
01237  * </tr><tr>
01238  * <td>R_CR_ID_to_string()</td>
01239  * <td><tt>"MD5"</tt></td>
01240  * <td>The string that represents a <tt>MD5</tt> type.</td>
01241  * </tr></table>
01242  */
01243 #define R_CR_ID_MD5                         NID_md5
01244 
01245 /**
01246  * A cryptographic identifier which indicates a Message Authentication Code
01247  * (MAC) utilizing MD5 digest.
01248  * The following table details the usage of the identifier
01249  * in @ref R_CR_CTX_FN.
01250  * @br
01251  * <table><tr>
01252  * <td><b>Function</b></td>
01253  * <td><b>String</b></td>
01254  * <td><b>Description</b></td>
01255  * </tr><tr>
01256  * <td>R_CR_ID_from_string()</td>
01257  * <td><tt>"HMAC_MD5"</tt></td>
01258  * <td>This string is interpreted as the <tt>HMAC_MD5</tt> type.</td>
01259  * </tr><tr>
01260  * <td>R_CR_ID_to_string()</td>
01261  * <td><tt>"HMAC_MD5"</tt></td>
01262  * <td>The string that represents a <tt>HMAC_MD5</tt> type.</td>
01263  * </tr></table>
01264  */
01265 #define R_CR_ID_HMAC_MD5                    R_CR_ID_LOCAL(1)
01266 /**
01267  * A cryptographic identifier which indicates a Message Authentication Code
01268  * (MAC) utilizing SHA-1 digest.
01269  * The following table details the usage of the identifier
01270  * in @ref R_CR_CTX_FN.
01271  * @br
01272  * <table><tr>
01273  * <td><b>Function</b></td>
01274  * <td><b>String</b></td>
01275  * <td><b>Description</b></td>
01276  * </tr><tr>
01277  * <td>R_CR_ID_from_string()</td>
01278  * <td><tt>"HMAC_SHA1"</tt></td>
01279  * <td>This string is interpreted as the <tt>HMAC_SHA1</tt> type.</td>
01280  * </tr><tr>
01281  * <td>R_CR_ID_to_string()</td>
01282  * <td><tt>"HMAC_SHA1"</tt></td>
01283  * <td>The string that represents a <tt>HMAC_SHA1</tt> type.</td>
01284  * </tr></table>
01285  */
01286 #define R_CR_ID_HMAC_SHA1                   R_CR_ID_LOCAL(2)
01287 
01288 /**
01289  * A cryptographic identifier which indicates a DES CBC symmetric cipher.
01290  * The following table details the usage of the identifier
01291  * in @ref R_CR_CTX_FN.
01292  * @br
01293  * <table><tr>
01294  * <td><b>Function</b></td>
01295  * <td><b>String</b></td>
01296  * <td><b>Description</b></td>
01297  * </tr><tr>
01298  * <td>R_CR_ID_from_string()</td>
01299  * <td><tt>"DES_CBC"</tt></td>
01300  * <td>This string is interpreted as the <tt>DES_CBC</tt> type.</td>
01301  * </tr><tr>
01302  * <td>R_CR_ID_to_string()</td>
01303  * <td><tt>"DES_CBC"</tt></td>
01304  * <td>The string that represents a <tt>DES_CBC</tt> type.</td>
01305  * </tr></table>
01306  */
01307 #define R_CR_ID_DES_CBC                     NID_des_cbc
01308 
01309 /**
01310  * A cryptographic identifier which indicates a DES EDE symmetric cipher.
01311  * The following table details the usage of the identifier
01312  * in @ref R_CR_CTX_FN.
01313  * @br
01314  * <table><tr>
01315  * <td><b>Function</b></td>
01316  * <td><b>String</b></td>
01317  * <td><b>Description</b></td>
01318  * </tr><tr>
01319  * <td>R_CR_ID_from_string()</td>
01320  * <td><tt>"DES_EDE"</tt></td>
01321  * <td>This string is interpreted as the <tt>DES_EDE</tt> type.</td>
01322  * </tr><tr>
01323  * <td>R_CR_ID_to_string()</td>
01324  * <td><tt>"DES_EDE"</tt></td>
01325  * <td>The string that represents a <tt>DES_EDE</tt> type.</td>
01326  * </tr></table>
01327  */
01328 #define R_CR_ID_DES_EDE                     NID_des_ede
01329 /**
01330  * A cryptographic identifier which indicates a DES ECB symmetric cipher.
01331  * The following table details the usage of the identifier
01332  * in @ref R_CR_CTX_FN.
01333  * @br
01334  * <table><tr>
01335  * <td><b>Function</b></td>
01336  * <td><b>String</b></td>
01337  * <td><b>Description</b></td>
01338  * </tr><tr>
01339  * <td>R_CR_ID_from_string()</td>
01340  * <td><tt>"DES_ECB"</tt></td>
01341  * <td>This string is interpreted as the <tt>DES_ECB</tt> type.</td>
01342  * </tr><tr>
01343  * <td>R_CR_ID_to_string()</td>
01344  * <td><tt>"DES_ECB"</tt></td>
01345  * <td>The string that represents a <tt>DES_ECB</tt> type.</td>
01346  * </tr></table>
01347  */
01348 #define R_CR_ID_DES_ECB                     NID_des_ecb
01349 /**
01350  * A cryptographic identifier which indicates a DES CFB64 symmetric cipher.
01351  * The following table details the usage of the identifier
01352  * in @ref R_CR_CTX_FN.
01353  * @br
01354  * <table><tr>
01355  * <td><b>Function</b></td>
01356  * <td><b>String</b></td>
01357  * <td><b>Description</b></td>
01358  * </tr><tr>
01359  * <td>R_CR_ID_from_string()</td>
01360  * <td><tt>"DES_CFB64"</tt></td>
01361  * <td>This string is interpreted as the <tt>DES_CFB64</tt> type.</td>
01362  * </tr><tr>
01363  * <td>R_CR_ID_to_string()</td>
01364  * <td><tt>"DES_CFB64"</tt></td>
01365  * <td>The string that represents a <tt>DES_CFB64</tt> type.</td>
01366  * </tr></table>
01367  */
01368 #define R_CR_ID_DES_CFB64                   NID_des_cfb64
01369 /**
01370  * A cryptographic identifier which indicates a DES EDE3 symmetric cipher.
01371  * The following table details the usage of the identifier
01372  * in @ref R_CR_CTX_FN.
01373  * @br
01374  * <table><tr>
01375  * <td><b>Function</b></td>
01376  * <td><b>String</b></td>
01377  * <td><b>Description</b></td>
01378  * </tr><tr>
01379  * <td>R_CR_ID_from_string()</td>
01380  * <td><tt>"DES_EDE3"</tt></td>
01381  * <td>This string is interpreted as the <tt>DES_EDE3</tt> type.</td>
01382  * </tr><tr>
01383  * <td>R_CR_ID_to_string()</td>
01384  * <td><tt>"DES_EDE3"</tt></td>
01385  * <td>The string that represents a <tt>DES_EDE3</tt> type.</td>
01386  * </tr></table>
01387  */
01388 #define R_CR_ID_DES_EDE3                    NID_des_ede3
01389 /**
01390  * A cryptographic identifier which indicates a DES EDE CBC symmetric cipher.
01391  * The following table details the usage of the identifier
01392  * in @ref R_CR_CTX_FN.
01393  * @br
01394  * <table><tr>
01395  * <td><b>Function</b></td>
01396  * <td><b>String</b></td>
01397  * <td><b>Description</b></td>
01398  * </tr><tr>
01399  * <td>R_CR_ID_from_string()</td>
01400  * <td><tt>"DES_EDE_CBC"</tt></td>
01401  * <td>This string is interpreted as the <tt>DES_EDE_CBC</tt> type.</td>
01402  * </tr><tr>
01403  * <td>R_CR_ID_to_string()</td>
01404  * <td><tt>"DES_EDE_CBC"</tt></td>
01405  * <td>The string that represents a <tt>DES_EDE_CBC</tt> type.</td>
01406  * </tr></table>
01407  */
01408 #define R_CR_ID_DES_EDE_CBC                 NID_des_ede_cbc
01409 /**
01410  * A cryptographic identifier which indicates a DES EDE3 CBC symmetric cipher.
01411  * The following table details the usage of the identifier
01412  * in @ref R_CR_CTX_FN.
01413  * @br
01414  * <table><tr>
01415  * <td><b>Function</b></td>
01416  * <td><b>String</b></td>
01417  * <td><b>Description</b></td>
01418  * </tr><tr>
01419  * <td>R_CR_ID_from_string()</td>
01420  * <td><tt>"DES_EDE3_CBC"</tt></td>
01421  * <td>This string is interpreted as the <tt>DES_EDE3_CBC</tt> type.</td>
01422  * </tr><tr>
01423  * <td>R_CR_ID_to_string()</td>
01424  * <td><tt>"DES_EDE3_CBC"</tt></td>
01425  * <td>The string that represents a <tt>DES_EDE3_CBC</tt> type.</td>
01426  * </tr></table>
01427  */
01428 #define R_CR_ID_DES_EDE3_CBC                NID_des_ede3_cbc
01429 /**
01430  * A cryptographic identifier which indicates a DES EDE CFB64 symmetric cipher.
01431  * The following table details the usage of the identifier
01432  * in @ref R_CR_CTX_FN.
01433  * @br
01434  * <table><tr>
01435  * <td><b>Function</b></td>
01436  * <td><b>String</b></td>
01437  * <td><b>Description</b></td>
01438  * </tr><tr>
01439  * <td>R_CR_ID_from_string()</td>
01440  * <td><tt>"DES_EDE_CFB64"</tt></td>
01441  * <td>This string is interpreted as the <tt>DES_EDE_CFB64</tt> type.</td>
01442  * </tr><tr>
01443  * <td>R_CR_ID_to_string()</td>
01444  * <td><tt>"DES_EDE_CFB64"</tt></td>
01445  * <td>The string that represents a <tt>DES_EDE_CFB64</tt> type.</td>
01446  * </tr></table>
01447  */
01448 #define R_CR_ID_DES_EDE_CFB64               NID_des_ede_cfb64
01449 /**
01450  * A cryptographic identifier which indicates a DES EDE3 CFB64 symmetric 
01451  * cipher.
01452  * The following table details the usage of the identifier
01453  * in @ref R_CR_CTX_FN.
01454  * @br
01455  * <table><tr>
01456  * <td><b>Function</b></td>
01457  * <td><b>String</b></td>
01458  * <td><b>Description</b></td>
01459  * </tr><tr>
01460  * <td>R_CR_ID_from_string()</td>
01461  * <td><tt>"DES_EDE3_CFB64"</tt></td>
01462  * <td>This string is interpreted as the <tt>DES_EDE3_CFB64</tt> type.</td>
01463  * </tr><tr>
01464  * <td>R_CR_ID_to_string()</td>
01465  * <td><tt>"DES_EDE3_CFB64"</tt></td>
01466  * <td>The string that represents a <tt>DES_EDE3_CFB64</tt> type.</td>
01467  * </tr></table>
01468  */
01469 #define R_CR_ID_DES_EDE3_CFB64              NID_des_ede3_cfb64
01470 /**
01471  * A cryptographic identifier which indicates a DES EDE OFB64 symmetric cipher.
01472  * The following table details the usage of the identifier
01473  * in @ref R_CR_CTX_FN.
01474  * @br
01475  * <table><tr>
01476  * <td><b>Function</b></td>
01477  * <td><b>String</b></td>
01478  * <td><b>Description</b></td>
01479  * </tr><tr>
01480  * <td>R_CR_ID_from_string()</td>
01481  * <td><tt>"DES_EDE_OFB64"</tt></td>
01482  * <td>This string is interpreted as the <tt>DES_EDE_OFB64</tt> type.</td>
01483  * </tr><tr>
01484  * <td>R_CR_ID_to_string()</td>
01485  * <td><tt>"DES_EDE_OFB64"</tt></td>
01486  * <td>The string that represents a <tt>DES_EDE_OFB64</tt> type.</td>
01487  * </tr></table>
01488  */
01489 #define R_CR_ID_DES_EDE_OFB64               NID_des_ede_ofb64
01490 /**
01491  * A cryptographic identifier which indicates a DES EDE OFB64 symmetric cipher.
01492  * The following table details the usage of the identifier
01493  * in @ref R_CR_CTX_FN.
01494  * @br
01495  * <table><tr>
01496  * <td><b>Function</b></td>
01497  * <td><b>String</b></td>
01498  * <td><b>Description</b></td>
01499  * </tr><tr>
01500  * <td>R_CR_ID_from_string()</td>
01501  * <td><tt>"DES_EDE3_OFB64"</tt></td>
01502  * <td>This string is interpreted as the <tt>DES_EDE3_OFB64</tt> type.</td>
01503  * </tr><tr>
01504  * <td>R_CR_ID_to_string()</td>
01505  * <td><tt>"DES_EDE3_OFB64"</tt></td>
01506  * <td>The string that represents a <tt>DES_EDE3_OFB64</tt> type.</td>
01507  * </tr></table>
01508  */
01509 #define R_CR_ID_DES_EDE3_OFB64              NID_des_ede3_ofb64
01510 /**
01511  * A cryptographic identifier which indicates a DES 40-bit CBC symmetric
01512  * cipher.
01513  * The following table details the usage of the identifier
01514  * in @ref R_CR_CTX_FN.
01515  * @br
01516  * <table><tr>
01517  * <td><b>Function</b></td>
01518  * <td><b>String</b></td>
01519  * <td><b>Description</b></td>
01520  * </tr><tr>
01521  * <td>R_CR_ID_from_string()</td>
01522  * <td><tt>"DES_40_CBC"</tt></td>
01523  * <td>This string is interpreted as the <tt>DES_40_CBC</tt> type.</td>
01524  * </tr><tr>
01525  * <td>R_CR_ID_to_string()</td>
01526  * <td><tt>"DES_40_CBC"</tt></td>
01527  * <td>The string that represents a <tt>DES_40_CBC</tt> type.</td>
01528  * </tr></table>
01529  */
01530 #define R_CR_ID_DES_40_CBC                  NID_des_40_cbc
01531 /**
01532  * A cryptographic identifier which indicates a DES 40-bit CFB symmetric 
01533  * cipher.
01534  * The following table details the usage of the identifier
01535  * in @ref R_CR_CTX_FN.
01536  * @br
01537  * <table><tr>
01538  * <td><b>Function</b></td>
01539  * <td><b>String</b></td>
01540  * <td><b>Description</b></td>
01541  * </tr><tr>
01542  * <td>R_CR_ID_from_string()</td>
01543  * <td><tt>"DES_40_CFB"</tt></td>
01544  * <td>This string is interpreted as the <tt>DES_40_CFB</tt> type.</td>
01545  * </tr><tr>
01546  * <td>R_CR_ID_to_string()</td>
01547  * <td><tt>"DES_40_CFB"</tt></td>
01548  * <td>The string that represents a <tt>DES_40_CFB</tt> type.</td>
01549  * </tr></table>
01550  */
01551 #define R_CR_ID_DES_40_CFB                  NID_des_40_cfb
01552 /**
01553  * A cryptographic identifier which indicates a DES OFB symmetric cipher.
01554  * The following table details the usage of the identifier
01555  * in @ref R_CR_CTX_FN.
01556  * @br
01557  * <table><tr>
01558  * <td><b>Function</b></td>
01559  * <td><b>String</b></td>
01560  * <td><b>Description</b></td>
01561  * </tr><tr>
01562  * <td>R_CR_ID_from_string()</td>
01563  * <td><tt>"DES_OFB"</tt></td>
01564  * <td>This string is interpreted as the <tt>DES_OFB</tt> type.</td>
01565  * </tr><tr>
01566  * <td>R_CR_ID_to_string()</td>
01567  * <td><tt>"DES_OFB"</tt></td>
01568  * <td>The string that represents a <tt>DES_OFB</tt> type.</td>
01569  * </tr></table>
01570  */
01571 #define R_CR_ID_DES_OFB                     NID_des_ofb64
01572 
01573 /**
01574  * A cryptographic identifier which indicates an RC2 CBC symmetric cipher.
01575  * The following table details the usage of the identifier
01576  * in @ref R_CR_CTX_FN.
01577  * @br
01578  * <table><tr>
01579  * <td><b>Function</b></td>
01580  * <td><b>String</b></td>
01581  * <td><b>Description</b></td>
01582  * </tr><tr>
01583  * <td>R_CR_ID_from_string()</td>
01584  * <td><tt>"RC2_CBC"</tt></td>
01585  * <td>This string is interpreted as the <tt>RC2_CBC</tt> type.</td>
01586  * </tr><tr>
01587  * <td>R_CR_ID_to_string()</td>
01588  * <td><tt>"RC2_CBC"</tt></td>
01589  * <td>The string that represents an <tt>RC2_CBC</tt> type.</td>
01590  * </tr></table>
01591  */
01592 #define R_CR_ID_RC2_CBC                     NID_rc2_cbc
01593 /**
01594  * A cryptographic identifier which indicates an RC2 ECB symmetric cipher.
01595  * The following table details the usage of the identifier
01596  * in @ref R_CR_CTX_FN.
01597  * @br
01598  * <table><tr>
01599  * <td><b>Function</b></td>
01600  * <td><b>String</b></td>
01601  * <td><b>Description</b></td>
01602  * </tr><tr>
01603  * <td>R_CR_ID_from_string()</td>
01604  * <td><tt>"RC2_ECB"</tt></td>
01605  * <td>This string is interpreted as the <tt>RC2_ECB</tt> type.</td>
01606  * </tr><tr>
01607  * <td>R_CR_ID_to_string()</td>
01608  * <td><tt>"RC2_ECB"</tt></td>
01609  * <td>The string that represents an <tt>RC2_ECB</tt> type.</td>
01610  * </tr></table>
01611  */
01612 #define R_CR_ID_RC2_ECB                     NID_rc2_ecb
01613 /**
01614  * A cryptographic identifier which indicates an RC2 CFB symmetric cipher.
01615  * The following table details the usage of the identifier
01616  * in @ref R_CR_CTX_FN.
01617  * @br
01618  * <table><tr>
01619  * <td><b>Function</b></td>
01620  * <td><b>String</b></td>
01621  * <td><b>Description</b></td>
01622  * </tr><tr>
01623  * <td>R_CR_ID_from_string()</td>
01624  * <td><tt>"RC2_CFB"</tt></td>
01625  * <td>This string is interpreted as the <tt>RC2_CFB</tt> type.</td>
01626  * </tr><tr>
01627  * <td>R_CR_ID_to_string()</td>
01628  * <td><tt>"RC2_CFB"</tt></td>
01629  * <td>The string that represents an <tt>RC2_CFB</tt> type.</td>
01630  * </tr></table>
01631  */
01632 #define R_CR_ID_RC2_CFB                     NID_rc2_cfb64
01633 /**
01634  * A cryptographic identifier which indicates an RC2 OFB symmetric cipher.
01635  * The following table details the usage of the identifier
01636  * in @ref R_CR_CTX_FN.
01637  * @br
01638  * <table><tr>
01639  * <td><b>Function</b></td>
01640  * <td><b>String</b></td>
01641  * <td><b>Description</b></td>
01642  * </tr><tr>
01643  * <td>R_CR_ID_from_string()</td>
01644  * <td><tt>"RC2_OFB"</tt></td>
01645  * <td>This string is interpreted as the <tt>RC2_OFB</tt> type.</td>
01646  * </tr><tr>
01647  * <td>R_CR_ID_to_string()</td>
01648  * <td><tt>"RC2_OFB"</tt></td>
01649  * <td>The string that represents an <tt>RC2_OFB</tt> type.</td>
01650  * </tr></table>
01651  */
01652 #define R_CR_ID_RC2_OFB                     NID_rc2_ofb64
01653 /**
01654  * A cryptographic identifier which indicates an RC2 40-bit CBC symmetric
01655  * cipher.
01656  * The following table details the usage of the identifier
01657  * in @ref R_CR_CTX_FN.
01658  * @br
01659  * <table><tr>
01660  * <td><b>Function</b></td>
01661  * <td><b>String</b></td>
01662  * <td><b>Description</b></td>
01663  * </tr><tr>
01664  * <td>R_CR_ID_from_string()</td>
01665  * <td><tt>"RC2_40_CBC"</tt></td>
01666  * <td>This string is interpreted as the <tt>RC2_40_CBC</tt> type.</td>
01667  * </tr><tr>
01668  * <td>R_CR_ID_to_string()</td>
01669  * <td><tt>"RC2_40_CBC"</tt></td>
01670  * <td>The string that represents an <tt>RC2_40_CBC</tt> type.</td>
01671  * </tr></table>
01672  */
01673 #define R_CR_ID_RC2_40_CBC                  NID_rc2_40_cbc
01674 
01675 /**
01676  * A cryptographic identifier which indicates an RC4 symmetric cipher.
01677  * The following table details the usage of the identifier
01678  * in @ref R_CR_CTX_FN.
01679  * @br
01680  * <table><tr>
01681  * <td><b>Function</b></td>
01682  * <td><b>String</b></td>
01683  * <td><b>Description</b></td>
01684  * </tr><tr>
01685  * <td>R_CR_ID_from_string()</td>
01686  * <td><tt>"RC4"</tt></td>
01687  * <td>This string is interpreted as the <tt>RC4</tt> type.</td>
01688  * </tr><tr>
01689  * <td>R_CR_ID_to_string()</td>
01690  * <td><tt>"RC4"</tt></td>
01691  * <td>The string that represents an <tt>RC4</tt> type.</td>
01692  * </tr></table>
01693  */
01694 #define R_CR_ID_RC4                         NID_rc4
01695 /**
01696  * A cryptographic identifier which indicates an RC4 40-bit symmetric cipher.
01697  * The following table details the usage of the identifier
01698  * in @ref R_CR_CTX_FN.
01699  * @br
01700  * <table><tr>
01701  * <td><b>Function</b></td>
01702  * <td><b>String</b></td>
01703  * <td><b>Description</b></td>
01704  * </tr><tr>
01705  * <td>R_CR_ID_from_string()</td>
01706  * <td><tt>"RC4_40"</tt></td>
01707  * <td>This string is interpreted as the <tt>RC4_40</tt> type.</td>
01708  * </tr><tr>
01709  * <td>R_CR_ID_to_string()</td>
01710  * <td><tt>"RC4_40"</tt></td>
01711  * <td>The string that represents an <tt>RC4_40</tt> type.</td>
01712  * </tr></table>
01713  */
01714 #define R_CR_ID_RC4_40                      NID_rc4_40
01715 
01716 /**
01717  * A cryptographic identifier which indicates an RC5 CBC symmetric cipher.
01718  * The following table details the usage of the identifier
01719  * in @ref R_CR_CTX_FN.
01720  * @br
01721  * <table><tr>
01722  * <td><b>Function</b></td>
01723  * <td><b>String</b></td>
01724  * <td><b>Description</b></td>
01725  * </tr><tr>
01726  * <td>R_CR_ID_from_string()</td>
01727  * <td><tt>"RC5_CBC"</tt></td>
01728  * <td>This string is interpreted as the <tt>RC5_CBC</tt> type.</td>
01729  * </tr><tr>
01730  * <td>R_CR_ID_to_string()</td>
01731  * <td><tt>"RC5_CBC"</tt></td>
01732  * <td>The string that represents an <tt>RC5_CBC</tt> type.</td>
01733  * </tr></table>
01734  */
01735 #define R_CR_ID_RC5_CBC                     NID_rc5_cbc
01736 
01737 /*
01738  * Equivalent RC5-CBC identifier for compatibility with OpenSSL 
01739  */
01740 #define R_CR_ID_RC5_CBC_NO_PAD              NID_rc5_cbc_no_pad
01741 
01742 /**
01743  * A cryptographic identifier which indicates an RC5 ECB symmetric cipher.
01744  * The following table details the usage of the identifier
01745  * in @ref R_CR_CTX_FN.
01746  * @br
01747  * <table><tr>
01748  * <td><b>Function</b></td>
01749  * <td><b>String</b></td>
01750  * <td><b>Description</b></td>
01751  * </tr><tr>
01752  * <td>R_CR_ID_from_string()</td>
01753  * <td><tt>"RC5_ECB"</tt></td>
01754  * <td>This string is interpreted as the <tt>RC5_ECB</tt> type.</td>
01755  * </tr><tr>
01756  * <td>R_CR_ID_to_string()</td>
01757  * <td><tt>"RC5_ECB"</tt></td>
01758  * <td>The string that represents an <tt>RC5_ECB</tt> type.</td>
01759  * </tr></table>
01760  */
01761 #define R_CR_ID_RC5_ECB                     NID_rc5_ecb
01762 /**
01763  * A cryptographic identifier which indicates an RC5 CFB symmetric cipher.
01764  * The following table details the usage of the identifier
01765  * in @ref R_CR_CTX_FN.
01766  * @br
01767  * <table><tr>
01768  * <td><b>Function</b></td>
01769  * <td><b>String</b></td>
01770  * <td><b>Description</b></td>
01771  * </tr><tr>
01772  * <td>R_CR_ID_from_string()</td>
01773  * <td><tt>"RC5_CFB"</tt></td>
01774  * <td>This string is interpreted as the <tt>RC5_CFB</tt> type.</td>
01775  * </tr><tr>
01776  * <td>R_CR_ID_to_string()</td>
01777  * <td><tt>"RC5_CFB"</tt></td>
01778  * <td>The string that represents an <tt>RC5_CFB</tt> type.</td>
01779  * </tr></table>
01780  */
01781 #define R_CR_ID_RC5_CFB                     NID_rc5_cfb64
01782 /**
01783  * A cryptographic identifier which indicates an RC5 OFB symmetric cipher.
01784  * The following table details the usage of the identifier
01785  * in @ref R_CR_CTX_FN.
01786  * @br
01787  * <table><tr>
01788  * <td><b>Function</b></td>
01789  * <td><b>String</b></td>
01790  * <td><b>Description</b></td>
01791  * </tr><tr>
01792  * <td>R_CR_ID_from_string()</td>
01793  * <td><tt>"RC5_OFB"</tt></td>
01794  * <td>This string is interpreted as the <tt>RC5_OFB</tt> type.</td>
01795  * </tr><tr>
01796  * <td>R_CR_ID_to_string()</td>
01797  * <td><tt>"RC5_OFB"</tt></td>
01798  * <td>The string that represents an <tt>RC5_OFB</tt> type.</td>
01799  * </tr></table>
01800  */
01801 #define R_CR_ID_RC5_OFB                     NID_rc5_ofb64
01802 
01803 /*
01804  * A cryptographic identifier which indicates an RC6 CBC symmetric cipher.
01805  * The following table details the usage of the identifier
01806  * in @ref R_CR_CTX_FN.
01807  * @br
01808  * <table><tr>
01809  * <td><b>Function</b></td>
01810  * <td><b>String</b></td>
01811  * <td><b>Description</b></td>
01812  * </tr><tr>
01813  * <td>R_CR_ID_from_string()</td>
01814  * <td><tt>"RC6_CBC"</tt></td>
01815  * <td>This string is interpreted as the <tt>RC6_CBC</tt> type.</td>
01816  * </tr><tr>
01817  * <td>R_CR_ID_to_string()</td>
01818  * <td><tt>"RC6_CBC"</tt></td>
01819  * <td>The string that represents an <tt>RC6_CBC</tt> type.</td>
01820  * </tr></table>
01821  */
01822 #define R_CR_ID_RC6_CBC                     NID_rc6_cbc
01823 /*
01824  * A cryptographic identifier which indicates an RC6 ECB symmetric cipher.
01825  * The following table details the usage of the identifier
01826  * in @ref R_CR_CTX_FN.
01827  * @br
01828  * <table><tr>
01829  * <td><b>Function</b></td>
01830  * <td><b>String</b></td>
01831  * <td><b>Description</b></td>
01832  * </tr><tr>
01833  * <td>R_CR_ID_from_string()</td>
01834  * <td><tt>"RC6_ECB"</tt></td>
01835  * <td>This string is interpreted as the <tt>RC6_ECB</tt> type.</td>
01836  * </tr><tr>
01837  * <td>R_CR_ID_to_string()</td>
01838  * <td><tt>"RC6_ECB"</tt></td>
01839  * <td>The string that represents an <tt>RC6_ECB</tt> type.</td>
01840  * </tr></table>
01841  */
01842 #define R_CR_ID_RC6_ECB                     NID_rc6_ecb
01843 /*
01844  * A cryptographic identifier which indicates an RC6 CFB symmetric cipher.
01845  * The following table details the usage of the identifier
01846  * in @ref R_CR_CTX_FN.
01847  * @br
01848  * <table><tr>
01849  * <td><b>Function</b></td>
01850  * <td><b>String</b></td>
01851  * <td><b>Description</b></td>
01852  * </tr><tr>
01853  * <td>R_CR_ID_from_string()</td>
01854  * <td><tt>"RC6_CFB"</tt></td>
01855  * <td>This string is interpreted as the <tt>RC6_CFB</tt> type.</td>
01856  * </tr><tr>
01857  * <td>R_CR_ID_to_string()</td>
01858  * <td><tt>"RC6_CFB"</tt></td>
01859  * <td>The string that represents an <tt>RC6_CFB</tt> type.</td>
01860  * </tr></table>
01861  */
01862 #define R_CR_ID_RC6_CFB                     NID_rc6_cfb128
01863 /*
01864  * A cryptographic identifier which indicates an RC6 OFB symmetric cipher.
01865  * The following table details the usage of the identifier
01866  * in @ref R_CR_CTX_FN.
01867  * @br
01868  * <table><tr>
01869  * <td><b>Function</b></td>
01870  * <td><b>String</b></td>
01871  * <td><b>Description</b></td>
01872  * </tr><tr>
01873  * <td>R_CR_ID_from_string()</td>
01874  * <td><tt>"RC6_OFB"</tt></td>
01875  * <td>This string is interpreted as the <tt>RC6_OFB</tt> type.</td>
01876  * </tr><tr>
01877  * <td>R_CR_ID_to_string()</td>
01878  * <td><tt>"RC6_OFB"</tt></td>
01879  * <td>The string that represents an <tt>RC6_OFB</tt> type.</td>
01880  * </tr></table>
01881  */
01882 #define R_CR_ID_RC6_OFB                     NID_rc6_ofb128
01883 
01884 /**
01885  * A cryptographic identifier which indicates an AES 128 CBC symmetric cipher.
01886  * The following table details the usage of the identifier
01887  * in @ref R_CR_CTX_FN.
01888  * @br
01889  * <table><tr>
01890  * <td><b>Function</b></td>
01891  * <td><b>String</b></td>
01892  * <td><b>Description</b></td>
01893  * </tr><tr>
01894  * <td>R_CR_ID_from_string()</td>
01895  * <td><tt>"AES_128_CBC"</tt></td>
01896  * <td>This string is interpreted as the <tt>AES_128_CBC</tt> type.</td>
01897  * </tr><tr>
01898  * <td>R_CR_ID_to_string()</td>
01899  * <td><tt>"AES_128_CBC"</tt></td>
01900  * <td>The string that represents an <tt>AES_128_CBC</tt> type.</td>
01901  * </tr></table>
01902  */
01903 #define R_CR_ID_AES_128_CBC                 NID_aes128_cbc
01904 /**
01905  * A cryptographic identifier which indicates an AES 128 ECB symmetric cipher.
01906  * The following table details the usage of the identifier
01907  * in @ref R_CR_CTX_FN.
01908  * @br
01909  * <table><tr>
01910  * <td><b>Function</b></td>
01911  * <td><b>String</b></td>
01912  * <td><b>Description</b></td>
01913  * </tr><tr>
01914  * <td>R_CR_ID_from_string()</td>
01915  * <td><tt>"AES_128_ECB"</tt></td>
01916  * <td>This string is interpreted as the <tt>AES_128_ECB</tt> type.</td>
01917  * </tr><tr>
01918  * <td>R_CR_ID_to_string()</td>
01919  * <td><tt>"AES_128_ECB"</tt></td>
01920  * <td>The string that represents an <tt>AES_128_ECB</tt> type.</td>
01921  * </tr></table>
01922  */
01923 #define R_CR_ID_AES_128_ECB                 NID_aes128_ecb
01924 /**
01925  * A cryptographic identifier which indicates an AES 128 CFB symmetric cipher.
01926  * The following table details the usage of the identifier
01927  * in @ref R_CR_CTX_FN.
01928  * @br
01929  * <table><tr>
01930  * <td><b>Function</b></td>
01931  * <td><b>String</b></td>
01932  * <td><b>Description</b></td>
01933  * </tr><tr>
01934  * <td>R_CR_ID_from_string()</td>
01935  * <td><tt>"AES_128_CFB"</tt></td>
01936  * <td>This string is interpreted as the <tt>AES_128_CFB</tt> type.</td>
01937  * </tr><tr>
01938  * <td>R_CR_ID_to_string()</td>
01939  * <td><tt>"AES_128_CFB"</tt></td>
01940  * <td>The string that represents an <tt>AES_128_CFB</tt> type.</td>
01941  * </tr></table>
01942  */
01943 #define R_CR_ID_AES_128_CFB                 NID_aes128_cfb
01944 /**
01945  * A cryptographic identifier which indicates an AES 128 OFB symmetric cipher.
01946  * The following table details the usage of the identifier
01947  * in @ref R_CR_CTX_FN.
01948  * @br
01949  * <table><tr>
01950  * <td><b>Function</b></td>
01951  * <td><b>String</b></td>
01952  * <td><b>Description</b></td>
01953  * </tr><tr>
01954  * <td>R_CR_ID_from_string()</td>
01955  * <td><tt>"AES_128_OFB"</tt></td>
01956  * <td>This string is interpreted as the <tt>AES_128_OFB</tt> type.</td>
01957  * </tr><tr>
01958  * <td>R_CR_ID_to_string()</td>
01959  * <td><tt>"AES_128_OFB"</tt></td>
01960  * <td>The string that represents an <tt>AES_128_OFB</tt> type.</td>
01961  * </tr></table>
01962  */
01963 #define R_CR_ID_AES_128_OFB                 NID_aes128_ofb
01964 
01965 /**
01966  * A cryptographic identifier which indicates an AES 192 CBC symmetric cipher.
01967  * The following table details the usage of the identifier
01968  * in @ref R_CR_CTX_FN.
01969  * @br
01970  * <table><tr>
01971  * <td><b>Function</b></td>
01972  * <td><b>String</b></td>
01973  * <td><b>Description</b></td>
01974  * </tr><tr>
01975  * <td>R_CR_ID_from_string()</td>
01976  * <td><tt>"AES_192_CBC"</tt></td>
01977  * <td>This string is interpreted as the <tt>AES_192_CBC</tt> type.</td>
01978  * </tr><tr>
01979  * <td>R_CR_ID_to_string()</td>
01980  * <td><tt>"AES_192_CBC"</tt></td>
01981  * <td>The string that represents an <tt>AES_192_CBC</tt> type.</td>
01982  * </tr></table>
01983  */
01984 #define R_CR_ID_AES_192_CBC                 NID_aes192_cbc
01985 /**
01986  * A cryptographic identifier which indicates an AES 192 ECB symmetric cipher.
01987  * The following table details the usage of the identifier
01988  * in @ref R_CR_CTX_FN.
01989  * @br
01990  * <table><tr>
01991  * <td><b>Function</b></td>
01992  * <td><b>String</b></td>
01993  * <td><b>Description</b></td>
01994  * </tr><tr>
01995  * <td>R_CR_ID_from_string()</td>
01996  * <td><tt>"AES_192_ECB"</tt></td>
01997  * <td>This string is interpreted as the <tt>AES_192_ECB</tt> type.</td>
01998  * </tr><tr>
01999  * <td>R_CR_ID_to_string()</td>
02000  * <td><tt>"AES_192_ECB"</tt></td>
02001  * <td>The string that represents an <tt>AES_192_ECB</tt> type.</td>
02002  * </tr></table>
02003  */
02004 #define R_CR_ID_AES_192_ECB                 NID_aes192_ecb
02005 /**
02006  * A cryptographic identifier which indicates an AES 192 CFB symmetric cipher.
02007  * The following table details the usage of the identifier
02008  * in @ref R_CR_CTX_FN.
02009  * @br
02010  * <table><tr>
02011  * <td><b>Function</b></td>
02012  * <td><b>String</b></td>
02013  * <td><b>Description</b></td>
02014  * </tr><tr>
02015  * <td>R_CR_ID_from_string()</td>
02016  * <td><tt>"AES_192_CFB"</tt></td>
02017  * <td>This string is interpreted as the <tt>AES_192_CFB</tt> type.</td>
02018  * </tr><tr>
02019  * <td>R_CR_ID_to_string()</td>
02020  * <td><tt>"AES_192_CFB"</tt></td>
02021  * <td>The string that represents an <tt>AES_192_CFB</tt> type.</td>
02022  * </tr></table>
02023  */
02024 #define R_CR_ID_AES_192_CFB                 NID_aes192_cfb
02025 /**
02026  * A cryptographic identifier which indicates an AES 192 OFB symmetric cipher.
02027  * The following table details the usage of the identifier
02028  * in @ref R_CR_CTX_FN.
02029  * @br
02030  * <table><tr>
02031  * <td><b>Function</b></td>
02032  * <td><b>String</b></td>
02033  * <td><b>Description</b></td>
02034  * </tr><tr>
02035  * <td>R_CR_ID_from_string()</td>
02036  * <td><tt>"AES_192_OFB"</tt></td>
02037  * <td>This string is interpreted as the <tt>AES_192_OFB</tt> type.</td>
02038  * </tr><tr>
02039  * <td>R_CR_ID_to_string()</td>
02040  * <td><tt>"AES_192_OFB"</tt></td>
02041  * <td>The string that represents an <tt>AES_192_OFB</tt> type.</td>
02042  * </tr></table>
02043  */
02044 #define R_CR_ID_AES_192_OFB                 NID_aes192_ofb
02045 
02046 /**
02047  * A cryptographic identifier which indicates an AES 256 CBC symmetric cipher.
02048  * The following table details the usage of the identifier
02049  * in @ref R_CR_CTX_FN.
02050  * @br
02051  * <table><tr>
02052  * <td><b>Function</b></td>
02053  * <td><b>String</b></td>
02054  * <td><b>Description</b></td>
02055  * </tr><tr>
02056  * <td>R_CR_ID_from_string()</td>
02057  * <td><tt>"AES_256_CBC"</tt></td>
02058  * <td>This string is interpreted as the <tt>AES_256_CBC</tt> type.</td>
02059  * </tr><tr>
02060  * <td>R_CR_ID_to_string()</td>
02061  * <td><tt>"AES_256_CBC"</tt></td>
02062  * <td>The string that represents an <tt>AES_256_CBC</tt> type.</td>
02063  * </tr></table>
02064  */
02065 #define R_CR_ID_AES_256_CBC                 NID_aes256_cbc
02066 /**
02067  * A cryptographic identifier which indicates an AES 256 ECB symmetric cipher.
02068  * The following table details the usage of the identifier
02069  * in @ref R_CR_CTX_FN.
02070  * @br
02071  * <table><tr>
02072  * <td><b>Function</b></td>
02073  * <td><b>String</b></td>
02074  * <td><b>Description</b></td>
02075  * </tr><tr>
02076  * <td>R_CR_ID_from_string()</td>
02077  * <td><tt>"AES_256_ECB"</tt></td>
02078  * <td>This string is interpreted as the <tt>AES_256_ECB</tt> type.</td>
02079  * </tr><tr>
02080  * <td>R_CR_ID_to_string()</td>
02081  * <td><tt>"AES_256_ECB"</tt></td>
02082  * <td>The string that represents an <tt>AES_256_ECB</tt> type.</td>
02083  * </tr></table>
02084  */
02085 #define R_CR_ID_AES_256_ECB                 NID_aes256_ecb
02086 /**
02087  * A cryptographic identifier which indicates an AES 256 CFB symmetric cipher.
02088  * The following table details the usage of the identifier
02089  * in @ref R_CR_CTX_FN.
02090  * @br
02091  * <table><tr>
02092  * <td><b>Function</b></td>
02093  * <td><b>String</b></td>
02094  * <td><b>Description</b></td>
02095  * </tr><tr>
02096  * <td>R_CR_ID_from_string()</td>
02097  * <td><tt>"AES_256_CFB"</tt></td>
02098  * <td>This string is interpreted as the <tt>AES_256_CFB</tt> type.</td>
02099  * </tr><tr>
02100  * <td>R_CR_ID_to_string()</td>
02101  * <td><tt>"AES_256_CFB"</tt></td>
02102  * <td>The string that represents an <tt>AES_256_CFB</tt> type.</td>
02103  * </tr></table>
02104  */
02105 #define R_CR_ID_AES_256_CFB                 NID_aes256_cfb
02106 /**
02107  * A cryptographic identifier which indicates an AES 256 OFB symmetric cipher.
02108  * The following table details the usage of the identifier
02109  * in @ref R_CR_CTX_FN.
02110  * @br
02111  * <table><tr>
02112  * <td><b>Function</b></td>
02113  * <td><b>String</b></td>
02114  * <td><b>Description</b></td>
02115  * </tr><tr>
02116  * <td>R_CR_ID_from_string()</td>
02117  * <td><tt>"AES_256_OFB"</tt></td>
02118  * <td>This string is interpreted as the <tt>AES_256_OFB</tt> type.</td>
02119  * </tr><tr>
02120  * <td>R_CR_ID_to_string()</td>
02121  * <td><tt>"AES_256_OFB"</tt></td>
02122  * <td>The string that represents an <tt>AES_256_OFB</tt> type.</td>
02123  * </tr></table>
02124  */
02125 #define R_CR_ID_AES_256_OFB                 NID_aes256_ofb
02126 
02127 /**
02128  * A cryptographic identifier which indicates an asymmetric RSA cipher.
02129  * The following table details the usage of the identifier
02130  * in @ref R_CR_CTX_FN.
02131  * @br
02132  * <table><tr>
02133  * <td><b>Function</b></td>
02134  * <td><b>String</b></td>
02135  * <td><b>Description</b></td>
02136  * </tr><tr>
02137  * <td>R_CR_ID_from_string()</td>
02138  * <td><tt>"RSA"</tt></td>
02139  * <td>This string is interpreted as the <tt>RSA</tt> type.</td>
02140  * </tr><tr>
02141  * <td>R_CR_ID_to_string()</td>
02142  * <td><tt>"RSA"</tt></td>
02143  * <td>The string that represents an <tt>RSA</tt> type.</td>
02144  * </tr></table>
02145  */
02146 #define R_CR_ID_RSA                         NID_rsa
02147 /**
02148  * A cryptographic identifier which indicates an asymmetric RSA PKCS1 padding 
02149  * cipher.
02150  * The following table details the usage of the identifier
02151  * in @ref R_CR_CTX_FN.
02152  * @br
02153  * <table><tr>
02154  * <td><b>Function</b></td>
02155  * <td><b>String</b></td>
02156  * <td><b>Description</b></td>
02157  * </tr><tr>
02158  * <td>R_CR_ID_from_string()</td>
02159  * <td><tt>"RSA_PKCS1"</tt></td>
02160  * <td>This string is interpreted as the <tt>RSA_PKCS1</tt> type.</td>
02161  * </tr><tr>
02162  * <td>R_CR_ID_to_string()</td>
02163  * <td><tt>"RSA_PKCS1"</tt></td>
02164  * <td>The string that represents an <tt>RSA_PKCS1</tt> type.</td>
02165  * </tr></table>
02166  */
02167 #define R_CR_ID_RSA_PKCS1                   NID_rsaEncryption
02168 /**
02169  * A cryptographic identifier which indicates an asymmetric RSA PKCS #1 OAEP
02170  * padding cipher.
02171  * The following table details the usage of the identifier
02172  * in @ref R_CR_CTX_FN.
02173  * @br
02174  * <table><tr>
02175  * <td><b>Function</b></td>
02176  * <td><b>String</b></td>
02177  * <td><b>Description</b></td>
02178  * </tr><tr>
02179  * <td>R_CR_ID_from_string()</td>
02180  * <td><tt>"RSA_PKCS1_OAEP"</tt></td>
02181  * <td>This string is interpreted as the <tt>RSA_PKCS1_OAEP</tt> type.</td>
02182  * </tr><tr>
02183  * <td>R_CR_ID_to_string()</td>
02184  * <td><tt>"RSA_PKCS1_OAEP"</tt></td>
02185  * <td>The string that represents an <tt>RSA_PKCS1_OAEP</tt> type.</td>
02186  * </tr></table>
02187  */
02188 #define R_CR_ID_RSA_PKCS1_OAEP              NID_rsaes_oaep
02189 /**
02190  * A cryptographic identifier which indicates an asymmetric RSA PKCS #1 SSL 
02191  * padding cipher.
02192  * The following table details the usage of the identifier
02193  * in @ref R_CR_CTX_FN.
02194  * @br
02195  * <table><tr>
02196  * <td><b>Function</b></td>
02197  * <td><b>String</b></td>
02198  * <td><b>Description</b></td>
02199  * </tr><tr>
02200  * <td>R_CR_ID_from_string()</td>
02201  * <td><tt>"RSA_PKCS1_SSL"</tt></td>
02202  * <td>This string is interpreted as the <tt>RSA_PKCS1_SSL</tt> type.</td>
02203  * </tr><tr>
02204  * <td>R_CR_ID_to_string()</td>
02205  * <td><tt>"RSA_PKCS1_SSL"</tt></td>
02206  * <td>The string that represents an <tt>RSA_PKCS1_SSL</tt> type.</td>
02207  * </tr></table>
02208  */
02209 #define R_CR_ID_RSA_PKCS1_SSL               R_CR_ID_LOCAL(7)
02210 
02211 /**
02212  * A cryptographic identifier which indicates an asymmetric DSA signature 
02213  * cipher.
02214  * The following table details the usage of the identifier
02215  * in @ref R_CR_CTX_FN.
02216  * @br
02217  * <table><tr>
02218  * <td><b>Function</b></td>
02219  * <td><b>String</b></td>
02220  * <td><b>Description</b></td>
02221  * </tr><tr>
02222  * <td>R_CR_ID_from_string()</td>
02223  * <td><tt>"DSA"</tt></td>
02224  * <td>This string is interpreted as the <tt>DSA</tt> type.</td>
02225  * </tr><tr>
02226  * <td>R_CR_ID_to_string()</td>
02227  * <td><tt>"DSA"</tt></td>
02228  * <td>The string that represents a <tt>DSA</tt> type.</td>
02229  * </tr></table>
02230  */
02231 #define R_CR_ID_DSA                         NID_dsa
02232 
02233 /* Defines for signing and verify */
02234 /**
02235  * A cryptographic identifier which indicates a DSA signature with SHA-1
02236  * digest.
02237  * The following table details the usage of the identifier
02238  * in @ref R_CR_CTX_FN.
02239  * @br
02240  * <table><tr>
02241  * <td><b>Function</b></td>
02242  * <td><b>String</b></td>
02243  * <td><b>Description</b></td>
02244  * </tr><tr>
02245  * <td>R_CR_ID_from_string()</td>
02246  * <td><tt>"SHA1_DSA"</tt></td>
02247  * <td>This string is interpreted as the <tt>SHA1_DSA</tt> type.</td>
02248  * </tr><tr>
02249  * <td>R_CR_ID_to_string()</td>
02250  * <td><tt>"SHA1_DSA"</tt></td>
02251  * <td>The string that represents a <tt>SHA1_DSA</tt> type.</td>
02252  * </tr></table>
02253  */
02254 #define R_CR_ID_SHA1_DSA                    NID_dsaWithSHA1
02255 
02256 /**
02257  * A cryptographic identifier which indicates an RSA signature with SHA-1
02258  * digest.
02259  * The following table details the usage of the identifier
02260  * in @ref R_CR_CTX_FN.
02261  * @br
02262  * <table><tr>
02263  * <td><b>Function</b></td>
02264  * <td><b>String</b></td>
02265  * <td><b>Description</b></td>
02266  * </tr><tr>
02267  * <td>R_CR_ID_from_string()</td>
02268  * <td><tt>"SHA1_RSA"</tt></td>
02269  * <td>This string is interpreted as the <tt>SHA1_RSA</tt> type.</td>
02270  * </tr><tr>
02271  * <td>R_CR_ID_to_string()</td>
02272  * <td><tt>"SHA1_RSA"</tt></td>
02273  * <td>The string that represents a <tt>SHA1_RSA</tt> type.</td>
02274  * </tr></table>
02275  */
02276 #define R_CR_ID_SHA1_RSA                    NID_sha1WithRSAEncryption
02277 /**
02278  * A cryptographic identifier which indicates an RSA signature with MD2 digest.
02279  * The following table details the usage of the identifier
02280  * in @ref R_CR_CTX_FN.
02281  * @br
02282  * <table><tr>
02283  * <td><b>Function</b></td>
02284  * <td><b>String</b></td>
02285  * <td><b>Description</b></td>
02286  * </tr><tr>
02287  * <td>R_CR_ID_from_string()</td>
02288  * <td><tt>"MD2_RSA"</tt></td>
02289  * <td>This string is interpreted as the <tt>MD2_RSA</tt> type.</td>
02290  * </tr><tr>
02291  * <td>R_CR_ID_to_string()</td>
02292  * <td><tt>"MD2_RSA"</tt></td>
02293  * <td>The string that represents a <tt>MD2_RSA</tt> type.</td>
02294  * </tr></table>
02295  */
02296 #define R_CR_ID_MD2_RSA                     NID_md2WithRSAEncryption
02297 /**
02298  * A cryptographic identifier which indicates an RSA signature with MD5 digest.
02299  * The following table details the usage of the identifier
02300  * in @ref R_CR_CTX_FN.
02301  * @br
02302  * <table><tr>
02303  * <td><b>Function</b></td>
02304  * <td><b>String</b></td>
02305  * <td><b>Description</b></td>
02306  * </tr><tr>
02307  * <td>R_CR_ID_from_string()</td>
02308  * <td><tt>"MD5_RSA"</tt></td>
02309  * <td>This string is interpreted as the <tt>MD5_RSA</tt> type.</td>
02310  * </tr><tr>
02311  * <td>R_CR_ID_to_string()</td>
02312  * <td><tt>"MD5_RSA"</tt></td>
02313  * <td>The string that represents a <tt>MD5_RSA</tt> type.</td>
02314  * </tr></table>
02315  */
02316 #define R_CR_ID_MD5_RSA                     NID_md5WithRSAEncryption
02317 
02318 /**
02319  * A signature type identifier which indicates none.
02320  * The following table details the usage of the identifier
02321  * in @ref R_CR_CTX_FN.
02322  * @br
02323  * <table><tr>
02324  * <td><b>Function</b></td>
02325  * <td><b>String</b></td>
02326  * <td><b>Description</b></td>
02327  * </tr><tr>
02328  * <td>R_CR_ID_from_string()</td>
02329  * <td><tt>"SIGNATURE_TYPE_NONE"</tt></td>
02330  * <td>This string is interpreted as the <tt>SIGNATURE_TYPE_NONE</tt> 
02331  *     type.</td>
02332  * </tr><tr>
02333  * <td>R_CR_ID_to_string()</td>
02334  * <td><tt>"SIGNATURE_TYPE_NONE"</tt></td>
02335  * <td>The string that represents a <tt>SIGNATURE_TYPE_NONE</tt> 
02336  *     type.</td>
02337  * </tr></table>
02338  */
02339 #define R_CR_ID_SIGNATURE_TYPE_NONE         R_CR_ID_NULL
02340 /**
02341  * A signature type identifier which indicates Distinguished Encoding Rules
02342  * (DER).
02343  * The following table details the usage of the identifier
02344  * in @ref R_CR_CTX_FN.
02345  * @br
02346  * <table><tr>
02347  * <td><b>Function</b></td>
02348  * <td><b>String</b></td>
02349  * <td><b>Description</b></td>
02350  * </tr><tr>
02351  * <td>R_CR_ID_from_string()</td>
02352  * <td><tt>"SIGNATURE_TYPE_DER"</tt></td>
02353  * <td>This string is interpreted as the <tt>SIGNATURE_TYPE_DER</tt> 
02354  *     type.</td>
02355  * </tr><tr>
02356  * <td>R_CR_ID_to_string()</td>
02357  * <td><tt>"SIGNATURE_TYPE_DER"</tt></td>
02358  * <td>The string that represents a <tt>SIGNATURE_TYPE_DER</tt> 
02359  *     type.</td>
02360  * </tr></table>
02361  */
02362 #define R_CR_ID_SIGNATURE_TYPE_DER          1
02363 
02364 /* Defines for key exchange methods */
02365 /**
02366  * A cryptographic identifier which indicates the Diffie-Hellman key agreement.
02367  * The following table details the usage of the identifier
02368  * in @ref R_CR_CTX_FN.
02369  * @br
02370  * <table><tr>
02371  * <td><b>Function</b></td>
02372  * <td><b>String</b></td>
02373  * <td><b>Description</b></td>
02374  * </tr><tr>
02375  * <td>R_CR_ID_from_string()</td>
02376  * <td><tt>"KE_DH"</tt></td>
02377  * <td>This string is interpreted as the <tt>KE_DH</tt> type.</td>
02378  * </tr><tr>
02379  * <td>R_CR_ID_to_string()</td>
02380  * <td><tt>"KE_DH"</tt></td>
02381  * <td>The string that represents a <tt>KE_DH</tt> type.</td>
02382  * </tr></table>
02383  */
02384 #define R_CR_ID_KE_DH                       NID_dhKeyAgreement
02385 
02386 /* Defines for key generation methods */
02387 /**
02388  * A cryptographic identifier which indicates RSA key generation.
02389  * The following table details the usage of the identifier
02390  * in @ref R_CR_CTX_FN.
02391  * @br
02392  * <table><tr>
02393  * <td><b>Function</b></td>
02394  * <td><b>String</b></td>
02395  * <td><b>Description</b></td>
02396  * </tr><tr>
02397  * <td>R_CR_ID_from_string()</td>
02398  * <td><tt>"RSA_KEY_GENERATION"</tt></td>
02399  * <td>This string is interpreted as the <tt>RSA_KEY_GENERATION</tt> type.</td>
02400  * </tr><tr>
02401  * <td>R_CR_ID_to_string()</td>
02402  * <td><tt>"RSA_KEY_GENERATION"</tt></td>
02403  * <td>The string that represents an <tt>RSA_KEY_GENERATION</tt> type.</td>
02404  * </tr></table>
02405  */
02406 #define R_CR_ID_RSA_KEY_GENERATION          R_CR_ID_LOCAL(3)
02407 /**
02408  * A cryptographic identifier which indicates DSA key generation.
02409  * The following table details the usage of the identifier
02410  * in @ref R_CR_CTX_FN.
02411  * @br
02412  * <table><tr>
02413  * <td><b>Function</b></td>
02414  * <td><b>String</b></td>
02415  * <td><b>Description</b></td>
02416  * </tr><tr>
02417  * <td>R_CR_ID_from_string()</td>
02418  * <td><tt>"DSA_KEY_GENERATION"</tt></td>
02419  * <td>This string is interpreted as the <tt>DSA_KEY_GENERATION</tt> type.</td>
02420  * </tr><tr>
02421  * <td>R_CR_ID_to_string()</td>
02422  * <td><tt>"DSA_KEY_GENERATION"</tt></td>
02423  * <td>The string that represents a <tt>DSA_KEY_GENERATION</tt> type.</td>
02424  * </tr></table>
02425  */
02426 #define R_CR_ID_DSA_KEY_GENERATION          R_CR_ID_LOCAL(4)
02427 /**
02428  * A cryptographic identifier which indicates DSA parameter generation.
02429  * The following table details the usage of the identifier
02430  * in @ref R_CR_CTX_FN.
02431  * @br
02432  * <table><tr>
02433  * <td><b>Function</b></td>
02434  * <td><b>String</b></td>
02435  * <td><b>Description</b></td>
02436  * </tr><tr>
02437  * <td>R_CR_ID_from_string()</td>
02438  * <td><tt>"DSA_PARAMETER_GENERATION"</tt></td>
02439  * <td>This string is interpreted as the <tt>DSA_PARAMETER_GENERATION</tt>
02440  *     type.</td>
02441  * </tr><tr>
02442  * <td>R_CR_ID_to_string()</td>
02443  * <td><tt>"DSA_PARAMETER_GENERATION"</tt></td>
02444  * <td>The string that represents a <tt>DSA_PARAMETER_GENERATION</tt>
02445  *     type.</td>
02446  * </tr></table>
02447  */
02448 #define R_CR_ID_DSA_PARAMETER_GENERATION    R_CR_ID_LOCAL(5)
02449 /**
02450  * A cryptographic identifier which indicates Diffie-Hellman parameter
02451  * generation.
02452  * The following table details the usage of the identifier
02453  * in @ref R_CR_CTX_FN.
02454  * @br
02455  * <table><tr>
02456  * <td><b>Function</b></td>
02457  * <td><b>String</b></td>
02458  * <td><b>Description</b></td>
02459  * </tr><tr>
02460  * <td>R_CR_ID_from_string()</td>
02461  * <td><tt>"DH_PARAMETER_GENERATION"</tt></td>
02462  * <td>This string is interpreted as the <tt>DH_PARAMETER_GENERATION</tt>
02463  *     type.</td>
02464  * </tr><tr>
02465  * <td>R_CR_ID_to_string()</td>
02466  * <td><tt>"DH_PARAMETER_GENERATION"</tt></td>
02467  * <td>The string that represents a <tt>DH_PARAMETER_GENERATION</tt>
02468  *     type.</td>
02469  * </tr></table>
02470  */
02471 #define R_CR_ID_DH_PARAMETER_GENERATION     R_CR_ID_LOCAL(6)
02472 
02473 #define R_CR_ID_ECDSA_SHA1                  NID_ECDSAwithSHA1
02474 
02475 /**
02476  * @}
02477  */
02478 
02479 /**
02480  * @defgroup R_CR_INFO_ID Cryptographic Operation Property Identifiers
02481  * This section details the defines used in the setting and/or retrieval of 
02482  * data from the cryptographic object.
02483  * The following table details the data types to pass into <i>param</i> when
02484  * calling R_CR_get_info().
02485  * @br
02486  * <table><tr>
02487  *     <td><b>Identifier</b></td>
02488  *     <td><b>Param Data Type</b></td>
02489  * </tr><tr>
02490  *     <td>#R_CR_INFO_ID_SUPPORTED</td>
02491  *     <td><tt>long *</tt></td>
02492  * </tr><tr>
02493  *     <td>#R_CR_INFO_ID_KEY_LEN</td>
02494  *     <td><tt>int *</tt></td>
02495  * </tr><tr>
02496  *     <td>#R_CR_INFO_ID_IS_EXPORT</td>
02497  *     <td><tt>long *</tt></td>
02498  * </tr><tr>
02499  *     <td>#R_CR_INFO_ID_CIPHER_EXP_KEY_LEN</td>
02500  *     <td><tt>int *</tt></td>
02501  * </tr><tr>
02502  *     <td>#R_CR_INFO_ID_CIPHER_IV_LEN</td>
02503  *     <td><tt>int *</tt></td>
02504  * </tr><tr>
02505  *     <td>#R_CR_INFO_ID_CIPHER_PARAM</td>
02506  *     <td><tt>long *</tt></td>
02507  * </tr><tr>
02508  *     <td>#R_CR_INFO_ID_CIPHER_ROUNDS</td>
02509  *     <td><tt>long *</tt></td>
02510  * </tr><tr>
02511  *     <td>#R_CR_INFO_ID_CIPHER_BLOCK_SIZE</td>
02512  *     <td><tt>int *</tt></td>
02513  * </tr><tr>
02514  *     <td>#R_CR_INFO_ID_DIGEST_MAC_LEN</td>
02515  *     <td><tt>int *</tt></td>
02516  * </tr><tr>
02517  *     <td>#R_CR_INFO_ID_DIGEST_BLOCK_SIZE</td>
02518  *     <td><tt>int *</tt></td>
02519  * </tr><tr>
02520  *     <td>#R_CR_INFO_ID_CIPHER_BITS</td>
02521  *     <td><tt>long *</tt></td>
02522  * </tr><tr>
02523  *     <td>#R_CR_INFO_ID_SURRENDER</td>
02524  *     <td>#R_SURRENDER **</td>
02525  * </tr><tr>
02526  *     <td>#R_CR_INFO_ID_CRYPTO_TYPE</td>
02527  *     <td><tt>int *</tt></td>
02528  * </tr><tr>
02529  *     <td>#R_CR_INFO_ID_CRYPTO_ID</td>
02530  *     <td><tt>int *</tt></td>
02531  * </tr><tr>
02532  *     <td>#R_CR_INFO_ID_CRYPTO_SUB</td>
02533  *     <td><tt>int *</tt></td>
02534  * </tr><tr>
02535  *     <td>#R_CR_INFO_ID_BLOCK_PADDING</td>
02536  *     <td><tt>int *</tt></td>
02537  * </tr><tr>
02538  *     <td>#R_CR_INFO_ID_FLAGS</td>
02539  *     <td><tt>int *</tt></td>
02540  * </tr><tr>
02541  *     <td>#R_CR_INFO_ID_PUBLIC_KEY</td>
02542  *     <td><tt>unsigned long *</tt></td>
02543  * </tr><tr>
02544  *     <td>#R_CR_INFO_ID_PRIVATE_KEY</td>
02545  *     <td><tt>unsigned long *</tt></td>
02546  * </tr><tr>
02547  *     <td>#R_CR_INFO_ID_DSA_P</td>
02548  *     <td>#R_ITEM *</td>
02549  * </tr><tr>
02550  *     <td>#R_CR_INFO_ID_DSA_Q</td>
02551  *     <td>#R_ITEM *</td>
02552  * </tr><tr>
02553  *     <td>#R_CR_INFO_ID_DSA_G</td>
02554  *     <td>#R_ITEM *</td>
02555  * </tr><tr>
02556  *     <td>#R_CR_INFO_ID_DSA_PARAMETERS</td>
02557  *     <td>#R_PKEY *</td>
02558  * </tr><tr>
02559  *     <td>#R_CR_INFO_ID_SIGNATURE</td>
02560  *     <td><tt>int *</tt></td>
02561  * </tr><tr>
02562  *     <td>#R_CR_INFO_ID_RAND_ENTROPY_FUNC</td>
02563  *     <td>#R_RAND_ENT_FUNC_T *</td>
02564  * </tr><tr>
02565  * </tr></table>
02566  * @br
02567  *
02568  * The following table details the data types to pass into <i>param</i> when
02569  * calling R_CR_set_info().
02570  * @br
02571  * <table><tr>
02572  *     <td><b>Identifier</b></td>
02573  *     <td><b>Param Data Type</b></td>
02574  * </tr><tr>
02575  *     <td>#R_CR_INFO_ID_CIPHER_ROUNDS</td>
02576  *     <td><tt>int *</tt></td>
02577  * </tr><tr>
02578  *     <td>#R_CR_INFO_ID_CIPHER_BITS</td>
02579  *     <td><tt>int *</tt></td>
02580  * </tr><tr>
02581  *     <td>#R_CR_INFO_ID_SURRENDER</td>
02582  *     <td>#R_SURRENDER *</td>
02583  * </tr><tr>
02584  *     <td>#R_CR_INFO_ID_BLOCK_PADDING</td>
02585  *     <td><tt>int *</tt></td>
02586  * </tr><tr>
02587  *     <td>#R_CR_INFO_ID_FLAGS</td>
02588  *     <td><tt>int</tt></td>
02589  * </tr><tr>
02590  *     <td>#R_CR_INFO_ID_NUM_BITS</td>
02591  *     <td><tt>unsigned int *</tt></td>
02592  * </tr><tr>
02593  *     <td>#R_CR_INFO_ID_NUM_PRIMES</td>
02594  *     <td><tt>unsigned int *</tt></td>
02595  * </tr><tr>
02596  *     <td>#R_CR_INFO_ID_PUBLIC_KEY</td>
02597  *     <td><tt>unsigned long *</tt></td>
02598  * </tr><tr>
02599  *     <td>#R_CR_INFO_ID_PRIVATE_KEY</td>
02600  *     <td><tt>unsigned long *</tt></td>
02601  * </tr><tr>
02602  *     <td>#R_CR_INFO_ID_DSA_P</td>
02603  *     <td>#R_ITEM *</td>
02604  * </tr><tr>
02605  *     <td>#R_CR_INFO_ID_DSA_Q</td>
02606  *     <td>#R_ITEM *</td>
02607  * </tr><tr>
02608  *     <td>#R_CR_INFO_ID_DSA_G</td>
02609  *     <td>#R_ITEM *</td>
02610  * </tr><tr>
02611  *     <td>#R_CR_INFO_ID_DH_PRIME_LENGTH</td>
02612  *     <td><tt>unsigned long *</tt></td>
02613  * </tr><tr>
02614  *     <td>#R_CR_INFO_ID_DH_GENERATOR_ORDER</td>
02615  *     <td><tt>unsigned long *</tt></td>
02616  * </tr><tr>
02617  *     <td>#R_CR_INFO_ID_RSA_E</td>
02618  *     <td><tt>unsigned long *</tt></td>
02619  * </tr><tr>
02620  *     <td>#R_CR_INFO_ID_DSA_PARAMETERS</td>
02621  *     <td>#R_PKEY *</td>
02622  * </tr><tr>
02623  *     <td>#R_CR_INFO_ID_SIGNATURE</td>
02624  *     <td><tt>int *</tt></td>
02625  * </tr><tr>
02626  *     <td>#R_CR_INFO_ID_RAND_ADD_ENTROPY</td>
02627  *     <td><tt>int *</tt></td>
02628  * </tr><tr>
02629  *     <td>#R_CR_INFO_ID_RAND_LOAD_FILE</td>
02630  *     <td><tt>char *</tt></td>
02631  * </tr><tr>
02632  *     <td>#R_CR_INFO_ID_RAND_ENTROPY_FUNC</td>
02633  *     <td>#R_RAND_ENT_FUNC_T *</td>
02634  * </tr><tr>
02635  * </tr></table>
02636  * @br
02637  * @ingroup CRYPTO_MODULE
02638  * @{
02639  */
02640 /**
02641  * A cryptographic identifier which indicates that the algorithm is supported.
02642  */
02643 #define R_CR_INFO_ID_SUPPORTED              0
02644 /**
02645  * A cryptographic identifier which indicates the key length.
02646  */
02647 #define R_CR_INFO_ID_KEY_LEN                1
02648 /**
02649  * A cryptographic identifier which indicates the export strength cipher.
02650  */
02651 #define R_CR_INFO_ID_IS_EXPORT              2
02652 /**
02653  * A cryptographic identifier which indicates key agreement authentication.
02654  */
02655 #define R_CR_INFO_ID_KE_AUTHENTICATE        3
02656 /**
02657  * A cryptographic identifier which indicates the key agreement type.
02658  */
02659 #define R_CR_INFO_ID_KE_TYPE                4
02660 /**
02661  * A cryptographic identifier which indicates the export strength key length.
02662  */
02663 #define R_CR_INFO_ID_CIPHER_EXP_KEY_LEN     5
02664 /**
02665  * A cryptographic identifier which indicates the Initialization Vector (IV)
02666  * length.
02667  */
02668 #define R_CR_INFO_ID_CIPHER_IV_LEN          6
02669 /**
02670  * A cryptographic identifier which indicates the symmetric cipher parameter.
02671  */
02672 #define R_CR_INFO_ID_CIPHER_PARAM           7
02673 /**
02674  * A cryptographic identifier which indicates the symmetric cipher rounds.
02675  */
02676 #define R_CR_INFO_ID_CIPHER_ROUNDS          8
02677 /**
02678  * A cryptographic identifier which indicates the symmetric cipher type.
02679  */
02680 #define R_CR_INFO_ID_CIPHER_TYPE            9
02681 /**
02682  * A cryptographic identifier which indicates the symmetric cipher block size.
02683  */
02684 #define R_CR_INFO_ID_CIPHER_BLOCK_SIZE      10
02685 /**
02686  * A cryptographic identifier which indicates the digest or Message
02687  * Authentication Code (MAC) length.
02688  */
02689 #define R_CR_INFO_ID_DIGEST_MAC_LEN         11
02690 /**
02691  * A cryptographic identifier which indicates the random context.
02692  */
02693 #define R_CR_INFO_ID_CTX_RANDOM             12
02694 /**
02695  * A cryptographic identifier which indicates the digest block size.
02696  */
02697 #define R_CR_INFO_ID_DIGEST_BLOCK_SIZE      13
02698 /**
02699  * A cryptographic identifier which indicates the symmetric cipher bits.
02700  */
02701 #define R_CR_INFO_ID_CIPHER_BITS            14
02702 /**
02703  * A cryptographic identifier which indicates the PKCS #1 
02704  * Optimal Asymmetric Encryption Padding (OAEP) parameter.
02705  */
02706 #define R_CR_INFO_ID_OAEP_PARAM             15
02707 /**
02708  * A cryptographic identifier which indicates the surrender function.
02709  */
02710 #define R_CR_INFO_ID_SURRENDER              16
02711 /**
02712  * A cryptographic identifier which indicates the cryptographic type.
02713  */
02714 #define R_CR_INFO_ID_CRYPTO_TYPE            17
02715 /**
02716  * A cryptographic identifier which indicates the cryptographic identifier.
02717  */
02718 #define R_CR_INFO_ID_CRYPTO_ID              18
02719 /**
02720  * A cryptographic identifier which indicates the cryptographic operation
02721  * subtype.
02722  */
02723 #define R_CR_INFO_ID_CRYPTO_SUB             19
02724 /**
02725  * A cryptographic identifier which indicates the block padding.
02726  */
02727 #define R_CR_INFO_ID_BLOCK_PADDING          20
02728 /**
02729  * A cryptographic identifier which indicates the flags.
02730  */
02731 #define R_CR_INFO_ID_FLAGS                  21
02732 /**
02733  * A cryptographic identifier which indicates the number of bits of the asymmetric
02734  * key.
02735  */
02736 #define R_CR_INFO_ID_NUM_BITS               22  /** data type unsigned int */
02737 /**
02738  * A cryptographic identifier which indicates the number of primes (RSA
02739  * MultiPrime).
02740  */
02741 #define R_CR_INFO_ID_NUM_PRIMES             23  /** data type unsigned int */
02742 /**
02743  * A cryptographic identifier which indicates the asymmetric public key.
02744  */
02745 #define R_CR_INFO_ID_PUBLIC_KEY             24
02746 /**
02747  * A cryptographic identifier which indicates the asymmetric private key.
02748  */
02749 #define R_CR_INFO_ID_PRIVATE_KEY            25
02750 /**
02751  * A cryptographic identifier which indicates the Digital Signature
02752  * Algorithm (DSA) prime number (<tt>P</tt>).
02753  */
02754 #define R_CR_INFO_ID_DSA_P                  26
02755 /**
02756  * A cryptographic identifier which indicates the Digital Signature
02757  * Algorithm (DSA) factor of the prime number (<tt>Q</tt>).
02758  */
02759 #define R_CR_INFO_ID_DSA_Q                  27
02760 /**
02761  * A cryptographic identifier which indicates the Digital Signature
02762  * Algorithm (DSA) generator (<tt>G</tt>).
02763  */
02764 #define R_CR_INFO_ID_DSA_G                  28
02765 /**
02766  * A cryptographic identifier which indicates the Diffie-Hellman prime length.
02767  */
02768 #define R_CR_INFO_ID_DH_PRIME_LENGTH        29  /** data type unsigned int */
02769 /**
02770  * A cryptographic identifier which indicates the Diffie-Hellman generator
02771  * order.
02772  */
02773 #define R_CR_INFO_ID_DH_GENERATOR_ORDER     30
02774 /**
02775  * A cryptographic identifier which indicates the RSA public exponent 
02776  * (<tt>E</tt>).
02777  */
02778 #define R_CR_INFO_ID_RSA_E                  31  /** data type unsigned int */
02779 /**
02780  * A cryptographic identifier which indicates the Digital Signature
02781  * Algorithm (DSA) parameters.
02782  */
02783 #define R_CR_INFO_ID_DSA_PARAMETERS         32
02784 /**
02785  * A cryptographic identifier which indicates the signature.
02786  */
02787 #define R_CR_INFO_ID_SIGNATURE              33
02788 /**
02789  * A cryptographic identifier which indicates the random seed file name.
02790  */
02791 #define R_CR_INFO_ID_RAND_FILE_NAME         48
02792 /**
02793  * A cryptographic identifier which indicates the random seed write file.
02794  */
02795 #define R_CR_INFO_ID_RAND_WRITE_FILE        49
02796 /**
02797  * A cryptographic identifier which indicates to add entropy to random
02798  * generator.
02799  */
02800 #define R_CR_INFO_ID_RAND_ADD_ENTROPY       50
02801 /**
02802  * A cryptographic identifier which indicates to load seed file into random
02803  * generator.
02804  */
02805 #define R_CR_INFO_ID_RAND_LOAD_FILE         51
02806 /**
02807  * A cryptographic identifier which indicates the random entropy collection
02808  * function.
02809  */
02810 #define R_CR_INFO_ID_RAND_ENTROPY_FUNC      52
02811 
02812 /**
02813  * @}
02814  */
02815 
02816 /**
02817  * @defgroup R_CR_FLAG Cryptographic Behavior Modifying Flags
02818  * This section details the flags used in conjunction with the cryptographic
02819  * objects to effect algorithm operations. These flags are algorithm-dependent.
02820  * @ingroup CRYPTO_MODULE
02821  *
02822  * @{
02823  */
02824 /**
02825  * A cryptographic flag which indicates a symmetric cipher with no block
02826  * padding.
02827  */
02828 #define R_CR_FLAG_CIPHER_NO_BLOCK_PADDING   0x0001
02829 /**
02830  * A cryptographic flag which indicates a symmetric cipher key set.
02831  */
02832 #define R_CR_FLAG_CIPHER_KEY_SET            0x0002
02833 /**
02834  * A cryptographic flag which indicates a signature Distinguished Encoding
02835  * Rules (DER).
02836  */
02837 #define R_CR_FLAG_DER_SIGNATURE             0x0004
02838 
02839 /**
02840  * @}
02841  */
02842 
02843 /**
02844  * @defgroup CRYPTO_CTX_INFO Cryptographic Context Information Defines
02845  * The section details the defines used in the setting and/or retrieval of 
02846  * data from a cryptographic context object.
02847  * The following table details the data types to pass into <i>param</i> when
02848  * calling R_CR_CTX_get_info().
02849  * @br
02850  * <table><tr>
02851  *     <td><b>Identifier</b></td>
02852  *     <td><b>Param Data Type</b></td>
02853  * </tr><tr>
02854  *     <td>#R_CR_CTX_INFO_ID_RANDOM</td>
02855  *     <td>#R_CR **</td>
02856  * </tr><tr>
02857  *     <td>#R_CR_CTX_INFO_ID_SURRENDER</td>
02858  *     <td>#R_SURRENDER **</td>
02859  * </tr><tr>
02860  * </tr></table>
02861  * @br
02862  *
02863  * The following table details the data types to pass into <i>param</i> when
02864  * calling R_CR_CTX_set_info().
02865  * @br
02866  * <table><tr>
02867  *     <td><b>Identifier</b></td>
02868  *     <td><b>Param Data Type</b></td>
02869  * </tr><tr>
02870  *     <td>#R_CR_CTX_INFO_ID_SURRENDER</td>
02871  *     <td>#R_SURRENDER *</td>
02872  * </tr><tr>
02873  * </tr></table>
02874  * @br
02875  * @ingroup CRYPTO_MODULE
02876  * @{
02877  */
02878 /**
02879  * The random cryptographic context identifier.
02880  */
02881 #define R_CR_CTX_INFO_ID_RANDOM             0
02882 /**
02883  * A cryptographic context identifier which indicates the surrender function.
02884  */
02885 #define R_CR_CTX_INFO_ID_SURRENDER          1
02886 /**
02887  * A cryptographic context identifier which indicates hardware. This define
02888  * contains information needed to initialize the cryptographic hardware
02889  * interface. The associated parameter type is #R_EITEMS.
02890  */
02891 #define R_CR_CTX_INFO_ID_HARDWARE_INFO      2
02892 /**
02893  * @}
02894  */
02895 
02896 /* Structure types */
02897 /**
02898  * A cryptographic method type identifier.
02899  */
02900 typedef struct r_cr_method_st               R_CR_METHOD;
02901 /**
02902  * A cryptographic implementation method type identifier.
02903  */
02904 typedef struct r_cr_imp_method_st           R_CR_IMP_METHOD;
02905 /**
02906  * A cryptographic context object type identifier.
02907  */
02908 typedef struct r_cr_ctx_st                  R_CR_CTX;
02909 /**
02910  * A cryptographic object type identifier.
02911  */
02912 typedef struct r_cr_st                      R_CR;
02913 /**
02914  * A sign/verify data map object type identifier.
02915  */
02916 typedef struct r_sign_vfy_map_obj_st        R_CR_SIGN_VFY_MAP;
02917 
02918 /**
02919  * This structure is used to map a sign/verify identifier to an
02920  * asymmetric and digest identifier pair.
02921  */
02922 struct r_sign_vfy_map_obj_st
02923     {
02924     /**
02925      * A cryptographic identifier which indicates the signature corresponding
02926      * to the digest and asymmetric cipher identifiers.
02927      */
02928     int sig_id;
02929     /**
02930      * A cryptographic identifier which indicates the digest corresponding to
02931      * the signature.
02932      */
02933     int dig_id;
02934     /**
02935      * A cryptographic identifier which indicates the asymmetric cipher 
02936      * corresponding to the signature.
02937      */
02938     int pk_id;
02939     };
02940 
02941 /**
02942  * @defgroup R_CR_RES Cryptographic Resource Definitions
02943  * This section details the definitions used in the resource list and
02944  * initialization of the library. For more information, 
02945  * see @ref RES_LIST_GROUP. 
02946  * @ingroup CRYPTO_MODULE
02947  *
02948  * @{
02949  */
02950 /**
02951  * A small library interface that only supports the 
02952  * <tt>get_resource</tt>, <tt>get_module</tt> and 
02953  * <tt>get_module_data</tt> methods of the #R_LIB_CTX
02954  * interface. This is sufficient for normal use with the cryptograpic module.
02955  *
02956  * @see R_LIB_CTX_get_small_method().
02957  */
02958 #define R_CR_RES_LIBRARY_SMALL \
02959         { R_RES_MOD_ID_LIBRARY, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_DEF, \
02960           R_RES_FLAG_DEF, NULL, NULL, \
02961           (void *(*)(void *))R_LIB_CTX_get_small_method, NULL }
02962 
02963 /**
02964  * Indicates the full #R_LIB_CTX interface.
02965  * @see R_LIB_CTX_get_default_method().
02966  */
02967 #define R_CR_RES_LIBRARY \
02968         { R_RES_MOD_ID_LIBRARY, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_DEF, \
02969           R_RES_FLAG_DEF, NULL, NULL, \
02970           (void *(*)(void *))R_LIB_CTX_get_default_method, NULL }
02971 
02972 /**
02973  * The default list of algorithms available. Where there are optimized
02974  * implementations for an algorithm, the fastest is included in the default
02975  * list.
02976  *
02977  * @see R_CR_get_default_method() and R_CR_get_default_imp_method().
02978  */
02979 #define R_CR_RES_CRYPTO_DEFAULT \
02980     { R_RES_MOD_ID_CRYPTO, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_DEF, \
02981       R_RES_FLAG_DEF, NULL, NULL, \
02982       (void *(*)(void *))R_CR_get_default_method, \
02983       (void *(*)(void *))R_CR_get_default_imp_method }
02984 /**
02985  * Binds a custom algorithm list to the cryptographic
02986  * module. The custom list must be specified with the
02987  * #R_CR_DEFINE_CUSTOM_CIPHER_LIST macro.
02988  * @see R_CR_get_default_method().
02989  */
02990 #define R_CR_RES_CRYPTO_CUSTOM \
02991     { R_RES_MOD_ID_CRYPTO, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_DEF, \
02992       R_RES_FLAG_DEF, NULL, NULL, \
02993       (void *(*)(void *))R_CR_get_default_method, \
02994       (void *(*)(void *))(R_CR_HAVE_CIPHER_LIST *(*)(void *))r_crm_custom_list_retriever }
02995 
02996 /**
02997  * The default map which maps two #R_CR identifiers to a signature. For example,
02998  * #R_CR_ID_SHA1_RSA (#R_CR_ID_SHA1 and #R_CR_ID_RSA)
02999  *
03000  * @see R_CR_get_default_signature_map().
03001  */
03002 #define R_CR_RES_SIGNATURE_MAP \
03003     { R_RES_MOD_ID_CRYPTO, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_MAP,\
03004           R_RES_FLAG_DEF, NULL, NULL, NULL,\
03005       (void *(*)(void *))R_CR_get_default_signature_map }
03006 
03007 /**
03008  * The standard thread synchronization module. Only required for multi-threaded
03009  * applications to protect shared data.
03010  *
03011  * @see R_LOCK_get_default_method().
03012  */
03013 #define R_CR_RES_LOCK \
03014     { R_RES_MOD_ID_LOCK, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_DEF, \
03015       R_RES_FLAG_DEF, NULL, R_LOCK_lib_finish, \
03016       (void *(*)(void *))R_LOCK_get_default_method, NULL }
03017 
03018 /**
03019  * The standard asymmetric key print module. This is only required if
03020  * R_PKEY_print() is used.
03021  */
03022 #define R_CR_RES_PKEY_PRINT \
03023     { R_RES_MOD_ID_PKEY, R_RES_IMPL_ID_PRINT_FUNC, \
03024       R_RES_SUB_ID_DEF, R_RES_FLAG_DEF, NULL, NULL, NULL, \
03025       (void *(*)(void *))R_PKEY_get_print_func }
03026 
03027 /**
03028  * The RSA key module. This is only required if #R_PKEY functions are used.
03029  *
03030  * @see R_PKEY_pk_method().
03031  */
03032 #define R_CR_RES_PKEY_RSA \
03033     { R_RES_MOD_ID_PKEY, R_RES_IMPL_ID_DEF, R_PKEY_TYPE_RSA, \
03034       R_RES_FLAG_DEF, NULL, NULL, (void *(*)(void *))R_PKEY_pk_method, \
03035       NULL }
03036 
03037 /**
03038  * The Digital Signature Algorithm (DSA) key module. This is only required
03039  * if #R_PKEY functions are used.
03040  * @see R_PKEY_pk_method().
03041  */
03042 #define R_CR_RES_PKEY_DSA \
03043     { R_RES_MOD_ID_PKEY, R_RES_IMPL_ID_DEF, R_PKEY_TYPE_DSA, \
03044       R_RES_FLAG_DEF, NULL, NULL, (void *(*)(void *))R_PKEY_pk_method, \
03045       NULL }
03046 
03047 /**
03048  * The Diffie-Hellman key module. This is only required if #R_PKEY functions
03049  * are used.
03050  *
03051  * @see R_PKEY_pk_method().
03052  */
03053 #define R_CR_RES_PKEY_DH \
03054     { R_RES_MOD_ID_PKEY, R_RES_IMPL_ID_DEF, R_PKEY_TYPE_DH, \
03055       R_RES_FLAG_DEF, NULL, NULL, (void *(*)(void *))R_PKEY_pk_method, \
03056       NULL }
03057 
03058 /**
03059  * The standard random module. This is only required if asymmetric key or
03060  * random operations are used.
03061  *
03062  * @see R_rand_get_default().
03063  */
03064 #define R_CR_RES_RAND \
03065     { R_RES_MOD_ID_RAND, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_DEF, \
03066       R_RES_FLAG_DEF, NULL, \
03067       (int (*)(R_RES_LIST *, R_RES_ITEM *, void **))R_rand_lib_cleanup, \
03068       (void *(*)(void *))R_rand_get_default, NULL }
03069 
03070 /**
03071  * The standard time module. This module is optional.
03072  * 
03073  * @see R_TIME_get_time_mi_method().
03074  */
03075 #define R_CR_RES_TIME \
03076     { R_RES_MOD_ID_TIME, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_DEF, \
03077       R_RES_FLAG_DEF, NULL, NULL, \
03078       (void *(*)(void *))R_TIME_get_time_mi_method, NULL }
03079 
03080 /**
03081  * Textual descriptions of common error codes. This is only required if using
03082  * R_CR_get_error() string functions.
03083  *
03084  * @see R_LIB_CTX_com_err_str_table().
03085  */
03086 #define R_CR_RES_COMMON_ERROR_STRINGS \
03087     { R_RES_MOD_ID_LIBRARY, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_ERROR_STRINGS, \
03088       R_RES_FLAG_DEF, NULL, NULL, NULL, \
03089       (void *(*)(void *))R_LIB_CTX_com_err_str_table }
03090 
03091 /**
03092  * Textual descriptions of cryptographic error reason codes. This is only
03093  * required if using R_CR_get_error() string functions. 
03094  *
03095  * @see R_CR_get_reason_string_table().
03096  */
03097 #define R_CR_RES_CRYPTO_REASON_STRINGS \
03098     { R_RES_MOD_ID_CRYPTO, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_REASON_STRINGS, \
03099           R_RES_FLAG_DEF, NULL, NULL, NULL, \
03100       (void *(*)(void *))R_CR_get_reason_string_table }
03101 
03102 /**
03103  * Textual descriptions of cryptographic error function codes.
03104  * This is only required if using R_CR_get_error() string functions.
03105  *
03106  * @see R_CR_get_function_string_table().
03107  */
03108 #define R_CR_RES_CRYPTO_FUNCTION_NAMES \
03109     { R_RES_MOD_ID_CRYPTO, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_FUNCTION_STRINGS,\
03110           R_RES_FLAG_DEF, NULL, NULL, NULL,\
03111       (void *(*)(void *))R_CR_get_function_string_table }
03112 
03113 /**
03114  * Textual descriptions of cryptographic error detail codes.
03115  * This is only required if using R_CR_get_error() string functions.
03116  *
03117  * @see R_CR_get_detail_string_table().
03118  */
03119 #define R_CR_RES_CRYPTO_DETAIL_STRINGS \
03120     { R_RES_MOD_ID_CRYPTO, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_DETAIL_STRINGS, \
03121           R_RES_FLAG_DEF, NULL, NULL, NULL, \
03122       (void *(*)(void *))R_CR_get_detail_string_table }
03123 
03124 /**
03125  * The mandatory marker to indicate the end of a resource list.
03126  */
03127 #define R_CR_RES_END_OF_LIST \
03128     { R_RES_MOD_ID_RES_LIST, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_DEF, \
03129       R_RES_LIST_FLAG_STATIC, NULL, R_RES_LIST_lib_finish, NULL, NULL }
03130 
03131 
03132 extern BIO_METHOD *r_cr_digest_get_bio_method();
03133 extern BIO_METHOD *r_cr_encrypt_get_bio_method();
03134 extern BIO_METHOD *r_cr_decrypt_get_bio_method();
03135 extern BIO_METHOD *r_cr_cipher_get_bio_method();
03136 
03137 /**
03138  * The #BIO method that digests data.
03139  */
03140 #define R_CR_RES_BIO_DIGEST                                    \
03141     { R_RES_MOD_ID_BIO, BIO_TYPE_CR, R_CR_TYPE_DIGEST,         \
03142       R_RES_FLAG_DEF, NULL, NULL,                              \
03143       (void *(*)(void *))r_cr_digest_get_bio_method, NULL }
03144 
03145 /**
03146  * The #BIO method that enciphers data.
03147  */
03148 #define R_CR_RES_BIO_ENCRYPT                                   \
03149     { R_RES_MOD_ID_BIO, BIO_TYPE_CIPHER, R_CR_SUB_ENCRYPT,     \
03150       R_RES_FLAG_DEF, NULL, NULL,                              \
03151       (void *(*)(void *))r_cr_encrypt_get_bio_method, NULL }
03152 
03153 /**
03154  * The #BIO method that deciphers data.
03155  */
03156 #define R_CR_RES_BIO_DECRYPT                                   \
03157     { R_RES_MOD_ID_BIO, BIO_TYPE_CIPHER, R_CR_SUB_DECRYPT,     \
03158       R_RES_FLAG_DEF, NULL, NULL,                              \
03159       (void *(*)(void *))r_cr_decrypt_get_bio_method, NULL }
03160 
03161 /**
03162  * The #BIO method that deciphers data that is read and enciphers data that is
03163  * written.
03164  */
03165 #define R_CR_RES_BIO_CIPHER                                    \
03166     { R_RES_MOD_ID_BIO, BIO_TYPE_CIPHER,                       \
03167       R_CR_SUB_ENCRYPT | R_CR_SUB_DECRYPT, R_RES_FLAG_DEF,     \
03168       NULL, NULL,                                              \
03169       (void *(*)(void *))r_cr_cipher_get_bio_method, NULL }
03170 
03171 /**
03172  * @}
03173  */
03174 
03175 #include "cryp_macros.h"
03176 
03177 /**
03178  * @defgroup R_CR_FUNCTIONS Cryptographic Functions
03179  * This section details the functions used to construct, manipulate
03180  * and destroy cryptographic objects.
03181  * @ingroup CRYPTO_MODULE
03182  *
03183  * @{
03184  */
03185 /**
03186  * @defgroup R_CR_CTX_FN Operation Functions
03187  * This section details the functions that facilitate the management
03188  * of #R_CR_CTX reference and #R_CR objects.
03189  *
03190  * @{
03191  */
03192 #if !defined(NO_R_CR_METH_TABLE)
03193 int R_CR_CTX_new(R_LIB_CTX *lib_ctx, R_RES_FLAG flag,
03194                          R_CR_CTX **crypto_ctx);
03195 #endif /* !defined(NO_R_CR_METH_TABLE) */
03196 
03197 #if !defined(NO_R_CR_FUNC) && !defined(NO_R_CR_METH_TABLE)
03198 int R_CR_CTX_free(R_CR_CTX *ctx);
03199 
03200 int R_CR_new(R_CR_CTX *ctx, R_CR_ALG_TYPE alg_type,
03201             R_CR_ALG_ID alg_id, R_CR_ALG_SUB alg_sub, R_CR **crypto);
03202 int R_CR_dup(R_CR *crypto, R_CR **new_crypto);
03203 int R_CR_free(R_CR *crypto);
03204 /**
03205  * @}
03206  */
03207 /**
03208  * @defgroup R_CR_SYM_FN Symmetric Operation Functions
03209  * This section outlines the functions that facilitate the encryption and
03210  * decryption of data in symmetric cryptographic operations.
03211  *
03212  * @{
03213  */
03214 int R_CR_encrypt_init(R_CR *crypto, R_SKEY *key, R_ITEM *iv);
03215 int R_CR_encrypt(R_CR *crypto, unsigned char *data,
03216     unsigned int dlen, unsigned char *out, unsigned int *olen);
03217 int R_CR_encrypt_update(R_CR *crypto, unsigned char *data,
03218     unsigned int dlen, unsigned char *out, unsigned int *olen);
03219 int R_CR_encrypt_final(R_CR *crypto,unsigned char *out, unsigned int *olen);
03220 
03221 int R_CR_decrypt_init(R_CR *crypto, R_SKEY *key, R_ITEM *iv);
03222 int R_CR_decrypt(R_CR *crypto, unsigned char *data,
03223     unsigned int dlen, unsigned char *out, unsigned int *olen);
03224 int R_CR_decrypt_update(R_CR *crypto, unsigned char *data,
03225     unsigned int dlen, unsigned char *out, unsigned int *olen);
03226 int R_CR_decrypt_final(R_CR *crypto,unsigned char *out, unsigned int *olen);
03227 /**
03228  * @}
03229  */
03230 /**
03231  * @defgroup R_CR_SIGN_FN Signature Operation Functions
03232  * This section outlines the functions that facilitate the signing and
03233  * verification of data in non-repudiation operations.
03234  *
03235  * @{
03236  */
03237 int R_CR_sign_init(R_CR *crypto, R_PKEY *key);
03238 int R_CR_sign(R_CR *crypto, unsigned char *data, unsigned int dlen,
03239     unsigned char *out, unsigned int *olen);
03240 int R_CR_sign_update(R_CR *crypto, unsigned char *data, unsigned int dlen);
03241 int R_CR_sign_final(R_CR *crypto,unsigned char *out, unsigned int *olen);
03242 
03243 int R_CR_verify_init(R_CR *crypto, R_PKEY *key);
03244 int R_CR_verify(R_CR *crypto, unsigned char *data,
03245     unsigned int dlen, unsigned char *signature, unsigned int slen,
03246     int *result);
03247 int R_CR_verify_update(R_CR *crypto, unsigned char *data,
03248         unsigned int dlen);
03249 int R_CR_verify_final(R_CR *crypto, unsigned char *signature,
03250         unsigned int sig_len, int *result);
03251 /**
03252  * @}
03253  */
03254 
03255 /**
03256  * @defgroup R_CR_ASYM_FN Asymmetric Operation Functions
03257  * This section details the functions that facilitate cryptographic
03258  * operations using public and private keys.
03259  *
03260  * @{
03261  */
03262 int R_CR_asym_encrypt_init(R_CR *crypto, R_PKEY *key);
03263 int R_CR_asym_encrypt(R_CR *crypto, unsigned char *data,
03264         unsigned int dlen, unsigned char *out,
03265                 unsigned int *olen);
03266 int R_CR_asym_decrypt_init(R_CR *crypto, R_PKEY *key);
03267 int R_CR_asym_decrypt(R_CR *crypto, unsigned char *data,
03268     unsigned int dlen, unsigned char *out, unsigned int *olen);
03269 /**
03270  * @}
03271  */
03272 /**
03273  * @defgroup R_CR_DGST_FN Digest and MAC Operation Functions
03274  * This section details the functions that manage the creation of a digest.
03275  * Digests can be used in asymmetric algorithms or Message Authentication Code
03276  * (MAC) operations. MAC operations can be used in symmetric algorithms.
03277  * Digests are also used as part of the signing and verification process.
03278  *
03279  * @{
03280  */
03281 int R_CR_digest_init(R_CR *crypto);
03282 int R_CR_digest(R_CR *crypto, unsigned char *data,
03283     unsigned int dlen, unsigned char *out,
03284     unsigned int *out_len);
03285 int R_CR_digest_update(R_CR *crypto, unsigned char *data,
03286     unsigned int dlen);
03287 int R_CR_digest_final(R_CR *crypto, unsigned char *out,
03288     unsigned int *olen);
03289 
03290 int R_CR_mac_init(R_CR *crypto, R_SKEY *key);
03291 int R_CR_mac(R_CR *crypto, unsigned char *data,
03292     unsigned int dlen, unsigned char *out,
03293     unsigned int *olen);
03294 int R_CR_mac_update(R_CR *crypto, unsigned char *data,
03295     unsigned int dlen);
03296 int R_CR_mac_final(R_CR *crypto, unsigned char *out,
03297     unsigned int *olen);
03298 
03299 int R_CR_verify_mac_init(R_CR *crypto, R_SKEY *key);
03300 int R_CR_verify_mac(R_CR *crypto, unsigned char *data,
03301     unsigned int dlen, unsigned char *mac, unsigned int mac_len,
03302     int *result);
03303 int R_CR_verify_mac_update(R_CR *crypto, unsigned char *data,
03304         unsigned int dlen);
03305 int R_CR_verify_mac_final(R_CR *crypto, unsigned char *mac,
03306         unsigned int mac_len, int *result);
03307 /**
03308  * @}
03309  */
03310 /**
03311  * @defgroup R_CR_KE_FN Key Agreement Functions
03312  * This section outlines the functions that enable phased key agreement 
03313  * operations. Diffie-Hellman is an algorithm implemented using key 
03314  * agreement operations.
03315  *
03316  * @{
03317  */
03318 int R_CR_key_exchange_init(R_CR *crypto, R_PKEY *params);
03319 int R_CR_key_exchange_phase_1(R_CR *crypto, unsigned char *out,
03320     unsigned int *olen);
03321 int R_CR_key_exchange_phase_2(R_CR *crypto, unsigned char *data,
03322     unsigned int dlen, unsigned char *out, unsigned int * olen);
03323 /**
03324  * @}
03325  */
03326 /**
03327  * @defgroup R_CR_KEYGEN_FN Key Generation Functions
03328  * This section outlines the functions that facilitate key and key 
03329  * parameter generation. Parameters can also be generated for use 
03330  * in key agreement operations.
03331  *
03332  * @{
03333  */
03334 int R_CR_generate_key_init(R_CR *crypto);
03335 int R_CR_generate_key(R_CR *crypto, R_PKEY **key);
03336 
03337 int R_CR_generate_parameter_init(R_CR *crypto);
03338 int R_CR_generate_parameter(R_CR *crypto, R_PKEY **key);
03339 
03340 /**
03341  * @}
03342  */
03343 
03344 /**
03345  * @defgroup R_CR_RND_FN Random Number Generation Functions
03346  * This section outlines the functions that generate pseudo random numbers used
03347  * for padding and generating keys. The functions interact with the Pseudo
03348  * Random Number Generator (PRNG) state engine to produce a random number
03349  * stream.
03350  *
03351  * @{
03352  */
03353 int R_CR_random_seed(R_CR *crypto, unsigned char *bytes, unsigned int len);
03354 int R_CR_random_bytes(R_CR *crypto, unsigned int  dlen,
03355     unsigned char *obuf, unsigned int *olen);
03356 /**
03357  * @}
03358  */
03359 #endif /* !defined(NO_R_CR_FUNC) && !defined(NO_R_CR_METH_TABLE) */
03360 
03361 /**
03362  * @addtogroup R_CR_CTX_FN
03363  *
03364  * @{
03365  */
03366 int R_CR_get_info(R_CR *crypto, int id, void *param);
03367 int R_CR_set_info(R_CR *crypto, int id, void *param);
03368 
03369 int R_CR_CTX_get_info(R_CR_CTX *ctx, int id, void *param);
03370 int R_CR_CTX_set_info(R_CR_CTX *ctx, int id, void *param);
03371 
03372 int R_CR_CTX_alg_supported(R_CR_CTX *ctx, int alg_type, int alg_id,
03373     int alg_sub, int *is_supported);
03374 
03375 const R_CR_SIGN_VFY_MAP *R_CR_get_default_signature_map(void *imp_data);
03376 
03377 int R_CR_CTX_ids_to_sig_id(R_CR_CTX *ctx, int dig_id, int pkey_id, int *sig_id);
03378 int R_CR_CTX_ids_from_sig_id(R_CR_CTX *ctx, int sig_id, int *dig_id,
03379     int *pkey_id);
03380 /**
03381  * @}
03382  */
03383 /**
03384  * @defgroup CRYP_ERR_FUNCS Cryptographic Error Functions
03385  * This section details the functions that enable the extraction of detailed 
03386  * error information after an error has occurred in the cryptographic module.
03387  * @ingroup CRYP_ERR_GROUP
03388  *
03389  * @{
03390  */
03391 
03392 #if !defined(NO_R_CR_FUNC) && !defined(NO_R_CR_METH_TABLE)
03393 int R_CR_get_error(R_CR *crypto, int *data);
03394 int R_CR_get_reason(R_CR *crypto, int *data);
03395 int R_CR_get_detail(R_CR *crypto, int *data);
03396 int R_CR_get_function(R_CR *crypto, int *data);
03397 int R_CR_get_line(R_CR *crypto, int *data);
03398 
03399 int R_CR_get_file(R_CR *crypto, char **data);
03400 int R_CR_get_error_string(R_CR *crypto, char **data);
03401 int R_CR_get_reason_string(R_CR *crypto, char **data);
03402 int R_CR_get_detail_string(R_CR *crypto, char **data);
03403 int R_CR_get_function_string(R_CR *crypto, char **data);
03404 #endif /* !defined(NO_R_CR_FUNC) && !defined(NO_R_CR_METH_TABLE) */
03405 
03406 
03407 #if !defined(NO_R_CR_FUNC) && !defined(NO_R_CR_METH_TABLE)
03408 /* error related strings */
03409 R_STRTBL *R_CR_get_reason_string_table(void *imp_data);
03410 R_STRTBL *R_CR_get_detail_string_table(void *imp_data);
03411 R_STRTBL *R_CR_get_function_string_table(void *imp_data);
03412 #endif /* !defined(NO_R_CR_FUNC) && !defined(NO_R_CR_METH_TABLE) */
03413 
03414 BIO *BIO_new_CR_MD(R_LIB_CTX *ctx, int flag, int id);
03415 /**
03416  * @}
03417  */
03418 
03419 /**
03420  * @addtogroup R_CR_CTX_FN
03421  *
03422  * @{
03423  */
03424 int R_CR_ID_from_string(char *str, R_CR_ALG_ID *type);
03425 int R_CR_ID_to_string(R_CR_ALG_ID type, size_t max_str_len, char *str);
03426 int R_CR_TYPE_from_string(char *str, R_CR_ALG_TYPE *type);
03427 int R_CR_TYPE_to_string(R_CR_ALG_TYPE type, size_t max_str_len, char *str);
03428 int R_CR_SUB_from_string(char *str, R_CR_ALG_SUB *type);
03429 int R_CR_SUB_to_string(R_CR_ALG_SUB type, size_t max_str_len, char *str);
03430 /**
03431  * @}
03432  */
03433 /* Default method */
03434 /**
03435  * @addtogroup R_CR_CTX_FN
03436  * @{
03437  */
03438 R_CR_METHOD *R_CR_get_default_method(void *imp_data);
03439 R_CR_IMP_METHOD *R_CR_get_default_imp_method(void *imp_data);
03440 /**
03441  * @}
03442  */
03443 
03444 /**
03445  * @addtogroup R_CR_CTX_FN
03446  *
03447  * @{
03448  */
03449 /**
03450  * @fn void R_CR_RES_CRYPTO_CUSTOM_METHOD(R_CR_METHOD *(*meth_fn)(void),
03451  *           R_CR_IMP_METHOD *(*alg_fn)(void))
03452  *
03453  * Binds a custom algorithm list and method table to the cryptographic module.
03454  * The custom method list must be specified with the
03455  * #R_CR_DEFINE_CUSTOM_METHOD_TABLE macro. The custom algorithm list must be
03456  * specified with the #R_CR_DEFINE_CUSTOM_CIPHER_LIST macro.
03457  *
03458  * @param meth_fn [In] The function returning the custom method list.
03459  * @param alg_fn  [In] The function returning the custom algorithm list.
03460  *
03461  */
03462 #define R_CR_RES_CRYPTO_CUSTOM_METHOD(meth_fn, alg_fn) \
03463     { R_RES_MOD_ID_CRYPTO, R_RES_IMPL_ID_DEF, R_RES_SUB_ID_DEF, \
03464       R_RES_FLAG_DEF, NULL, NULL, \
03465       (void *(*)(void *))meth_fn, \
03466       (void *(*)(void *))alg_fn }
03467 
03468 /**
03469  * @fn R_CR_IMP_METHOD *R_CR_DEFINE_CUSTOM_CIPHER_LIST
03470  *     (R_CR_IMP_METHOD list, void fn)
03471  *
03472  * Creates a function to return the custom algorithms. The custom algorithm
03473  * list is an array of type #R_CR_IMP_METHOD.
03474  *
03475  * @param list [In] The custom algorithm list.
03476  * @param fn   [In] The name of the function to create.
03477  *
03478  * @return   A cryptographic implementation method table.
03479  *
03480  * @see #R_CR_RES_CRYPTO_CUSTOM_METHOD.
03481  */
03482 #define R_CR_DEFINE_CUSTOM_CIPHER_LIST(list, fn) \
03483     static R_CR_IMP_METHOD *fn(void)\
03484         { return((R_CR_IMP_METHOD *)list); } typedef int _dummy_int ## fn
03485 
03486 /**
03487  * @fn R_CR_METHOD *R_CR_DEFINE_CUSTOM_METHOD_TABLE
03488  *     (R_CR_METHOD list, void fn)
03489  *
03490  * Creates a function to return the custom methods. The custom methods list
03491  * is a structure of #R_CR_METHOD.
03492  *
03493  * @param list [In] The custom methods list.
03494  * @param fn   [In] The name of the function to create.
03495  *
03496  * @return   A cryptographic method table.
03497  *
03498  * @see #R_CR_RES_CRYPTO_CUSTOM_METHOD.
03499  */
03500 #define R_CR_DEFINE_CUSTOM_METHOD_TABLE(list, fn) \
03501     static R_CR_METHOD *fn(void *imp_data)\
03502     { return((R_CR_METHOD *)&list); }  typedef int _dummy_int ## fn
03503 
03504 /**
03505  * @}
03506  */
03507 /**
03508  * @}
03509  */
03510 #ifdef  __cplusplus
03511 }
03512 #endif
03513 #endif /* HEADER_COMMON_CRYP_MOD_H */
03514 

Copyright (c) 1999-2002 RSA Security Inc. All rights reserved. 061-001005-150-001-000-3768 - 1.5