Library crypto-components
[ZRTP API REFERENCE ( for the library developers )]

Collaboration diagram for Library crypto-components:

Data Structures

struct  zrtp_comp
 Global structure for all crypto-component types. More...
struct  zrtp_hash
 Structure for defining the hash-value computing scheme The ZRTP context field zrtp_stream_ctx::_hash is initialized by the given type value and used for all hash calculations within the ZRTP sessions. Having implemented a structure of this type, it is possible to integrate new hash calculation schemes into libzrtp. More...
struct  zrtp_auth_tag_length
 Structure for defining the SRTP authentication scheme The ZRTP context field zrtp_stream_ctx::_authtaglength is initialized by the given type value and used for SRTP encryption configuration. More...
struct  zrtp_pk_scheme
 Structure for describing the public key scheme The ZRTP context field zrtp_stream_ctx::_pubkeyscheme is initialized by the given type value and used by libzrtp in public key exchange. More...
struct  zrtp_sas_scheme
 Structure for defining SAS generation scheme The type of the ZRTP context's field zrtp_stream_ctx::_sasscheme. It is used to generate short authentication strings. LibZRTP functionality can be augmented with a new SAS scheme by supplying your own instance of zrtp_sas_scheme. More...
struct  zrtp_sig_scheme
 Structure for describing the signature scheme The ZRTP context field zrtp_stream_ctx::_sigscheme is initialized by the given type value and used by libzrtp in public key exchange. More...
struct  zrtp_cipher_mode
struct  zrtp_cipher

Defines

#define ZRTP_COMP_UNKN   0

Typedefs

typedef enum zrtp_crypto_comp zrtp_crypto_comp_t
 Enumeration for crypto-components types definition.
typedef enum zrtp_hash_id zrtp_hash_id_t
typedef enum zrtp_cipher_id zrtp_cipher_id_t
typedef enum zrtp_atl_id zrtp_atl_id_t
typedef enum zrtp_pktype_id zrtp_pktype_id_t
typedef enum zrtp_sigtype_id zrtp_sigtype_id_t
typedef enum zrtp_sas_id zrtp_sas_id_t
typedef zrtp_comp zrtp_comp_t
 Global structure for all crypto-component types.
typedef enum zrtp_cipher_mode_values zrtp_cipher_mode_values_t
typedef zrtp_cipher_mode zrtp_cipher_mode_t

Enumerations

enum  zrtp_crypto_comp {
  ZRTP_CC_HASH = 1, ZRTP_CC_SAS = 2, ZRTP_CC_CIPHER = 3, ZRTP_CC_PKT = 4,
  ZRTP_CC_ATL = 5, ZRTP_CC_SIG = 6
}
 Enumeration for crypto-components types definition. More...
enum  zrtp_hash_id { ZRTP_HASH_SHA256 = 1, ZRTP_HASH_SHA128 = 2 }
enum  zrtp_cipher_id { ZRTP_CIPHER_AES128 = 1, ZRTP_CIPHER_AES256 = 2 }
enum  zrtp_atl_id { ZRTP_ATL_HS32 = 1, ZRTP_ATL_HS80 = 2 }
enum  zrtp_pktype_id { ZRTP_PKTYPE_PRESH = 1, ZRTP_PKTYPE_MULT = 2, ZRTP_PKTYPE_DH3072 = 3 }
enum  zrtp_sigtype_id { ZRTP_SIGTYPE_EC256P = 1, ZRTP_SIGTYPE_EC384P = 2, ZRTP_SIGTYPE_EC521P = 3 }
enum  zrtp_sas_id { ZRTP_SAS_BASE32 = 1, ZRTP_SAS_BASE256 = 2 }
enum  zrtp_cipher_mode_values { ZRTP_CIPHER_MODE_CTR = 1, ZRTP_CIPHER_MODE_CFB = 2 }

Functions

