FD.io VPP  v19.08.1-401-g8e4ed521a
Vector Packet Processing
quic_crypto.c File Reference
+ Include dependency graph for quic_crypto.c:

Go to the source code of this file.

Data Structures

struct  cipher_context_t
 
struct  aead_crypto_context_t
 

Typedefs

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

Functions

static void quic_crypto_cipher_do_init (ptls_cipher_context_t *_ctx, const void *iv)
 
static void quic_crypto_cipher_dispose (ptls_cipher_context_t *_ctx)
 
static void quic_crypto_cipher_encrypt (ptls_cipher_context_t *_ctx, void *output, const void *input, size_t _len)
 
static int quic_crypto_cipher_setup_crypto (ptls_cipher_context_t *_ctx, int is_enc, const void *key, const EVP_CIPHER *cipher, quicly_do_transform_fn do_transform)
 
static int aes128ctr_setup_crypto (ptls_cipher_context_t *ctx, int is_enc, const void *key)
 
static int aes256ctr_setup_crypto (ptls_cipher_context_t *ctx, int is_enc, const void *key)
 
size_t quic_crypto_aead_encrypt (ptls_aead_context_t *_ctx, void *output, const void *input, size_t inlen, uint64_t seq, const void *iv, const void *aad, size_t aadlen)
 
size_t quic_crypto_aead_decrypt (ptls_aead_context_t *_ctx, void *_output, const void *input, size_t inlen, const void *iv, const void *aad, size_t aadlen)
 
static void quic_crypto_aead_dispose_crypto (ptls_aead_context_t *_ctx)
 
static int quic_crypto_aead_setup_crypto (ptls_aead_context_t *_ctx, int is_enc, const void *key, const EVP_CIPHER *cipher)
 
static int quic_crypto_aead_aes128gcm_setup_crypto (ptls_aead_context_t *ctx, int is_enc, const void *key)
 
static int quic_crypto_aead_aes256gcm_setup_crypto (ptls_aead_context_t *ctx, int is_enc, const void *key)
 

Variables

vnet_crypto_main_tcm = &crypto_main
 
ptls_cipher_algorithm_t quic_crypto_aes128ctr
 
ptls_cipher_algorithm_t quic_crypto_aes256ctr
 
ptls_aead_algorithm_t quic_crypto_aes128gcm
 
ptls_aead_algorithm_t quic_crypto_aes256gcm
 
ptls_cipher_suite_t quic_crypto_aes128gcmsha256
 
ptls_cipher_suite_t quic_crypto_aes256gcmsha384
 
ptls_cipher_suite_t * quic_crypto_cipher_suites []
 

Typedef Documentation

◆ quicly_do_transform_fn

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

Definition at line 24 of file quic_crypto.c.

Function Documentation

◆ aes128ctr_setup_crypto()

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

Definition at line 124 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ aes256ctr_setup_crypto()

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

Definition at line 132 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ quic_crypto_aead_aes128gcm_setup_crypto()

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

Definition at line 259 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ quic_crypto_aead_aes256gcm_setup_crypto()

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

Definition at line 266 of file quic_crypto.c.

+ Here is the call graph for this function:

◆ quic_crypto_aead_decrypt()

size_t quic_crypto_aead_decrypt ( ptls_aead_context_t *  _ctx,
void *  _output,
const void *  input,
size_t  inlen,
const void *  iv,
const void *  aad,
size_t  aadlen 
)

Definition at line 180 of file quic_crypto.c.

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

◆ quic_crypto_aead_dispose_crypto()

static void quic_crypto_aead_dispose_crypto ( ptls_aead_context_t *  _ctx)
static

Definition at line 220 of file quic_crypto.c.

+ Here is the caller graph for this function:

◆ quic_crypto_aead_encrypt()

size_t quic_crypto_aead_encrypt ( ptls_aead_context_t *  _ctx,
void *  output,
const void *  input,
size_t  inlen,
uint64_t  seq,
const void *  iv,
const void *  aad,
size_t  aadlen 
)

Definition at line 140 of file quic_crypto.c.

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

◆ quic_crypto_aead_setup_crypto()

static int quic_crypto_aead_setup_crypto ( ptls_aead_context_t *  _ctx,
int  is_enc,
const void *  key,
const EVP_CIPHER *  cipher 
)
static

Definition at line 226 of file quic_crypto.c.

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

◆ quic_crypto_cipher_dispose()

static void quic_crypto_cipher_dispose ( ptls_cipher_context_t *  _ctx)
static

