CyaSSL 3.0.0

Dependents:   HTTPClient-SSL HTTPClient HTTPClient-SSL http_access ... more

Committer:
wolfSSL
Date:
Wed Dec 03 05:24:18 2014 +0000
Revision:
3:64d4f7cb83d5
Parent:
0:1239e9b70ca2
added IGNORE_KEY_EXTENSIONS

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 0:1239e9b70ca2 1 /* bn.h for openssl */
wolfSSL 0:1239e9b70ca2 2
wolfSSL 0:1239e9b70ca2 3
wolfSSL 0:1239e9b70ca2 4 #ifndef CYASSL_BN_H_
wolfSSL 0:1239e9b70ca2 5 #define CYASSL_BN_H_
wolfSSL 0:1239e9b70ca2 6
wolfSSL 0:1239e9b70ca2 7 #include <cyassl/ctaocrypt/settings.h>
wolfSSL 0:1239e9b70ca2 8
wolfSSL 0:1239e9b70ca2 9 #ifdef __cplusplus
wolfSSL 0:1239e9b70ca2 10 extern "C" {
wolfSSL 0:1239e9b70ca2 11 #endif
wolfSSL 0:1239e9b70ca2 12
wolfSSL 0:1239e9b70ca2 13 typedef struct CYASSL_BIGNUM {
wolfSSL 0:1239e9b70ca2 14 int neg; /* openssh deference */
wolfSSL 0:1239e9b70ca2 15 void* internal; /* our big num */
wolfSSL 0:1239e9b70ca2 16 } CYASSL_BIGNUM;
wolfSSL 0:1239e9b70ca2 17
wolfSSL 0:1239e9b70ca2 18
wolfSSL 0:1239e9b70ca2 19 typedef struct CYASSL_BN_CTX CYASSL_BN_CTX;
wolfSSL 0:1239e9b70ca2 20
wolfSSL 0:1239e9b70ca2 21
wolfSSL 0:1239e9b70ca2 22 CYASSL_API CYASSL_BN_CTX* CyaSSL_BN_CTX_new(void);
wolfSSL 0:1239e9b70ca2 23 CYASSL_API void CyaSSL_BN_CTX_init(CYASSL_BN_CTX*);
wolfSSL 0:1239e9b70ca2 24 CYASSL_API void CyaSSL_BN_CTX_free(CYASSL_BN_CTX*);
wolfSSL 0:1239e9b70ca2 25
wolfSSL 0:1239e9b70ca2 26 CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_new(void);
wolfSSL 0:1239e9b70ca2 27 CYASSL_API void CyaSSL_BN_free(CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 28 CYASSL_API void CyaSSL_BN_clear_free(CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 29
wolfSSL 0:1239e9b70ca2 30
wolfSSL 0:1239e9b70ca2 31 CYASSL_API int CyaSSL_BN_sub(CYASSL_BIGNUM*, const CYASSL_BIGNUM*,
wolfSSL 0:1239e9b70ca2 32 const CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 33 CYASSL_API int CyaSSL_BN_mod(CYASSL_BIGNUM*, const CYASSL_BIGNUM*,
wolfSSL 0:1239e9b70ca2 34 const CYASSL_BIGNUM*, const CYASSL_BN_CTX*);
wolfSSL 0:1239e9b70ca2 35
wolfSSL 0:1239e9b70ca2 36 CYASSL_API const CYASSL_BIGNUM* CyaSSL_BN_value_one(void);
wolfSSL 0:1239e9b70ca2 37
wolfSSL 0:1239e9b70ca2 38
wolfSSL 0:1239e9b70ca2 39 CYASSL_API int CyaSSL_BN_num_bytes(const CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 40 CYASSL_API int CyaSSL_BN_num_bits(const CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 41
wolfSSL 0:1239e9b70ca2 42 CYASSL_API int CyaSSL_BN_is_zero(const CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 43 CYASSL_API int CyaSSL_BN_is_one(const CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 44 CYASSL_API int CyaSSL_BN_is_odd(const CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 45
wolfSSL 0:1239e9b70ca2 46 CYASSL_API int CyaSSL_BN_cmp(const CYASSL_BIGNUM*, const CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 47
wolfSSL 0:1239e9b70ca2 48 CYASSL_API int CyaSSL_BN_bn2bin(const CYASSL_BIGNUM*, unsigned char*);
wolfSSL 0:1239e9b70ca2 49 CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_bin2bn(const unsigned char*, int len,
wolfSSL 0:1239e9b70ca2 50 CYASSL_BIGNUM* ret);
wolfSSL 0:1239e9b70ca2 51
wolfSSL 0:1239e9b70ca2 52 CYASSL_API int CyaSSL_mask_bits(CYASSL_BIGNUM*, int n);
wolfSSL 0:1239e9b70ca2 53
wolfSSL 0:1239e9b70ca2 54 CYASSL_API int CyaSSL_BN_rand(CYASSL_BIGNUM*, int bits, int top, int bottom);
wolfSSL 0:1239e9b70ca2 55 CYASSL_API int CyaSSL_BN_is_bit_set(const CYASSL_BIGNUM*, int n);
wolfSSL 0:1239e9b70ca2 56 CYASSL_API int CyaSSL_BN_hex2bn(CYASSL_BIGNUM**, const char* str);
wolfSSL 0:1239e9b70ca2 57
wolfSSL 0:1239e9b70ca2 58 CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_dup(const CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 59 CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_copy(CYASSL_BIGNUM*, const CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 60
wolfSSL 0:1239e9b70ca2 61 CYASSL_API int CyaSSL_BN_set_word(CYASSL_BIGNUM*, unsigned long w);
wolfSSL 0:1239e9b70ca2 62
wolfSSL 0:1239e9b70ca2 63 CYASSL_API int CyaSSL_BN_dec2bn(CYASSL_BIGNUM**, const char* str);
wolfSSL 0:1239e9b70ca2 64 CYASSL_API char* CyaSSL_BN_bn2dec(const CYASSL_BIGNUM*);
wolfSSL 0:1239e9b70ca2 65
wolfSSL 0:1239e9b70ca2 66
wolfSSL 0:1239e9b70ca2 67 typedef CYASSL_BIGNUM BIGNUM;
wolfSSL 0:1239e9b70ca2 68 typedef CYASSL_BN_CTX BN_CTX;
wolfSSL 0:1239e9b70ca2 69
wolfSSL 0:1239e9b70ca2 70 #define BN_CTX_new CyaSSL_BN_CTX_new
wolfSSL 0:1239e9b70ca2 71 #define BN_CTX_init CyaSSL_BN_CTX_init
wolfSSL 0:1239e9b70ca2 72 #define BN_CTX_free CyaSSL_BN_CTX_free
wolfSSL 0:1239e9b70ca2 73
wolfSSL 0:1239e9b70ca2 74 #define BN_new CyaSSL_BN_new
wolfSSL 0:1239e9b70ca2 75 #define BN_free CyaSSL_BN_free
wolfSSL 0:1239e9b70ca2 76 #define BN_clear_free CyaSSL_BN_clear_free
wolfSSL 0:1239e9b70ca2 77
wolfSSL 0:1239e9b70ca2 78 #define BN_num_bytes CyaSSL_BN_num_bytes
wolfSSL 0:1239e9b70ca2 79 #define BN_num_bits CyaSSL_BN_num_bits
wolfSSL 0:1239e9b70ca2 80
wolfSSL 0:1239e9b70ca2 81 #define BN_is_zero CyaSSL_BN_is_zero
wolfSSL 0:1239e9b70ca2 82 #define BN_is_one CyaSSL_BN_is_one
wolfSSL 0:1239e9b70ca2 83 #define BN_is_odd CyaSSL_BN_is_odd
wolfSSL 0:1239e9b70ca2 84
wolfSSL 0:1239e9b70ca2 85 #define BN_cmp CyaSSL_BN_cmp
wolfSSL 0:1239e9b70ca2 86
wolfSSL 0:1239e9b70ca2 87 #define BN_bn2bin CyaSSL_BN_bn2bin
wolfSSL 0:1239e9b70ca2 88 #define BN_bin2bn CyaSSL_BN_bin2bn
wolfSSL 0:1239e9b70ca2 89
wolfSSL 0:1239e9b70ca2 90 #define BN_mod CyaSSL_BN_mod
wolfSSL 0:1239e9b70ca2 91 #define BN_sub CyaSSL_BN_sub
wolfSSL 0:1239e9b70ca2 92 #define BN_value_one CyaSSL_BN_value_one
wolfSSL 0:1239e9b70ca2 93
wolfSSL 0:1239e9b70ca2 94 #define BN_mask_bits CyaSSL_mask_bits
wolfSSL 0:1239e9b70ca2 95
wolfSSL 0:1239e9b70ca2 96 #define BN_rand CyaSSL_BN_rand
wolfSSL 0:1239e9b70ca2 97 #define BN_is_bit_set CyaSSL_BN_is_bit_set
wolfSSL 0:1239e9b70ca2 98 #define BN_hex2bn CyaSSL_BN_hex2bn
wolfSSL 0:1239e9b70ca2 99
wolfSSL 0:1239e9b70ca2 100 #define BN_dup CyaSSL_BN_dup
wolfSSL 0:1239e9b70ca2 101 #define BN_copy CyaSSL_BN_copy
wolfSSL 0:1239e9b70ca2 102
wolfSSL 0:1239e9b70ca2 103 #define BN_set_word CyaSSL_BN_set_word
wolfSSL 0:1239e9b70ca2 104
wolfSSL 0:1239e9b70ca2 105 #define BN_dec2bn CyaSSL_BN_dec2bn
wolfSSL 0:1239e9b70ca2 106 #define BN_bn2dec CyaSSL_BN_bn2dec
wolfSSL 0:1239e9b70ca2 107
wolfSSL 0:1239e9b70ca2 108
wolfSSL 0:1239e9b70ca2 109 #ifdef __cplusplus
wolfSSL 0:1239e9b70ca2 110 } /* extern "C" */
wolfSSL 0:1239e9b70ca2 111 #endif
wolfSSL 0:1239e9b70ca2 112
wolfSSL 0:1239e9b70ca2 113
wolfSSL 0:1239e9b70ca2 114 #endif /* CYASSL__H_ */
wolfSSL 0:1239e9b70ca2 115
wolfSSL 0:1239e9b70ca2 116