Vadim Bendebury | 5679752 | 2015-05-20 10:32:25 -0700 | [diff] [blame] | 1 | // This file was extracted from the TCG Published |
| 2 | // Trusted Platform Module Library |
| 3 | // Part 4: Supporting Routines |
| 4 | // Family "2.0" |
| 5 | // Level 00 Revision 01.16 |
| 6 | // October 30, 2014 |
| 7 | |
| 8 | #ifndef _OSSL_CRYPTO_ENGINE_H |
| 9 | #define _OSSL_CRYPTO_ENGINE_H |
| 10 | #include <openssl/aes.h> |
| 11 | #include <openssl/evp.h> |
| 12 | #include <openssl/sha.h> |
| 13 | #include <openssl/ec.h> |
| 14 | #include <openssl/rand.h> |
| 15 | #include <openssl/bn.h> |
Vadim Bendebury | fea3a14 | 2015-05-28 18:53:22 -0700 | [diff] [blame] | 16 | //#include <openSSL/ec_lcl.h> |
Vadim Bendebury | 5679752 | 2015-05-20 10:32:25 -0700 | [diff] [blame] | 17 | #define CRYPTO_ENGINE |
| 18 | #include "CryptoEngine.h" |
| 19 | #include "CpriMisc_fp.h" |
| 20 | #define MAX_ECC_PARAMETER_BYTES 32 |
| 21 | #define MAX_2B_BYTES MAX((MAX_RSA_KEY_BYTES * ALG_RSA), \ |
| 22 | MAX((MAX_ECC_PARAMETER_BYTES * ALG_ECC), \ |
| 23 | MAX_DIGEST_SIZE)) |
| 24 | #define assert2Bsize(a) pAssert((a).size <= sizeof((a).buffer)) |
| 25 | #ifdef TPM_ALG_RSA |
| 26 | # ifdef RSA_KEY_SIEVE |
| 27 | # include "RsaKeySieve.h" |
| 28 | # include "RsaKeySieve_fp.h" |
| 29 | # endif |
| 30 | # include "CpriRSA_fp.h" |
| 31 | #endif |
| 32 | // |
| 33 | // This is a structure to hold the parameters for the version of KDFa() used by the CryptoEngine(). This |
| 34 | // structure allows the state to be passed between multiple functions that use the same pseudo-random |
| 35 | // sequence. |
| 36 | // |
| 37 | typedef struct { |
| 38 | CPRI_HASH_STATE iPadCtx; |
| 39 | CPRI_HASH_STATE oPadCtx; |
| 40 | TPM2B *extra; |
| 41 | UINT32 *outer; |
| 42 | TPM_ALG_ID hashAlg; |
| 43 | UINT16 keySizeInBits; |
| 44 | } KDFa_CONTEXT; |
| 45 | #endif // _OSSL_CRYPTO_ENGINE_H |