FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
pico_vpp_crypto.c File Reference
+ Include dependency graph for pico_vpp_crypto.c:

Go to the source code of this file.

Data Structures

struct  cipher_context_t
 
struct  vpp_aead_context_t
 

Typedefs

typedef void(* ptls_vpp_do_transform_fn) (ptls_cipher_context_t *, void *, const void *, size_t)
 

Functions

static void ptls_vpp_crypto_cipher_do_init (ptls_cipher_context_t *_ctx, const void *iv)
 
static void ptls_vpp_crypto_cipher_dispose (ptls_cipher_context_t *_ctx)
 
static void ptls_vpp_crypto_cipher_encrypt (ptls_cipher_context_t *_ctx, void *output, const void *input, size_t _len)
 
static int ptls_vpp_crypto_cipher_setup_crypto (ptls_cipher_context_t *_ctx, int is_enc, const void *key, const EVP_CIPHER *cipher, ptls_vpp_do_transform_fn do_transform)
 
size_t ptls_vpp_crypto_aead_decrypt (ptls_aead_context_t *_ctx, void *_output, const void *input, size_t inlen, uint64_t seq, const void *aad, size_t aadlen)
 
static void ptls_vpp_crypto_aead_encrypt_init (ptls_aead_context_t *_ctx, uint64_t seq, const void *aad, size_t aadlen)
 
static size_t ptls_vpp_crypto_aead_encrypt_update (ptls_aead_context_t *_ctx, void *output, const void *input, size_t inlen)
 
static size_t ptls_vpp_crypto_aead_encrypt_final (ptls_aead_context_t *_ctx, void *_output)
 
static void ptls_vpp_crypto_aead_dispose_crypto (ptls_aead_context_t *_ctx)
 
static int ptls_vpp_crypto_aead_setup_crypto (ptls_aead_context_t *_ctx, int is_enc, const void *key, const void *iv, vnet_crypto_alg_t alg)
 
static int ptls_vpp_crypto_aes128ctr_setup_crypto (ptls_cipher_context_t *ctx, int is_enc, const void *key)
 
static int ptls_vpp_crypto_aes256ctr_setup_crypto (ptls_cipher_context_t *ctx, int is_enc, const void *key)
 
static int ptls_vpp_crypto_aead_aes128gcm_setup_crypto (ptls_aead_context_t *ctx, int is_enc, const void *key, const void *iv)
 
static int ptls_vpp_crypto_aead_aes256gcm_setup_crypto (ptls_aead_context_t *ctx, int is_enc, const void *key, const void *iv)
 

Variables

vnet_crypto_main_tcm = &crypto_main
 
picotls_main_t picotls_main
 
ptls_cipher_algorithm_t ptls_vpp_crypto_aes128ctr
 
ptls_cipher_algorithm_t ptls_vpp_crypto_aes256ctr
 
ptls_aead_algorithm_t ptls_vpp_crypto_aes128gcm
 
ptls_aead_algorithm_t ptls_vpp_crypto_aes256gcm
 
ptls_cipher_suite_t ptls_vpp_crypto_aes128gcmsha256
 
ptls_cipher_suite_t ptls_vpp_crypto_aes256gcmsha384
 
ptls_cipher_suite_t * ptls_vpp_crypto_cipher_suites []
 

Typedef Documentation

◆ ptls_vpp_do_transform_fn

typedef void(* ptls_vpp_do_transform_fn) (ptls_cipher_context_t *, void *, const void *, size_t)

Definition at line 24 of file pico_vpp_crypto.c.

Function Documentation

◆ ptls_vpp_crypto_aead_aes128gcm_setup_crypto()

static int ptls_vpp_crypto_aead_aes128gcm_setup_crypto ( ptls_aead_context_t *  ctx,
int  is_enc,
const void *  key,
const void *  iv 
)
static

Definition at line 269 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:

◆ ptls_vpp_crypto_aead_aes256gcm_setup_crypto()

static int ptls_vpp_crypto_aead_aes256gcm_setup_crypto ( ptls_aead_context_t *  ctx,
int  is_enc,
const void *  key,
const void *  iv 
)
static

Definition at line 278 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:

◆ ptls_vpp_crypto_aead_decrypt()

