Mistake on this page?
Report an issue in GitHub or email us
Modules | Data Structures | Macros | Enumerations | Functions
CryptoCell Key Derivation APIs

Modules

 CryptoCell Key Derivation specific errors
 

Data Structures

struct  CRYS_KDF_OtherInfo_t
 

Macros

#define CRYS_KDF_MAX_SIZE_OF_SHARED_SECRET_VALUE   1024
 
#define CRYS_KDF_COUNT_OF_OTHER_INFO_ENTRIES   5
 
#define CRYS_KDF_MAX_SIZE_OF_OTHER_INFO_ENTRY   64
 
#define CRYS_KDF_MAX_SIZE_OF_KEYING_DATA   2048
 
#define CRYS_KDF_ASN1_KeyDerivFunc(ZZSecret_ptr, ZZSecretSize, OtherInfo_ptr, KDFhashMode, KeyingData_ptr, KeyLenInBytes)   CRYS_KDF_KeyDerivFunc((ZZSecret_ptr),(ZZSecretSize),(OtherInfo_ptr),(KDFhashMode),CRYS_KDF_ASN1_DerivMode,(KeyingData_ptr),(KeyLenInBytes))
 
#define CRYS_KDF_ConcatKeyDerivFunc(ZZSecret_ptr, ZZSecretSize, OtherInfo_ptr, KDFhashMode, KeyingData_ptr, KeyLenInBytes)   CRYS_KDF_KeyDerivFunc((ZZSecret_ptr),(ZZSecretSize),(OtherInfo_ptr),(KDFhashMode),CRYS_KDF_ConcatDerivMode,(KeyingData_ptr),(KeyLenInBytes))
 

Enumerations

Functions

CRYSError_t CRYS_KDF_KeyDerivFunc (uint8_t *ZZSecret_ptr, uint32_t ZZSecretSize, CRYS_KDF_OtherInfo_t *OtherInfo_ptr, CRYS_KDF_HASH_OpMode_t KDFhashMode, CRYS_KDF_DerivFuncMode_t derivation_mode, uint8_t *KeyingData_ptr, uint32_t KeyingDataSizeBytes)
 CRYS_KDF_KeyDerivFunc performs key derivation according to one of the modes defined in standards: ANS X9.42-2001, ANS X9.63, ISO/IEC 18033-2. More...
 

Detailed Description

Macro Definition Documentation

#define CRYS_KDF_ASN1_KeyDerivFunc (   ZZSecret_ptr,
  ZZSecretSize,
  OtherInfo_ptr,
  KDFhashMode,
  KeyingData_ptr,
  KeyLenInBytes 
)    CRYS_KDF_KeyDerivFunc((ZZSecret_ptr),(ZZSecretSize),(OtherInfo_ptr),(KDFhashMode),CRYS_KDF_ASN1_DerivMode,(KeyingData_ptr),(KeyLenInBytes))

CRYS_KDF_ASN1_KeyDerivFunc is A MACRO that performs key derivation according to ASN1 DER encoding method defined in standard ANS X9.42-2001, 7.2.1. For a description of the parameters see CRYS_KDF_KeyDerivFunc.

Definition at line 191 of file crys_kdf.h.

#define CRYS_KDF_ConcatKeyDerivFunc (   ZZSecret_ptr,
  ZZSecretSize,
  OtherInfo_ptr,
  KDFhashMode,
  KeyingData_ptr,
  KeyLenInBytes 
)    CRYS_KDF_KeyDerivFunc((ZZSecret_ptr),(ZZSecretSize),(OtherInfo_ptr),(KDFhashMode),CRYS_KDF_ConcatDerivMode,(KeyingData_ptr),(KeyLenInBytes))

CRYS_KDF_ConcatKeyDerivFunc is a MACRO that performs key derivation according to concatenation mode defined in standard ANS X9.42-2001, 7.2.2. For a description of the parameters see CRYS_KDF_KeyDerivFunc.

Definition at line 201 of file crys_kdf.h.

#define CRYS_KDF_COUNT_OF_OTHER_INFO_ENTRIES   5

Number of other info entries.

Definition at line 65 of file crys_kdf.h.

#define CRYS_KDF_MAX_SIZE_OF_KEYING_DATA   2048

Maximal size of keying data in bytes.

Definition at line 69 of file crys_kdf.h.

