Changeset View
Changeset View
Standalone View
Standalone View
sys/opencrypto/xform_aes_icm.c
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
static int aes_icm_setkey(void *, const uint8_t *, int); | static int aes_icm_setkey(void *, const uint8_t *, int); | ||||
static void aes_icm_crypt(void *, const uint8_t *, uint8_t *); | static void aes_icm_crypt(void *, const uint8_t *, uint8_t *); | ||||
static void aes_icm_crypt_last(void *, const uint8_t *, uint8_t *, size_t); | static void aes_icm_crypt_last(void *, const uint8_t *, uint8_t *, size_t); | ||||
static void aes_icm_reinit(void *, const uint8_t *); | static void aes_icm_reinit(void *, const uint8_t *); | ||||
static void aes_gcm_reinit(void *, const uint8_t *); | static void aes_gcm_reinit(void *, const uint8_t *); | ||||
static void aes_ccm_reinit(void *, const uint8_t *); | static void aes_ccm_reinit(void *, const uint8_t *); | ||||
/* Encryption instances */ | /* Encryption instances */ | ||||
struct enc_xform enc_xform_aes_icm = { | const struct enc_xform enc_xform_aes_icm = { | ||||
.type = CRYPTO_AES_ICM, | .type = CRYPTO_AES_ICM, | ||||
.name = "AES-ICM", | .name = "AES-ICM", | ||||
.ctxsize = sizeof(struct aes_icm_ctx), | .ctxsize = sizeof(struct aes_icm_ctx), | ||||
.blocksize = 1, | .blocksize = 1, | ||||
.native_blocksize = AES_BLOCK_LEN, | .native_blocksize = AES_BLOCK_LEN, | ||||
.ivsize = AES_BLOCK_LEN, | .ivsize = AES_BLOCK_LEN, | ||||
.minkey = AES_MIN_KEY, | .minkey = AES_MIN_KEY, | ||||
.maxkey = AES_MAX_KEY, | .maxkey = AES_MAX_KEY, | ||||
.encrypt = aes_icm_crypt, | .encrypt = aes_icm_crypt, | ||||
.decrypt = aes_icm_crypt, | .decrypt = aes_icm_crypt, | ||||
.setkey = aes_icm_setkey, | .setkey = aes_icm_setkey, | ||||
.reinit = aes_icm_reinit, | .reinit = aes_icm_reinit, | ||||
.encrypt_last = aes_icm_crypt_last, | .encrypt_last = aes_icm_crypt_last, | ||||
.decrypt_last = aes_icm_crypt_last, | .decrypt_last = aes_icm_crypt_last, | ||||
}; | }; | ||||
struct enc_xform enc_xform_aes_nist_gcm = { | const struct enc_xform enc_xform_aes_nist_gcm = { | ||||
.type = CRYPTO_AES_NIST_GCM_16, | .type = CRYPTO_AES_NIST_GCM_16, | ||||
.name = "AES-GCM", | .name = "AES-GCM", | ||||
.ctxsize = sizeof(struct aes_icm_ctx), | .ctxsize = sizeof(struct aes_icm_ctx), | ||||
.blocksize = 1, | .blocksize = 1, | ||||
.native_blocksize = AES_BLOCK_LEN, | .native_blocksize = AES_BLOCK_LEN, | ||||
.ivsize = AES_GCM_IV_LEN, | .ivsize = AES_GCM_IV_LEN, | ||||
.minkey = AES_MIN_KEY, | .minkey = AES_MIN_KEY, | ||||
.maxkey = AES_MAX_KEY, | .maxkey = AES_MAX_KEY, | ||||
.encrypt = aes_icm_crypt, | .encrypt = aes_icm_crypt, | ||||
.decrypt = aes_icm_crypt, | .decrypt = aes_icm_crypt, | ||||
.setkey = aes_icm_setkey, | .setkey = aes_icm_setkey, | ||||
.reinit = aes_gcm_reinit, | .reinit = aes_gcm_reinit, | ||||
.encrypt_last = aes_icm_crypt_last, | .encrypt_last = aes_icm_crypt_last, | ||||
.decrypt_last = aes_icm_crypt_last, | .decrypt_last = aes_icm_crypt_last, | ||||
}; | }; | ||||
struct enc_xform enc_xform_ccm = { | const struct enc_xform enc_xform_ccm = { | ||||
.type = CRYPTO_AES_CCM_16, | .type = CRYPTO_AES_CCM_16, | ||||
.name = "AES-CCM", | .name = "AES-CCM", | ||||
.ctxsize = sizeof(struct aes_icm_ctx), | .ctxsize = sizeof(struct aes_icm_ctx), | ||||
.blocksize = 1, | .blocksize = 1, | ||||
.native_blocksize = AES_BLOCK_LEN, | .native_blocksize = AES_BLOCK_LEN, | ||||
.ivsize = AES_CCM_IV_LEN, | .ivsize = AES_CCM_IV_LEN, | ||||
.minkey = AES_MIN_KEY, .maxkey = AES_MAX_KEY, | .minkey = AES_MIN_KEY, .maxkey = AES_MAX_KEY, | ||||
.encrypt = aes_icm_crypt, | .encrypt = aes_icm_crypt, | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |