CXI
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MechParamECIES Class Reference

Constructs a mechanism parameter for 'Elliptic Curve (Augmented) Encryption Scheme' (ECIES, see ANSI X9.63). More...

Inheritance diagram for MechParamECIES:
[legend]
Collaboration diagram for MechParamECIES:
[legend]

Public Member Functions

 MechParamECIES (int mech, int hash_algo, int crypt_algo, int crypt_mech, int crypt_len, int mac_algo, int mac_mech, int mac_len, const ByteArray &secret1, const ByteArray &secret2)
 
MechanismParameter getEncoded (void)
 
- Public Member Functions inherited from MechParam
 MechParam (int mech)
 Constructs a mechanism parameter with the given mechanism specifier. More...
 
MechanismParameter getEncoded (void)
 

Detailed Description

Constructs a mechanism parameter for 'Elliptic Curve (Augmented) Encryption Scheme' (ECIES, see ANSI X9.63).

The following example illustrates the usage of the MechParamECIES class:

// encrypt data with ECIES mode
CXI_KEY_ALGO_AES, // crypt_algo
CXI_MECH_CHAIN_CBC, // crypt_mech
256, // crypt_len
CXI_KEY_ALGO_RAW, // mac_algo
0, // mac_len
ByteArray("MySecret#1"),
ByteArray(0));
ByteArray crypt = cxi->crypt(0, ecKey, mechParam.getEncoded(), data);
Encapsulates an array of primitive type char in an object and provides methods to operate on binary d...
Definition: sw/cxi_api_c/def/bytearray.h:22
Constructs a mechanism parameter for 'Elliptic Curve (Augmented) Encryption Scheme' (ECIES,...
Definition: sw/cxi_api_c/def/mechparam.h:110
MechanismParameter getEncoded(void)
Definition: mechparam.cpp:756
#define CXI_KEY_ALGO_RAW
Raw data object.
Definition: fw/cxi/def/cxi_defs.h:178
#define CXI_KEY_ALGO_AES
AES.
Definition: fw/cxi/def/cxi_defs.h:180
#define CXI_MECH_CHAIN_CBC
Cipher Block Chaining.
Definition: fw/cxi/def/cxi_defs.h:357
#define CXI_MECH_HASH_ALGO_SHA256
SHA256.
Definition: fw/cxi/def/cxi_defs.h:454
#define CXI_MECH_KDF_XOR_BASE_AND_DATA
XOR a base key and given data to derive key.
Definition: fw/cxi/def/cxi_defs.h:314
#define CXI_MECH_MODE_ENCRYPT
Encryption mode.
Definition: fw/cxi/def/cxi_defs.h:332
Definition: cxi.cpp:173

Constructor & Destructor Documentation

◆ MechParamECIES()

MechParamECIES ( int  mech,
int  hash_algo,
int  crypt_algo,
int  crypt_mech,
int  crypt_len,
int  mac_algo,
int  mac_mech,
int  mac_len,
const ByteArray secret1,
const ByteArray secret2 
)

Constructs a mechanism parameter for 'Elliptic Curve (Augmented) Encryption Scheme' (ECIES, see ANSI X9.63).

Parameters
mechXOR combination of mechanism specifier:
hash_algohash algorithm,see Hash Algorithms
crypt_algoalgorithm:
  • CXI_KEY_ALGO_AES
  • CXI_KEY_ALGO_RAW (crypt_mech := CXI_MECH_KDF_XOR_DATA)
crypt_mechmechanism:
  • chaining mode (AES only), see Chaining Modes
  • key derivation mode (raw mode only): CXI_MECH_KDF_XOR_DATA
crypt_lenAES key size (128,192 or 256) or zero on raw mode
mac_algoalgorithm:
  • CXI_KEY_ALGO_AES
  • CXI_KEY_ALGO_RAW (mac_mech := CXI_MECH_MODE_HMAC)
mac_mechmechanism:
  • hash mode: CXI_MECH_MODE_HMAC or CXI_MECH_MODE_MAC1
  • underlying hash algorithm on HMAC, see Hash Algorithms
mac_lenAES key size (128,192 or 256) or zero on HMAC optional: mac size in byte for truncated macs when using CXI_MECH_MODE_MAC1.
secret1secret value #1
secret2secret value #2

Member Function Documentation

◆ getEncoded()

MechanismParameter getEncoded ( void  )
Returns
Returns the encoded mechanism parameter.