#define CRYS_KDF_MAX_SIZE_OF_OTHER_INFO_ENTRY   64

Maximal size of other info entry. Size is in bytes

Definition at line 67 of file crys_kdf.h.

#define CRYS_KDF_MAX_SIZE_OF_SHARED_SECRET_VALUE   1024

Shared secret value max size in bytes

Definition at line 61 of file crys_kdf.h.

Enumeration Type Documentation

Key derivation modes.

Enumerator
CRYS_KDF_ASN1_DerivMode 

ASN1 key derivation mode.

CRYS_KDF_ConcatDerivMode 

Concatination key derivation mode.

CRYS_KDF_X963_DerivMode 

X963 key derivation mode.

CRYS_KDF_ISO18033_KDF1_DerivMode 

ISO 18033 KDF1 key derivation mode.

CRYS_KDF_ISO18033_KDF2_DerivMode 

ISO 18033 KDF2 key derivation mode.

CRYS_KDF_DerivFunc_NumOfModes 

Maximal number of key derivation modes.

CRYS_KDF_DerivFuncModeLast 

Reserved.

Definition at line 93 of file crys_kdf.h.

HASH operation modes

Enumerator
CRYS_KDF_HASH_SHA1_mode 

SHA1 mode.

CRYS_KDF_HASH_SHA224_mode 

SHA224 mode.

CRYS_KDF_HASH_SHA256_mode 

SHA256 mode.

CRYS_KDF_HASH_SHA384_mode 

SHA384 mode.

CRYS_KDF_HASH_SHA512_mode 

SHA512 mode.

CRYS_KDF_HASH_NumOfModes 

Maximal number of HASH modes.

CRYS_KDF_HASH_OpModeLast 

Reserved.

Definition at line 73 of file crys_kdf.h.

Function Documentation

CRYSError_t CRYS_KDF_KeyDerivFunc ( uint8_t *  ZZSecret_ptr,
uint32_t  ZZSecretSize,
CRYS_KDF_OtherInfo_t OtherInfo_ptr,
CRYS_KDF_HASH_OpMode_t  KDFhashMode,
CRYS_KDF_DerivFuncMode_t  derivation_mode,
uint8_t *  KeyingData_ptr,
uint32_t  KeyingDataSizeBytes 
)

CRYS_KDF_KeyDerivFunc performs key derivation according to one of the modes defined in standards: ANS X9.42-2001, ANS X9.63, ISO/IEC 18033-2.

The present implementation of the function allows the following operation modes:

  • CRYS_KDF_ASN1_DerivMode - mode based on ASN.1 DER encoding;
  • CRYS_KDF_ConcatDerivMode - mode based on concatenation;
  • CRYS_KDF_X963_DerivMode = CRYS_KDF_ConcatDerivMode;
  • CRYS_KDF_ISO18033_KDF1_DerivMode - specific mode according to ECIES-KEM algorithm (ISO/IEC 18033-2).

The purpose of this function is to derive a keying data from the shared secret value and some other optional shared information (SharedInfo).

Note
  • The length in Bytes of the hash result buffer is denoted by "hashlen".
  • All buffers arguments are represented in Big-Endian format.

Returns
CRYS_OK on success.
A non-zero value on failure as defined crys_kdf_error.h or crys_hash_error.h.
Parameters
[in]ZZSecret_ptrA pointer to shared secret value octet string.
[in]ZZSecretSizeThe size of the shared secret value in bytes. The maximal size is defined as: CRYS_KDF_MAX_SIZE_OF_SHARED_SECRET_VALUE.
[in]OtherInfo_ptrThe pointer to structure, containing the data, shared by two entities of agreement and the data sizes. This argument may be optional in several modes (if it is not needed - set NULL). On two ISO/IEC 18033-2 modes - set NULL. On KDF ASN1 mode the OtherInfo and its AlgorithmID entry are mandatory.
[in]KDFhashModeThe KDF identifier of hash function to be used. The hash function output must be at least 160 bits.
[in]derivation_modeSpecifies one of above described derivation modes.
[out]KeyingData_ptrA pointer to the buffer for derived keying data.
[in]KeyingDataSizeBytesThe size in bytes of the keying data to be derived. The maximal size is defined as: CRYS_KDF_MAX_SIZE_OF_KEYING_DATA.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.