size_t ptls_vpp_crypto_aead_decrypt ( ptls_aead_context_t *  _ctx,
void *  _output,
const void *  input,
size_t  inlen,
uint64_t  seq,
const void *  aad,
size_t  aadlen 
)

Definition at line 124 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ptls_vpp_crypto_aead_dispose_crypto()

static void ptls_vpp_crypto_aead_dispose_crypto ( ptls_aead_context_t *  _ctx)
static

Definition at line 198 of file pico_vpp_crypto.c.

+ Here is the caller graph for this function:

◆ ptls_vpp_crypto_aead_encrypt_final()

static size_t ptls_vpp_crypto_aead_encrypt_final ( ptls_aead_context_t *  _ctx,
void *  _output 
)
static

Definition at line 183 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ptls_vpp_crypto_aead_encrypt_init()

static void ptls_vpp_crypto_aead_encrypt_init ( ptls_aead_context_t *  _ctx,
uint64_t  seq,
const void *  aad,
size_t  aadlen 
)
static

Definition at line 151 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ptls_vpp_crypto_aead_encrypt_update()

static size_t ptls_vpp_crypto_aead_encrypt_update ( ptls_aead_context_t *  _ctx,
void *  output,
const void *  input,
size_t  inlen 
)
static

Definition at line 169 of file pico_vpp_crypto.c.

+ Here is the caller graph for this function:

◆ ptls_vpp_crypto_aead_setup_crypto()

static int ptls_vpp_crypto_aead_setup_crypto ( ptls_aead_context_t *  _ctx,
int  is_enc,
const void *  key,
const void *  iv,
vnet_crypto_alg_t  alg 
)
static

Definition at line 204 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ptls_vpp_crypto_aes128ctr_setup_crypto()

static int ptls_vpp_crypto_aes128ctr_setup_crypto ( ptls_cipher_context_t *  ctx,
int  is_enc,
const void *  key 
)
static

Definition at line 253 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:

◆ ptls_vpp_crypto_aes256ctr_setup_crypto()

static int ptls_vpp_crypto_aes256ctr_setup_crypto ( ptls_cipher_context_t *  ctx,
int  is_enc,
const void *  key 
)
static

Definition at line 261 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:

◆ ptls_vpp_crypto_cipher_dispose()

static void ptls_vpp_crypto_cipher_dispose ( ptls_cipher_context_t *  _ctx)
static

Definition at line 63 of file pico_vpp_crypto.c.

+ Here is the caller graph for this function:

◆ ptls_vpp_crypto_cipher_do_init()

static void ptls_vpp_crypto_cipher_do_init ( ptls_cipher_context_t *  _ctx,
const void *  iv 
)
static

Definition at line 53 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ptls_vpp_crypto_cipher_encrypt()

static void ptls_vpp_crypto_cipher_encrypt ( ptls_cipher_context_t *  _ctx,
void *  output,
const void *  input,
size_t  _len 
)
static

Definition at line 69 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ptls_vpp_crypto_cipher_setup_crypto()

static int ptls_vpp_crypto_cipher_setup_crypto ( ptls_cipher_context_t *  _ctx,
int  is_enc,
const void *  key,
const EVP_CIPHER *  cipher,
ptls_vpp_do_transform_fn  do_transform 
)
static

Definition at line 83 of file pico_vpp_crypto.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ cm

Definition at line 27 of file pico_vpp_crypto.c.

◆ picotls_main

picotls_main_t picotls_main

Definition at line 7 of file tls_picotls.c.

◆ ptls_vpp_crypto_aes128ctr

ptls_cipher_algorithm_t ptls_vpp_crypto_aes128ctr
Initial value:
= {
"AES128-CTR",
PTLS_AES128_KEY_SIZE,
1,
PTLS_AES_IV_SIZE,
sizeof (struct vpp_aead_context_t),
}

Definition at line 286 of file pico_vpp_crypto.c.

◆ ptls_vpp_crypto_aes128gcm

ptls_aead_algorithm_t ptls_vpp_crypto_aes128gcm
Initial value:
= {
"AES128-GCM",
PTLS_AESGCM_CONFIDENTIALITY_LIMIT,
PTLS_AESGCM_INTEGRITY_LIMIT,
NULL,
PTLS_AES128_KEY_SIZE,
PTLS_AESGCM_IV_SIZE,
PTLS_AESGCM_TAG_SIZE,
sizeof (struct vpp_aead_context_t),
}

