| ///////////////////////////////////////////////////////////////////////////// |
| ///////////////////////////////////////////////////////////////////////////// |
| // // |
| // Crypt Lib Interface // |
| // // |
| ///////////////////////////////////////////////////////////////////////////// |
| /**************************************************************************** |
| History: |
| Date Author Changes |
| 2011/10/03 Deniz Karakoyunlu Created. |
| *****************************************************************************/ |
| |
| #ifndef _crypt_lib_H_ |
| #define _crypt_lib_H_ |
| |
| #include "tim.h" |
| #define RSA2K_BUFFER_0_SIZE 664 // bytes |
| #define RSA2K_BUFFER_1_SIZE 820 // bytes |
| #define RSA2K_BUFFER_2_SIZE 820 // bytes |
| #define RSA2K_KEY_SIZE 720 // bytes |
| #define RSA2K_BIGNUM_SIZE 600 // bytes |
| |
| #define MAX_BUFFER_0_SIZE (RSA2K_BUFFER_0_SIZE) |
| #define MAX_BUFFER_1_SIZE (RSA2K_BUFFER_1_SIZE) |
| #define MAX_BUFFER_2_SIZE (RSA2K_BUFFER_2_SIZE) |
| #define MAX_KEY_SIZE (RSA2K_KEY_SIZE) |
| #define MAX_BIGNUM_SIZE (RSA2K_BIGNUM_SIZE) |
| |
| |
| #define BUFFER_0_OFFSET 0 |
| #define BUFFER_1_OFFSET (BUFFER_0_OFFSET + MAX_BUFFER_0_SIZE) |
| #define BUFFER_2_OFFSET (BUFFER_1_OFFSET + MAX_BUFFER_1_SIZE) |
| #define KEY_OFFSET (BUFFER_2_OFFSET + MAX_BUFFER_2_SIZE) |
| #define X_OFFSET (KEY_OFFSET + MAX_KEY_SIZE) |
| #define Y_OFFSET (X_OFFSET + MAX_BIGNUM_SIZE) |
| |
| #define SBUF_NUM 6 |
| #define MBUF_NUM 4 |
| #define LBUF_NUM 6 |
| |
| #define SBUF_SIZE 16 |
| #define MBUF_SIZE 280 |
| #define LBUF_SIZE 560 |
| #define HASH_BUF_SIZE (32) |
| #define DATABUFFERSIZE (SBUF_NUM*SBUF_SIZE + MBUF_NUM*MBUF_SIZE + LBUF_NUM*LBUF_SIZE + HASH_BUF_SIZE) |
| |
| UINT_T IPPCP_SecurityInitialization(UINT_T adv_ver); |
| UINT_T IPPCP_SHAMessageDigest(const UINT8_T* pSrcMesgIn, UINT_T SrcMesgByteLen, UINT8_T* pMesgDigestOut, UINT_T DigestByteLen); |
| UINT_T IPPCP_PKCS_DSA_Verify(const UINT8_T* pSrcMesgIn, UINT_T SrcMesgByteLen, const pPLAT_DS pDSA, UINT8_T* DataBuffer); |
| UINT_T IPPCP_ECCP_DSA_Verify(const UINT8_T* pSrcMesgIn, UINT_T SrcMesgByteLen, const pPLAT_DS pDSA, UINT8_T* DataBuffer); |
| UINT_T IPPCP_Get_Nonce(UINT_T* pNonceOut, UINT_T NonceBitLen); |
| UINT_T IPPCP_Get_NonceBitLen(void); |
| UINT_T IPPCP_HMAC_KEY_GEN(UINT8_T* RPMB_DerivedKey); |
| UINT_T IPPCP_HMAC( const UINT8_T* pHMAC_Key, const UINT8_T* pSrcMesgIn, UINT_T SrcMesgByteLen, UINT8_T* pMesgDigestOut ); |
| |
| #define IPPCP_NONCE_BIT_LEN 256 |
| |
| #endif // _crypt_lib_H_ |
| |