A library for setting up Secure Socket Layer (SSL) connections and verifying remote hosts using certificates. Contains only the source files for mbed platform implementation of the library.

Dependents:   HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL

Committer:
Mike Fiore
Date:
Mon Mar 23 16:51:07 2015 -0500
Revision:
6:cf58d49e1a86
Parent:
0:b86d15c6ba29
fix whitespace in sha512.c

Who changed what in which revision?

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