Definition at line 70 of file quic_crypto.c.

+ Here is the caller graph for this function:

◆ quic_crypto_cipher_do_init()

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

Definition at line 44 of file quic_crypto.c.

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

◆ quic_crypto_cipher_encrypt()

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

Definition at line 76 of file quic_crypto.c.

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

◆ quic_crypto_cipher_setup_crypto()

static int quic_crypto_cipher_setup_crypto ( ptls_cipher_context_t *  _ctx,
int  is_enc,
const void *  key,
const EVP_CIPHER *  cipher,
quicly_do_transform_fn  do_transform 
)
static

Definition at line 90 of file quic_crypto.c.

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

Variable Documentation

◆ cm

Definition at line 41 of file quic_crypto.c.

◆ quic_crypto_aes128ctr

ptls_cipher_algorithm_t quic_crypto_aes128ctr
Initial value:
= { "AES128-CTR",
PTLS_AES128_KEY_SIZE,
1, PTLS_AES_IV_SIZE,
sizeof (struct cipher_context_t),
}
static int aes128ctr_setup_crypto(ptls_cipher_context_t *ctx, int is_enc, const void *key)
Definition: quic_crypto.c:124

Definition at line 272 of file quic_crypto.c.

◆ quic_crypto_aes128gcm

ptls_aead_algorithm_t quic_crypto_aes128gcm
Initial value:
= { "AES128-GCM",
PTLS_AES128_KEY_SIZE,
PTLS_AESGCM_IV_SIZE,
PTLS_AESGCM_TAG_SIZE,
sizeof (struct aead_crypto_context_t),
}
#define NULL
Definition: clib.h:58
ptls_cipher_algorithm_t quic_crypto_aes128ctr
Definition: quic_crypto.c:272
static int quic_crypto_aead_aes128gcm_setup_crypto(ptls_aead_context_t *ctx, int is_enc, const void *key)
Definition: quic_crypto.c:259

Definition at line 287 of file quic_crypto.c.

◆ quic_crypto_aes128gcmsha256

ptls_cipher_suite_t quic_crypto_aes128gcmsha256
Initial value:
=
{ PTLS_CIPHER_SUITE_AES_128_GCM_SHA256,
&ptls_openssl_sha256
}
ptls_aead_algorithm_t quic_crypto_aes128gcm
Definition: quic_crypto.c:287

Definition at line 307 of file quic_crypto.c.

◆ quic_crypto_aes256ctr

ptls_cipher_algorithm_t quic_crypto_aes256ctr
Initial value:
= { "AES256-CTR",
PTLS_AES256_KEY_SIZE,
1 ,
PTLS_AES_IV_SIZE,
sizeof (struct cipher_context_t),
}
static int aes256ctr_setup_crypto(ptls_cipher_context_t *ctx, int is_enc, const void *key)
Definition: quic_crypto.c:132

Definition at line 279 of file quic_crypto.c.

◆ quic_crypto_aes256gcm

ptls_aead_algorithm_t quic_crypto_aes256gcm
Initial value:
= { "AES256-GCM",
PTLS_AES256_KEY_SIZE,
PTLS_AESGCM_IV_SIZE,
PTLS_AESGCM_TAG_SIZE,
sizeof (struct aead_crypto_context_t),
}
#define NULL
Definition: clib.h:58
static int quic_crypto_aead_aes256gcm_setup_crypto(ptls_aead_context_t *ctx, int is_enc, const void *key)
Definition: quic_crypto.c:266
ptls_cipher_algorithm_t quic_crypto_aes256ctr
Definition: quic_crypto.c:279

Definition at line 297 of file quic_crypto.c.

◆ quic_crypto_aes256gcmsha384

ptls_cipher_suite_t quic_crypto_aes256gcmsha384
Initial value:
=
{ PTLS_CIPHER_SUITE_AES_256_GCM_SHA384,
&ptls_openssl_sha384
}
ptls_aead_algorithm_t quic_crypto_aes256gcm
Definition: quic_crypto.c:297

Definition at line 313 of file quic_crypto.c.

◆ quic_crypto_cipher_suites

ptls_cipher_suite_t* quic_crypto_cipher_suites[]
Initial value:
=
}
#define NULL
Definition: clib.h:58
ptls_cipher_suite_t quic_crypto_aes256gcmsha384
Definition: quic_crypto.c:313
ptls_cipher_suite_t quic_crypto_aes128gcmsha256
Definition: quic_crypto.c:307

Definition at line 319 of file quic_crypto.c.