Microchip® Advanced Software Framework

m2m_crypto.h File Reference

WINC Crypto Application Interface.

Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.

Data Structures

struct  sha256ctxt
 

Macros

#define M2M_MAX_RSA_LEN   (256)
 
#define M2M_SHA256_DIGEST_LEN   32
 
#define M2M_SHA256_MAX_DATA   (M2M_BUFFER_MAX_SIZE - M2M_SHA256_CONTEXT_BUFF_LEN - M2M_HIF_HDR_OFFSET)
 

Typedefs

typedef void(* tpfAppCryproCb )(uint8 u8MsgType, void *pvResp, void *pvMsg)
 Crypto Callback function receiving the crypto related messages. More...
 
typedef struct sha256ctxt tstrM2mSha256Ctxt
 

Enumerations

enum  tenuRsaSignStatus {
  M2M_RSA_SIGN_OK,
  M2M_RSA_SIGN_FAIL
}
 RSA Signature status: pass or fail. More...
 

Functions

sint8 m2m_crypto_init (tpfAppCryproCb pfAppCryproCb)
 
sint8 m2m_crypto_rsa_sign_gen (uint8 *pu8N, uint16 u16NSize, uint8 *pu8d, uint16 u16dSize, uint8 *pu8SignedMsgHash, uint16 u16HashLength, uint8 *pu8RsaSignature)
 
sint8 m2m_crypto_rsa_sign_verify (uint8 *pu8N, uint16 u16NSize, uint8 *pu8E, uint16 u16ESize, uint8 *pu8SignedMsgHash, uint16 u16HashLength, uint8 *pu8RsaSignature)
 
sint8 m2m_crypto_sha256_hash_finish (tstrM2mSha256Ctxt *psha256Ctxt, uint8 *pu8Sha256Digest)
 
sint8 m2m_crypto_sha256_hash_init (tstrM2mSha256Ctxt *psha256Ctxt)
 
sint8 m2m_crypto_sha256_hash_update (tstrM2mSha256Ctxt *psha256Ctxt, uint8 *pu8Data, uint16 u16DataLength)
 

#define M2M_MAX_RSA_LEN   (256)
#define M2M_SHA256_DIGEST_LEN   32
#define M2M_SHA256_MAX_DATA   (M2M_BUFFER_MAX_SIZE - M2M_SHA256_CONTEXT_BUFF_LEN - M2M_HIF_HDR_OFFSET)

tpfAppCryproCb

Crypto Callback function receiving the crypto related messages.

Parameters
[in]u8MsgTypeCrypto command about which the notification is received.
[in]pvRespA pointer to the result associated with the notification.
[in]pvMsgA pointer to a buffer containing the notification parameters (if any). It should be Casted to the correct data type corresponding to the notification type.
See Also
m2m_crypto_init tenuM2mCryptoCmd
typedef struct sha256ctxt tstrM2mSha256Ctxt

RSA Signature status: pass or fail.

See Also
m2m_crypto_rsa_sign_gen
Enumerator
M2M_RSA_SIGN_OK 
M2M_RSA_SIGN_FAIL 

sint8 m2m_crypto_init ( tpfAppCryproCb  pfAppCryproCb)
sint8 m2m_crypto_rsa_sign_gen ( uint8 pu8N,
uint16  u16NSize,
uint8 pu8d,
uint16  u16dSize,
uint8 pu8SignedMsgHash,
uint16  u16HashLength,
uint8 pu8RsaSignature 
)
sint8 m2m_crypto_rsa_sign_verify ( uint8 pu8N,
uint16  u16NSize,
uint8 pu8E,
uint16  u16ESize,
uint8 pu8SignedMsgHash,
uint16  u16HashLength,
uint8 pu8RsaSignature 
)
sint8 m2m_crypto_sha256_hash_finish ( tstrM2mSha256Ctxt psha256Ctxt,
uint8 pu8Sha256Digest 
)
sint8 m2m_crypto_sha256_hash_init ( tstrM2mSha256Ctxt psha256Ctxt)
sint8 m2m_crypto_sha256_hash_update ( tstrM2mSha256Ctxt psha256Ctxt,
uint8 pu8Data,
uint16  u16DataLength 
)