zrtp_status_t zrtp_clear_comp (zrtp_crypto_comp_t type, zrtp_global_ctx_t *zrtp_global)
 Clear components buffer This function clears the buffer of the components which are defined by the type parameter. It is used before registering a component.
zrtp_status_t zrtp_done_comp (zrtp_crypto_comp_t type, zrtp_global_ctx_t *zrtp_global)
 Destroy components buffer This function clears the list of components of the specified type, destroys all components and releases all allocated resources. It is used on libzrtp down. zrtp_done_comp calls zrtp_comp_t::free() if it isn't NULL.
zrtp_status_t zrtp_register_comp (zrtp_crypto_comp_t type, void *comp, zrtp_global_ctx_t *zrtp_global)
 Registering a new crypto-component Correctness of values in the necessary structure is the developer's responsibility. zrtp_register_comp calls zrtp_comp_t::init() if it isn't NULL.
void * zrtp_find_comp (zrtp_crypto_comp_t type, uint8_t id, zrtp_global_ctx_t *zrtp_global)
 Search component by ID.
char * zrtp_comp_id2type (zrtp_crypto_comp_t type, uint8_t id)
uint8_t zrtp_comp_type2id (zrtp_crypto_comp_t type, char *name)


Detailed Description

This section describes functions and data types for managing crypto-components. All these functions and structures are used by the libZRTP kernel for the built-in crypt-components management. The developer has the option of implementing and integrating her own components into the library. This is not a full manual on creating crypto-components. Its purpose is only to elucidate the library functionality.

The concept behind crypto components is similar to that of classes in object oriented programming. The components are defined as structures and manipulated by functions. Component attributes are stored in 'contexts', and are defined during initialization. Resources allocated at initialization are freed with the 'free' function.

Components are divided into 5 functional groups (component types):


Define Documentation

#define ZRTP_COMP_UNKN   0

This ID with code 0 is used as an error signal by all crypto-components groups to indicate a wrongly defined component identifier.

Definition at line 91 of file zrtp_crypto.h.


Typedef Documentation

typedef enum zrtp_atl_id zrtp_atl_id_t

Defines SRTP authentication schemes

typedef enum zrtp_cipher_id zrtp_cipher_id_t

Defines types of ciphers

typedef struct zrtp_cipher_mode zrtp_cipher_mode_t

typedef enum zrtp_cipher_mode_values zrtp_cipher_mode_values_t

Defines block cipher modes.

typedef struct zrtp_comp zrtp_comp_t

Global structure for all crypto-component types.

Warning:
All developed components must have these 4 fields at the beginning.

typedef enum zrtp_crypto_comp zrtp_crypto_comp_t

Enumeration for crypto-components types definition.

typedef enum zrtp_hash_id zrtp_hash_id_t

Defines types of hash functions

typedef enum zrtp_pktype_id zrtp_pktype_id_t

Defines public key exchange schemes

typedef enum zrtp_sas_id zrtp_sas_id_t

Defines modes of short authentication scheme calculation

typedef enum zrtp_sigtype_id zrtp_sigtype_id_t

Defines signature schemes


Enumeration Type Documentation

enum zrtp_atl_id

Defines SRTP authentication schemes

Enumerator:
ZRTP_ATL_HS32 
ZRTP_ATL_HS80 

Definition at line 108 of file zrtp_crypto.h.

enum zrtp_cipher_id

Defines types of ciphers

Enumerator:
ZRTP_CIPHER_AES128 
ZRTP_CIPHER_AES256 

Definition at line 101 of file zrtp_crypto.h.

enum zrtp_cipher_mode_values

Defines block cipher modes.

Enumerator:
ZRTP_CIPHER_MODE_CTR 
ZRTP_CIPHER_MODE_CFB 

Definition at line 522 of file zrtp_crypto.h.

enum zrtp_crypto_comp

Enumeration for crypto-components types definition.

