Changeset View
Changeset View
Standalone View
Standalone View
sys/opencrypto/xform_enc.h
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | struct enc_xform { | ||||
* For stream ciphers, encrypt/decrypt the final partial block | * For stream ciphers, encrypt/decrypt the final partial block | ||||
* of 'len' bytes. | * of 'len' bytes. | ||||
*/ | */ | ||||
void (*encrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); | void (*encrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); | ||||
void (*decrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); | void (*decrypt_last) (void *, const uint8_t *, uint8_t *, size_t len); | ||||
}; | }; | ||||
extern struct enc_xform enc_xform_null; | extern const struct enc_xform enc_xform_null; | ||||
extern struct enc_xform enc_xform_rijndael128; | extern const struct enc_xform enc_xform_rijndael128; | ||||
extern struct enc_xform enc_xform_aes_icm; | extern const struct enc_xform enc_xform_aes_icm; | ||||
extern struct enc_xform enc_xform_aes_nist_gcm; | extern const struct enc_xform enc_xform_aes_nist_gcm; | ||||
extern struct enc_xform enc_xform_aes_nist_gmac; | extern const struct enc_xform enc_xform_aes_nist_gmac; | ||||
extern struct enc_xform enc_xform_aes_xts; | extern const struct enc_xform enc_xform_aes_xts; | ||||
extern struct enc_xform enc_xform_camellia; | extern const struct enc_xform enc_xform_camellia; | ||||
extern struct enc_xform enc_xform_chacha20; | extern const struct enc_xform enc_xform_chacha20; | ||||
extern struct enc_xform enc_xform_chacha20_poly1305; | extern const struct enc_xform enc_xform_chacha20_poly1305; | ||||
extern struct enc_xform enc_xform_ccm; | extern const struct enc_xform enc_xform_ccm; | ||||
struct aes_icm_ctx { | struct aes_icm_ctx { | ||||
uint32_t ac_ek[4*(RIJNDAEL_MAXNR + 1)]; | uint32_t ac_ek[4*(RIJNDAEL_MAXNR + 1)]; | ||||
/* ac_block is initialized to IV */ | /* ac_block is initialized to IV */ | ||||
uint8_t ac_block[AESICM_BLOCKSIZE]; | uint8_t ac_block[AESICM_BLOCKSIZE]; | ||||
int ac_nr; | int ac_nr; | ||||
}; | }; | ||||
struct aes_xts_ctx { | struct aes_xts_ctx { | ||||
rijndael_ctx key1; | rijndael_ctx key1; | ||||
rijndael_ctx key2; | rijndael_ctx key2; | ||||
uint8_t tweak[AES_XTS_BLOCKSIZE]; | uint8_t tweak[AES_XTS_BLOCKSIZE]; | ||||
}; | }; | ||||
#endif /* _CRYPTO_XFORM_ENC_H_ */ | #endif /* _CRYPTO_XFORM_ENC_H_ */ |