31 #if ! defined(POLARSSL_DEPRECATED_REMOVED)
33 #if defined(POLARSSL_DEPRECATED_WARNING)
34 #warning "Including openssl.h is deprecated"
37 #ifndef POLARSSL_OPENSSL_H
38 #define POLARSSL_OPENSSL_H
46 #define AES_BLOCK_SIZE 16
47 #define AES_KEY aes_context
48 #define MD5_CTX md5_context
49 #define SHA_CTX sha1_context
51 #define SHA1_Init( CTX ) \
53 #define SHA1_Update( CTX, BUF, LEN ) \
54 sha1_update( (CTX), (unsigned char *)(BUF), (LEN) )
55 #define SHA1_Final( OUT, CTX ) \
56 sha1_finish( (CTX), (OUT) )
58 #define MD5_Init( CTX ) \
60 #define MD5_Update( CTX, BUF, LEN ) \
61 md5_update( (CTX), (unsigned char *)(BUF), (LEN) )
62 #define MD5_Final( OUT, CTX ) \
63 md5_finish( (CTX), (OUT) )
65 #define AES_set_encrypt_key( KEY, KEYSIZE, CTX ) \
66 aes_setkey_enc( (CTX), (KEY), (KEYSIZE) )
67 #define AES_set_decrypt_key( KEY, KEYSIZE, CTX ) \
68 aes_setkey_dec( (CTX), (KEY), (KEYSIZE) )
69 #define AES_cbc_encrypt( INPUT, OUTPUT, LEN, CTX, IV, MODE ) \
70 aes_crypt_cbc( (CTX), (MODE), (LEN), (IV), (INPUT), (OUTPUT) )
81 memcpy( output, input, size );
88 unsigned char *buffer = *(
unsigned char **) bufptr;
99 if( ignore != 0 || ( len != 94 && len != 162 ) )
129 #define RSA rsa_context
130 #define RSA_PKCS1_PADDING 1
131 #define RSA_size( CTX ) (CTX)->len
132 #define RSA_free( CTX ) rsa_free( CTX )
133 #define ERR_get_error( ) "ERR_get_error() not supported"
134 #define RSA_blinding_off( IGNORE )
136 #define d2i_RSAPrivateKey( a, b, c ) new rsa_context
rsa_context * d2i_RSA_PUBKEY(void *ignore, unsigned char **bufptr, int len)
int RSA_public_encrypt(int size, unsigned char *input, unsigned char *output, RSA *key, int ignore)
int rsa_pkcs1_decrypt(rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, size_t *olen, const unsigned char *input, unsigned char *output, size_t output_max_len)
Generic wrapper to perform a PKCS#1 decryption using the mode from the context.
int RSA_public_decrypt(int size, unsigned char *input, unsigned char *output, RSA *key, int ignore)
int __RSA_Passthrough(void *output, void *input, int size)
int rsa_pkcs1_encrypt(rsa_context *ctx, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng, int mode, size_t ilen, const unsigned char *input, unsigned char *output)
Generic wrapper to perform a PKCS#1 encryption using the mode from the context.
int RSA_private_decrypt(int size, unsigned char *input, unsigned char *output, RSA *key, int ignore)
size_t mpi_msb(const mpi *X)
Return the number of bits up to and including the most significant '1' bit'.
int mpi_read_binary(mpi *X, const unsigned char *buf, size_t buflen)
Import X from unsigned binary data, big endian.
The RSA public-key cryptosystem.
SHA-1 cryptographic hash function.
int RSA_private_encrypt(int size, unsigned char *input, unsigned char *output, RSA *key, int ignore)
MD5 message digest algorithm (hash function)