www.beck-ipc.com

@CHIP-RTOS - Data Structures used in TCP/IP Cryptographic API


    IPC@CHIP® Documentation Index

Data Structures

Here are the structures and other data types used by the Cryptographic API.

All constants and data structures are defined in the TCPIP_Crypt.H header file which is included by the upper level TCPIP.H header file.

Notes:

  1. Byte alignment is required within all data structures used within the API.
  2. The phrase "network byte order" means big endian (like Motorola machines, unlike Intel).
Related : Contents : Contents :

  • Crypt_3DesKeyScheduleS
  • Crypt_AES_Context
  • Crypt_BigNumS
  • Crypt_BigNumConstS
  • Crypt_BlowfishKeyS
  • Crypt_DesKeyScheduleS
  • Crypt_GenericKey
  • Crypt_MD5_Context
  • Crypt_SHA1_Context
  • Crypt_SHA256_Context
  • Crypt_SHA384_Context
  • Crypt_SHA512_Context
  • Crypt_RSA_Hash_Type


  • Crypt_3DesKeyScheduleS


                
    typedef struct Crypt_3DesKeyScheduleT
    {
        Crypt_DesKeyScheduleS  pass[3] ;
    } Crypt_3DesKeyScheduleS ;

    Comments

    This structure holds a 3DES cipher subkey schedule.   The user should view this structure's content as opaque.

    The contents are initialized by the Crypt_3DES_MakeKey() API and then used by either the Crypt_3DES_Encrypt() or Crypt_3DES_Decrypt() API.

    Related Topics

    Crypt_DesKeyScheduleS data structure

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV1.35V1.35

    Top of list
    Index page

    Crypt_AES_Context


                
    typedef struct tag_crypt_aes_context
    {
        unsigned long far rd_key[60];  // For internal use by only
        int rounds;                    // For internal use by only
    } Crypt_AES_Context;
    typedef Crypt_AES_Context far * Crypt_AES_ContextPtr;

    Comments

    This container is used internally by the AES encryption/decryption API.

    The content of this structure need not be accessed by the user.

    Related Topics

    API function Crypt_AES_Encrypt()
    API function Crypt_AES_Decrypt()

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV1.11V1.00

    Top of list
    Index page

    Crypt_BigNumS


                
    typedef struct Crypt_BigNumT
    {
        unsigned short bnDigitCnt ;
        unsigned short bnSign ;
        unsigned int far *bnDataPtr ;
    } Crypt_BigNumS ;

    Comments

    This object is used to pass big numbers into and out from the various big number handling API.   A description of its members follows.

    bnDigitCnt
      Number of "digits" at bnDataPtr, where digit refers to one unsigned integer (16 bit) of data.   For most cases, this value must not exceed 256 since the maximum single precision big number size is 512 bytes (this covers encryption key sizes up to 2048 bit).   For certain cases, twice this size is permitted.   An example is the output value from the Crypt_BN_Mul().

    bnSign
      Big number sign: non-zero designates a negative big number and zero designates a non-negative big number.

    bnDataPtr
      Pointer to an array of big number "digits".   These are ordered least significant first, followed by more significant digits.   The byte order within the "digits" is host byte order (which for @CHIP-RTOS-x86 is little endian).   In all cases, the caller manages this memory.   These buffers are not provided by the API.

    Related Topics

    API function Crypt_BN_Div()
    API function Crypt_BN_Mod_Exp()
    API function Crypt_BN_Mod_Inverse()
    API function Crypt_BN_Mod_Mul()
    API function Crypt_BN_Mul()

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV1.35V1.35

    Top of list
    Index page

    Crypt_BigNumConstS


                
    typedef struct Crypt_ConstBigNumT
    {
        unsigned short bnDigitCnt ;
        unsigned short bnSign ;
        const unsigned int far *bnDataPtr ;
    } Crypt_BigNumConstS ;

    Comments

    This object is used to pass constant big numbers into the various big number handling API.   These values are not changed by the respective API.

    The member usage is identical to the Crypt_BigNumS() data structure.   The only difference is that the system will treat the big number data referenced by bnDataPtr in this type structure as read-only.

    Related Topics

    API function Crypt_BN_Div()
    API function Crypt_BN_Mod_Exp()
    API function Crypt_BN_Mod_Inverse()
    API function Crypt_BN_Mod_Mul()
    API function Crypt_BN_Mul()

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV1.35V1.35

    Top of list
    Index page

    Crypt_BlowfishKeyS


                
    typedef struct Crypt_BlowfishKeyT
    {
        unsigned long p[18];
        unsigned long s[4*256];
    
    } Crypt_BlowfishKeyS ;

    Comments

    This large object contains the cipher subkey arrays used with the Blowfish cipher method.   The user should view this structure's content as opaque.

    The contents are initialized by the Crypt_Blowfish_MakeKey() API and then used by either the Crypt_Blowfish_Encrypt() or Crypt_Blowfish_Decrypt() API.

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV1.35V1.35

    Top of list
    Index page

    Crypt_DesKeyScheduleS


                
    typedef struct Crypt_DesKeyScheduleT
    {
        unsigned long  subkey[32] ;
    } Crypt_DesKeyScheduleS ;

    Comments

    This structure holds a DES cipher subkey schedule.   The user should view this structure's content as opaque.

    The contents are initialized by the Crypt_DES_MakeKey() API and then used by either the Crypt_DES_Encrypt() or Crypt_DES_Decrypt() API.

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV1.35V1.35

    Top of list
    Index page

    Crypt_GenericKey


                
    typedef struct tag_crypt_GenericKey
    {
        const unsigned char far *  keyDataPtr; // Key material
        int                  keyRounds;  // not used for AES
        unsigned int         keyBits;    // Number of bits in key
    } Crypt_GenericKey;
    typedef Crypt_GenericKey far * Crypt_GenericKeyPtr;

    Comments

    The user must set the keyDataPtr member to reference keyBits of key material data which will be used to generate the AES key. Note that the required number of bytes is keyBits /8.

    For AES, legal values for keyBits are 128, 192 or 256.

    Both keyDataPtr and keyBits must be set by user prior to calling the key generation API.

    Related Topics

    API function Crypt_AES_MakeEncryptKey()
    API function Crypt_AES_MakeDecryptKey()

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV1.11V1.00

    Top of list
    Index page

    Crypt_MD5_Context


                
    typedef struct tag_crypt_md5_context
    {
      unsigned long i[2];       // Internal use only
      unsigned long buf[4];     // Internal use only
      unsigned char in[64];     // Internal use only
      unsigned char digest[16]; // Hash result from Crypt_MD5_Final()
    } Crypt_MD5_Context;
    typedef Crypt_MD5_Context far * Crypt_MD5_ContextPtr;

    Related Topics

    Crypt_MD5_Init() API - Init MD5 checksum generator
    Crypt_MD5_Update() API - Update MD5 hash
    Crypt_MD5_Final() API - Get MD5 result

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      V1.20V1.20V1.20V1.05V1.00

    Top of list
    Index page

    Crypt_SHA1_Context


                
    typedef struct tag_crypt_sha1_context
    {
      unsigned long shaDigest[5]; // Internal use only
      unsigned long shaCountLo;   // Internal use only
      unsigned long shaCountHi;   // Internal use only
      unsigned long shaData[16];  // Internal use only
      unsigned char digest[20];   // Hash result from Crypt_SHA1_Final()
    } Crypt_SHA1_Context;
    typedef Crypt_SHA1_Context far * Crypt_SHA1_ContextPtr;

    Related Topics

    Crypt_SHA1_Init() API - Init SHA1 checksum generator
    Crypt_SHA1_Update() API - Update SHA1 hash
    Crypt_SHA1_Final() API - Get SHA1 result

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV1.11V1.00

    Top of list
    Index page

    Crypt_SHA256_Context


                
    typedef struct tag_crypt_sha256_context
    {
        unsigned long internalUse[ 37 ];
        unsigned char digest[32];       // Crypt_SHA256_Final() result
    } Crypt_SHA256_Context;
    typedef Crypt_SHA256_Context far * Crypt_SHA256_ContextPtr;

    Related Topics

    Crypt_SHA256_Init() API - Init SHA256 checksum generator
    Crypt_SHA256_Update() API - Update SHA256 hash
    Crypt_SHA256_Final() API - Get SHA256 result

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV1.80V1.80

    Top of list
    Index page

    Crypt_SHA384_Context


                
    typedef struct tag_crypt_sha384_context
    {
        unsigned char internalUse[712];
        unsigned char digest[48];       // Crypt_SHA384_Final() result
    } Crypt_SHA384_Context;
    typedef Crypt_SHA384_Context far * Crypt_SHA384_ContextPtr;

    Related Topics

    Crypt_SHA384_Init() API - Init SHA384 checksum generator
    Crypt_SHA384_Update() API - Update SHA384 hash
    Crypt_SHA384_Final() API - Get SHA384 result

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV2.02V2.02

    Top of list
    Index page

    Crypt_SHA512_Context


                
    typedef struct tag_crypt_sha512_context
    {
        unsigned char internalUse[712];
        unsigned char digest[64];       // Crypt_SHA512_Final() result
    } Crypt_SHA512_Context;
    typedef Crypt_SHA512_Context far * Crypt_SHA512_ContextPtr;

    Related Topics

    Crypt_SHA512_Init() API - Init SHA512 checksum generator
    Crypt_SHA512_Update() API - Update SHA512 hash
    Crypt_SHA512_Final() API - Get SHA512 result

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV2.02V2.02

    Top of list
    Index page

    Crypt_RSA_Hash_Type


                
    typedef enum
    {
      Crypt_RSA_SHA1,
      Crypt_RSA_SHA256,
      Crypt_RSA_SHA384,
      Crypt_RSA_SHA512
    } Crypt_RSA_Hash_Type;

    Comments

    Enumerator for specifying which hash algorithm should be used during RSA computation.

    Related Topics

    Crypt_RSA_Sign() API - Sign a hash.
    Crypt_RSA_Verify() API - Verify a hash.

    Supported since or modified in @CHIP-RTOS version

      SC12SC13SC11SC1x3SC2x
      n/an/an/aV2.02V2.02

    Top of list
    Index page


    End of document