Changeset View
Changeset View
Standalone View
Standalone View
tools/tools/crypto/cryptocheck.c
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* Authenticated Encryption with Associated Data: | * Authenticated Encryption with Associated Data: | ||||
* aes-gcm 128-bit AES-GCM | * aes-gcm 128-bit AES-GCM | ||||
* aes-gcm192 192-bit AES-GCM | * aes-gcm192 192-bit AES-GCM | ||||
* aes-gcm256 256-bit AES-GCM | * aes-gcm256 256-bit AES-GCM | ||||
* aes-ccm 128-bit AES-CCM | * aes-ccm 128-bit AES-CCM | ||||
* aes-ccm192 192-bit AES-CCM | * aes-ccm192 192-bit AES-CCM | ||||
* aes-ccm256 256-bit AES-CCM | * aes-ccm256 256-bit AES-CCM | ||||
* chacha20-poly1305 Chacha20 (96 bit nonce) with Poly1305 per RFC 8439 | * chacha20-poly1305 Chacha20 with Poly1305 per RFC 8439 | ||||
*/ | */ | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <assert.h> | #include <assert.h> | ||||
#include <err.h> | #include <err.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#include <libutil.h> | #include <libutil.h> | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | static const struct alg { | ||||
{ .name = "aes-ccm192", .cipher = CRYPTO_AES_CCM_16, .type = T_AEAD, | { .name = "aes-ccm192", .cipher = CRYPTO_AES_CCM_16, .type = T_AEAD, | ||||
.tag_len = AES_CBC_MAC_HASH_LEN, .iv_sizes = { 12, 7, 8, 9, 10, 11, 13 }, | .tag_len = AES_CBC_MAC_HASH_LEN, .iv_sizes = { 12, 7, 8, 9, 10, 11, 13 }, | ||||
.evp_cipher = EVP_aes_192_ccm }, | .evp_cipher = EVP_aes_192_ccm }, | ||||
{ .name = "aes-ccm256", .cipher = CRYPTO_AES_CCM_16, .type = T_AEAD, | { .name = "aes-ccm256", .cipher = CRYPTO_AES_CCM_16, .type = T_AEAD, | ||||
.tag_len = AES_CBC_MAC_HASH_LEN, .iv_sizes = { 12, 7, 8, 9, 10, 11, 13 }, | .tag_len = AES_CBC_MAC_HASH_LEN, .iv_sizes = { 12, 7, 8, 9, 10, 11, 13 }, | ||||
.evp_cipher = EVP_aes_256_ccm }, | .evp_cipher = EVP_aes_256_ccm }, | ||||
{ .name = "chacha20-poly1305", .cipher = CRYPTO_CHACHA20_POLY1305, | { .name = "chacha20-poly1305", .cipher = CRYPTO_CHACHA20_POLY1305, | ||||
.type = T_AEAD, .tag_len = POLY1305_HASH_LEN, | .type = T_AEAD, .tag_len = POLY1305_HASH_LEN, | ||||
.iv_sizes = { CHACHA20_POLY1305_IV_LEN }, | .iv_sizes = { CHACHA20_POLY1305_IV_LEN, 8 }, | ||||
.evp_cipher = EVP_chacha20_poly1305 }, | .evp_cipher = EVP_chacha20_poly1305 }, | ||||
}; | }; | ||||
static bool testall, verbose; | static bool testall, verbose; | ||||
static int requested_crid; | static int requested_crid; | ||||
static size_t aad_sizes[48], sizes[EALG_MAX_BLOCK_LEN * 2]; | static size_t aad_sizes[48], sizes[EALG_MAX_BLOCK_LEN * 2]; | ||||
static u_int naad_sizes, nsizes; | static u_int naad_sizes, nsizes; | ||||
static u_int iv_size; | static u_int iv_size; | ||||
▲ Show 20 Lines • Show All 1,622 Lines • Show Last 20 Lines |