Enumerator:
ZRTP_CC_HASH  hash calculation schemes
ZRTP_CC_SAS  short autentification scheme components
ZRTP_CC_CIPHER  ciphers
ZRTP_CC_PKT  public key exchange scheme
ZRTP_CC_ATL 
ZRTP_CC_SIG  digital signature scheme

Definition at line 75 of file zrtp_crypto.h.

enum zrtp_hash_id

Defines types of hash functions

Enumerator:
ZRTP_HASH_SHA256 
ZRTP_HASH_SHA128 

Definition at line 94 of file zrtp_crypto.h.

enum zrtp_pktype_id

Defines public key exchange schemes

Enumerator:
ZRTP_PKTYPE_PRESH 
ZRTP_PKTYPE_MULT 
ZRTP_PKTYPE_DH3072 

Definition at line 115 of file zrtp_crypto.h.

enum zrtp_sas_id

Defines modes of short authentication scheme calculation

Enumerator:
ZRTP_SAS_BASE32 
ZRTP_SAS_BASE256 

Definition at line 141 of file zrtp_crypto.h.

enum zrtp_sigtype_id

Defines signature schemes

Enumerator:
ZRTP_SIGTYPE_EC256P 
ZRTP_SIGTYPE_EC384P 
ZRTP_SIGTYPE_EC521P 

Definition at line 132 of file zrtp_crypto.h.


Function Documentation

zrtp_status_t zrtp_clear_comp ( zrtp_crypto_comp_t  type,
zrtp_global_ctx_t *  zrtp_global 
)

Clear components buffer This function clears the buffer of the components which are defined by the type parameter. It is used before registering a component.

Parameters:
zrtp_global - the ZRTP global context where components are stored;
type - specifies the component pool type for clearing.
Returns:
  • zrtp_status_ok - if clearing was successful;
  • zrtp_status_fail - if error.

char* zrtp_comp_id2type ( zrtp_crypto_comp_t  type,
uint8_t  id 
)

Converts a component's integer ID to a symbolic ZRTP name

uint8_t zrtp_comp_type2id ( zrtp_crypto_comp_t  type,
char *  name 
)

Converts a component's ZRTP symbolic name to an integer ID

zrtp_status_t zrtp_done_comp ( zrtp_crypto_comp_t  type,
zrtp_global_ctx_t *  zrtp_global 
)

Destroy components buffer This function clears the list of components of the specified type, destroys all components and releases all allocated resources. It is used on libzrtp down. zrtp_done_comp calls zrtp_comp_t::free() if it isn't NULL.

Parameters:
zrtp_global - the ZRTP global context where components are stored;
type - specifies the component pool type for destroying.
Returns:
  • zrtp_status_ok - if clearing successful;
  • zrtp_status_fail - if error.

void* zrtp_find_comp ( zrtp_crypto_comp_t  type,
uint8_t  id,
zrtp_global_ctx_t *  zrtp_global 
)

Search component by ID.

Parameters:
type - type of sought component;
zrtp_global - the ZRTP global context where components are stored;
id - integer identifier of the necessary element.
Returns:
  • the found structure if successful;
  • NULL if the element with the specified ID can't be found or other error.

zrtp_status_t zrtp_register_comp ( zrtp_crypto_comp_t  type,
void *  comp,
zrtp_global_ctx_t *  zrtp_global 
)

Registering a new crypto-component Correctness of values in the necessary structure is the developer's responsibility. zrtp_register_comp calls zrtp_comp_t::init() if it isn't NULL.

Parameters:
type - type of registred component;
comp - registered crypto-component;
zrtp_global - the ZRTP global context where components are stored.
Returns:
  • zrtp_status_ok if registration successful;
  • zrtp_status_fail if error (conflicts with other components).


This file is part of the documentation for Zfone.
Copyright ©  2006-2008 Philip R. Zimmermann. All rights reserved.
Generated on Mon November 10 2008 by doxygen 1.5.7-20060202. Written by Viktor Krikun, © 2006-2008