Classes | Macros | Typedefs | Enumerations | Functions
m2m_crypto.h File Reference

WINC3400 Crypto API. More...

#include "common/include/nm_common.h"
#include "driver/include/m2m_types.h"
Include dependency graph for m2m_crypto.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sha256ctxt
 

Macros

#define M2M_SHA256_CONTEXT_BUFF_LEN   128
 
#define M2M_SHA256_DIGEST_LEN   32
 

Typedefs

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_rsa_sign_gen (uint8 *pu8N, uint16 u16NSize, uint8 *pu8d, uint16 u16dSize, uint8 *pu8SignedMsgHash, uint16 u16HashLength, uint8 *pu8RsaSignature)
 RSA Signature Generation. More...
 
sint8 m2m_rsa_sign_verify (uint8 *pu8N, uint16 u16NSize, uint8 *pu8E, uint16 u16ESize, uint8 *pu8SignedMsgHash, uint16 u16HashLength, uint8 *pu8RsaSignature)
 RSA Signature Verification. More...
 
sint8 m2m_sha256_hash_finish (tstrM2mSha256Ctxt *psha256Ctxt, uint8 *pu8Sha256Digest)
 SHA256 hash finalization. More...
 
sint8 m2m_sha256_hash_init (tstrM2mSha256Ctxt *psha256Ctxt)
 SHA256 hash initialization. More...
 
sint8 m2m_sha256_hash_update (tstrM2mSha256Ctxt *psha256Ctxt, uint8 *pu8Data, uint16 u16DataLength)
 SHA256 hash update. More...
 

Detailed Description

WINC3400 Crypto API.

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

Definition in file m2m_crypto.h.

Macro Definition Documentation

◆ M2M_SHA256_CONTEXT_BUFF_LEN

#define M2M_SHA256_CONTEXT_BUFF_LEN   128

Definition at line 50 of file m2m_crypto.h.

◆ M2M_SHA256_DIGEST_LEN

#define M2M_SHA256_DIGEST_LEN   32

Definition at line 51 of file m2m_crypto.h.

Typedef Documentation

◆ tstrM2mSha256Ctxt

typedef struct sha256ctxt tstrM2mSha256Ctxt

Enumeration Type Documentation

◆ tenuRsaSignStatus

RSA Signature status: pass or fail.

Enumerator
M2M_RSA_SIGN_OK 
M2M_RSA_SIGN_FAIL 

Definition at line 75 of file m2m_crypto.h.

Function Documentation

◆ m2m_rsa_sign_gen()

sint8 m2m_rsa_sign_gen ( uint8 pu8N,
uint16  u16NSize,
uint8 pu8d,
uint16  u16dSize,
uint8 pu8SignedMsgHash,
uint16  u16HashLength,
uint8 pu8RsaSignature 
)

RSA Signature Generation.

The function shall request the RSA Signature generation from the WINC Firmware for the given message. The signed message shall be compressed to the corresponding hash algorithm before calling this function. The hash type is identified by the given hash length. For example, if the hash length is 32 bytes, then it is SHA256.

Parameters
[in]pu8NRSA Key modulus n.
[in]u16NSizeSize of the RSA modulus n in bytes.
[in]pu8dRSA private exponent.
[in]u16dSizeSize of the RSA private exponent in bytes.
[in]pu8SignedMsgHashThe hash digest of the signed message.
[in]u16HashLengthThe length of the hash digest.
[out]pu8RsaSignaturePointer to a user buffer allocated by teh caller shall hold the generated signature.

◆ m2m_rsa_sign_verify()

sint8 m2m_rsa_sign_verify ( uint8 pu8N,
uint16  u16NSize,
uint8 pu8E,
uint16  u16ESize,
uint8 pu8SignedMsgHash,
uint16  u16HashLength,
uint8 pu8RsaSignature 
)

RSA Signature Verification.

The function shall request the RSA Signature verification from the WINC Firmware for the given message. The signed message shall be compressed to the corresponding hash algorithm before calling this function. The hash type is identified by the given hash length. For example, if the hash length is 32 bytes, then it is SHA256.

Parameters
[in]pu8NRSA Key modulus n.
[in]u16NSizeSize of the RSA modulus n in bytes.
[in]pu8ERSA public exponent.
[in]u16ESizeSize of the RSA public exponent in bytes.
[in]pu8SignedMsgHashThe hash digest of the signed message.
[in]u16HashLengthThe length of the hash digest.
[out]pu8RsaSignatureSignature value to be verified.

◆ m2m_sha256_hash_finish()

sint8 m2m_sha256_hash_finish ( tstrM2mSha256Ctxt psha256Ctxt,
uint8 pu8Sha256Digest 
)

SHA256 hash finalization.

Parameters
[in]psha256CtxtPointer to a sha256 context allocated by the caller.
[in]pu8Sha256DigestBuffer allocated by the caller which will hold the resultant SHA256 Digest. It must be allocated no less than M2M_SHA256_DIGEST_LEN.

◆ m2m_sha256_hash_init()

sint8 m2m_sha256_hash_init ( tstrM2mSha256Ctxt psha256Ctxt)

SHA256 hash initialization.

Parameters
[in]psha256CtxtPointer to a sha256 context allocated by the caller.

◆ m2m_sha256_hash_update()

sint8 m2m_sha256_hash_update ( tstrM2mSha256Ctxt psha256Ctxt,
uint8 pu8Data,
uint16  u16DataLength 
)

SHA256 hash update.

Parameters
[in]psha256CtxtPointer to the sha256 context.
[in]pu8DataBuffer holding the data submitted to the hash.
[in]u16DataLengthSize of the data bufefr in bytes.


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:06