-static struct GRASSHOPPER_CIPHER_PARAMS gost_cipher_params[6] = {
- [GRASSHOPPER_CIPHER_ECB] = {
- NID_grasshopper_ecb,
- gost_grasshopper_cipher_init_ecb,
- gost_grasshopper_cipher_do_ecb,
- NULL,
- 16,
- sizeof(gost_grasshopper_cipher_ctx),
- 0,
- true}
- ,
- [GRASSHOPPER_CIPHER_CBC] = {
- NID_grasshopper_cbc,
- gost_grasshopper_cipher_init_cbc,
- gost_grasshopper_cipher_do_cbc,
- NULL,
- 16,
- sizeof(gost_grasshopper_cipher_ctx),
- 16,
- true}
- ,
- [GRASSHOPPER_CIPHER_OFB] = {
- NID_grasshopper_ofb,
- gost_grasshopper_cipher_init_ofb,
- gost_grasshopper_cipher_do_ofb,
- gost_grasshopper_cipher_destroy_ofb,
- 1,
- sizeof(gost_grasshopper_cipher_ctx_ofb),
- 16,
- false}
- ,
- [GRASSHOPPER_CIPHER_CFB] = {
- NID_grasshopper_cfb,
- gost_grasshopper_cipher_init_cfb,
- gost_grasshopper_cipher_do_cfb,
- NULL,
- 1,
- sizeof(gost_grasshopper_cipher_ctx),
- 16,
- false}
- ,
- [GRASSHOPPER_CIPHER_CTR] = {
- NID_grasshopper_ctr,
- gost_grasshopper_cipher_init_ctr,
- gost_grasshopper_cipher_do_ctr,
- gost_grasshopper_cipher_destroy_ctr,
- 1,
- sizeof(gost_grasshopper_cipher_ctx_ctr),
- /* IV size is set to match full block, to make it responsibility of
- * user to assign correct values (IV || 0), and to make naive context
- * copy possible (for software such as openssh) */
- 16,
- false}
- ,
- [GRASSHOPPER_CIPHER_CTRACPKM] = {
- NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm,
- gost_grasshopper_cipher_init_ctracpkm,
- gost_grasshopper_cipher_do_ctracpkm,
- gost_grasshopper_cipher_destroy_ctr,
- 1,
- sizeof
- (gost_grasshopper_cipher_ctx_ctr),
- 16,
- false}
- ,
+static struct GRASSHOPPER_CIPHER_PARAMS gost_cipher_params[7] = {
+ {
+ NID_grasshopper_ecb,
+ gost_grasshopper_cipher_init_ecb,
+ gost_grasshopper_cipher_do_ecb,
+ NULL,
+ 16,
+ sizeof(gost_grasshopper_cipher_ctx),
+ 0,
+ true,
+ 0
+ },
+ {
+ NID_grasshopper_cbc,
+ gost_grasshopper_cipher_init_cbc,
+ gost_grasshopper_cipher_do_cbc,
+ NULL,
+ 16,
+ sizeof(gost_grasshopper_cipher_ctx),
+ 16,
+ true,
+ 0
+ },
+ {
+ NID_grasshopper_ofb,
+ gost_grasshopper_cipher_init_ofb,
+ gost_grasshopper_cipher_do_ofb,
+ NULL,
+ 1,
+ sizeof(gost_grasshopper_cipher_ctx),
+ 16,
+ false,
+ 0
+ },
+ {
+ NID_grasshopper_cfb,
+ gost_grasshopper_cipher_init_cfb,
+ gost_grasshopper_cipher_do_cfb,
+ NULL,
+ 1,
+ sizeof(gost_grasshopper_cipher_ctx),
+ 16,
+ false,
+ 0
+ },
+ {
+ NID_grasshopper_ctr,
+ gost_grasshopper_cipher_init_ctr,
+ gost_grasshopper_cipher_do_ctr,
+ gost_grasshopper_cipher_destroy_ctr,
+ 1,
+ sizeof(gost_grasshopper_cipher_ctx_ctr),
+ 8,
+ false,
+ 0
+ },
+ {
+ NID_kuznyechik_ctr_acpkm,
+ gost_grasshopper_cipher_init_ctracpkm,
+ gost_grasshopper_cipher_do_ctracpkm,
+ gost_grasshopper_cipher_destroy_ctr,
+ 1,
+ sizeof(gost_grasshopper_cipher_ctx_ctr),
+ 8,
+ false,
+ 0
+ },
+ {
+ NID_kuznyechik_ctr_acpkm_omac,
+ gost_grasshopper_cipher_init_ctracpkm_omac,
+ gost_grasshopper_cipher_do_ctracpkm_omac,
+ gost_grasshopper_cipher_destroy_ctr,
+ 1,
+ sizeof(gost_grasshopper_cipher_ctx_ctr),
+ 8,
+ false,
+ EVP_CIPH_FLAG_CUSTOM_CIPHER|EVP_CIPH_FLAG_CIPHER_WITH_MAC|EVP_CIPH_CUSTOM_COPY
+ },