Definition at line 304 of file pico_vpp_crypto.c.

◆ ptls_vpp_crypto_aes128gcmsha256

ptls_cipher_suite_t ptls_vpp_crypto_aes128gcmsha256
Initial value:
=
{ PTLS_CIPHER_SUITE_AES_128_GCM_SHA256,
&ptls_openssl_sha256
}

Definition at line 330 of file pico_vpp_crypto.c.

◆ ptls_vpp_crypto_aes256ctr

ptls_cipher_algorithm_t ptls_vpp_crypto_aes256ctr
Initial value:
= {
"AES256-CTR",
PTLS_AES256_KEY_SIZE,
1 ,
PTLS_AES_IV_SIZE,
sizeof (struct vpp_aead_context_t),
}

Definition at line 295 of file pico_vpp_crypto.c.

◆ ptls_vpp_crypto_aes256gcm

ptls_aead_algorithm_t ptls_vpp_crypto_aes256gcm
Initial value:
= {
"AES256-GCM",
PTLS_AESGCM_CONFIDENTIALITY_LIMIT,
PTLS_AESGCM_INTEGRITY_LIMIT,
NULL,
PTLS_AES256_KEY_SIZE,
PTLS_AESGCM_IV_SIZE,
PTLS_AESGCM_TAG_SIZE,
sizeof (struct vpp_aead_context_t),
}

Definition at line 317 of file pico_vpp_crypto.c.

◆ ptls_vpp_crypto_aes256gcmsha384

ptls_cipher_suite_t ptls_vpp_crypto_aes256gcmsha384
Initial value:
=
{ PTLS_CIPHER_SUITE_AES_256_GCM_SHA384,
&ptls_openssl_sha384
}

Definition at line 336 of file pico_vpp_crypto.c.

◆ ptls_vpp_crypto_cipher_suites

ptls_cipher_suite_t* ptls_vpp_crypto_cipher_suites[]
Initial value:

Definition at line 342 of file pico_vpp_crypto.c.

ptls_vpp_crypto_aead_aes256gcm_setup_crypto
static int ptls_vpp_crypto_aead_aes256gcm_setup_crypto(ptls_aead_context_t *ctx, int is_enc, const void *key, const void *iv)
Definition: pico_vpp_crypto.c:278
ptls_vpp_crypto_aes256gcm
ptls_aead_algorithm_t ptls_vpp_crypto_aes256gcm
Definition: pico_vpp_crypto.c:317
ptls_vpp_crypto_aes128gcm
ptls_aead_algorithm_t ptls_vpp_crypto_aes128gcm
Definition: pico_vpp_crypto.c:304
ptls_vpp_crypto_aes128gcmsha256
ptls_cipher_suite_t ptls_vpp_crypto_aes128gcmsha256
Definition: pico_vpp_crypto.c:330
vpp_aead_context_t
Definition: pico_vpp_crypto.c:38
ptls_vpp_crypto_aes128ctr_setup_crypto
static int ptls_vpp_crypto_aes128ctr_setup_crypto(ptls_cipher_context_t *ctx, int is_enc, const void *key)
Definition: pico_vpp_crypto.c:253
ptls_vpp_crypto_aead_aes128gcm_setup_crypto
static int ptls_vpp_crypto_aead_aes128gcm_setup_crypto(ptls_aead_context_t *ctx, int is_enc, const void *key, const void *iv)
Definition: pico_vpp_crypto.c:269
ptls_vpp_crypto_aes256ctr
ptls_cipher_algorithm_t ptls_vpp_crypto_aes256ctr
Definition: pico_vpp_crypto.c:295
ptls_vpp_crypto_aes256gcmsha384
ptls_cipher_suite_t ptls_vpp_crypto_aes256gcmsha384
Definition: pico_vpp_crypto.c:336
ptls_vpp_crypto_aes256ctr_setup_crypto
static int ptls_vpp_crypto_aes256ctr_setup_crypto(ptls_cipher_context_t *ctx, int is_enc, const void *key)
Definition: pico_vpp_crypto.c:261
ptls_vpp_crypto_aes128ctr
ptls_cipher_algorithm_t ptls_vpp_crypto_aes128ctr
Definition: pico_vpp_crypto.c:286