%{
/*
 * Copyright (C) 2009-2013 Andreas Steffen
 *
 * Copyright (C) secunet Security Networks AG
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

#include <string.h>

#include <crypto/transform.h>
#include <crypto/crypters/crypter.h>
#include <crypto/signers/signer.h>
#include <crypto/key_exchange.h>

%}
struct proposal_token {
	char             *name;
	transform_type_t  type;
	uint16_t          algorithm;
	uint16_t          keysize;
};
%%
null,             ENCRYPTION_ALGORITHM, ENCR_NULL,                 0
des,              ENCRYPTION_ALGORITHM, ENCR_DES,                  0
3des,             ENCRYPTION_ALGORITHM, ENCR_3DES,                 0
aes,              ENCRYPTION_ALGORITHM, ENCR_AES_CBC,            128
aes128,           ENCRYPTION_ALGORITHM, ENCR_AES_CBC,            128
aes192,           ENCRYPTION_ALGORITHM, ENCR_AES_CBC,            192
aes256,           ENCRYPTION_ALGORITHM, ENCR_AES_CBC,            256
aes128ctr,        ENCRYPTION_ALGORITHM, ENCR_AES_CTR,            128
aes192ctr,        ENCRYPTION_ALGORITHM, ENCR_AES_CTR,            192
aes256ctr,        ENCRYPTION_ALGORITHM, ENCR_AES_CTR,            256
aes128ccm8,       ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV8,       128
aes128ccm64,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV8,       128
aes128ccm12,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV12,      128
aes128ccm96,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV12,      128
aes128ccm16,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV16,      128
aes128ccm128,     ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV16,      128
aes128ccm,        ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV16,      128
aes192ccm8,       ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV8,       192
aes192ccm64,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV8,       192
aes192ccm12,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV12,      192
aes192ccm96,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV12,      192
aes192ccm16,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV16,      192
aes192ccm128,     ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV16,      192
aes192ccm,        ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV16,      192
aes256ccm8,       ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV8,       256
aes256ccm64,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV8,       256
aes256ccm12,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV12,      256
aes256ccm96,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV12,      256
aes256ccm16,      ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV16,      256
aes256ccm128,     ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV16,      256
aes256ccm,        ENCRYPTION_ALGORITHM, ENCR_AES_CCM_ICV16,      256
aes128gcm8,       ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV8,       128
aes128gcm64,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV8,       128
aes128gcm12,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV12,      128
aes128gcm96,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV12,      128
aes128gcm16,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16,      128
aes128gcm128,     ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16,      128
aes128gcm,        ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16,      128
aes192gcm8,       ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV8,       192
aes192gcm64,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV8,       192
aes192gcm12,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV12,      192
aes192gcm96,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV12,      192
aes192gcm16,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16,      192
aes192gcm128,     ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16,      192
aes192gcm,        ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16,      192
aes256gcm8,       ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV8,       256
aes256gcm64,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV8,       256
aes256gcm12,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV12,      256
aes256gcm96,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV12,      256
aes256gcm16,      ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16,      256
aes256gcm128,     ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16,      256
aes256gcm,        ENCRYPTION_ALGORITHM, ENCR_AES_GCM_ICV16,      256
aes128gmac,       ENCRYPTION_ALGORITHM, ENCR_NULL_AUTH_AES_GMAC, 128
aes192gmac,       ENCRYPTION_ALGORITHM, ENCR_NULL_AUTH_AES_GMAC, 192
aes256gmac,       ENCRYPTION_ALGORITHM, ENCR_NULL_AUTH_AES_GMAC, 256
chacha20poly1305, ENCRYPTION_ALGORITHM, ENCR_CHACHA20_POLY1305,    0
chacha20poly1305compat, ENCRYPTION_ALGORITHM, ENCR_CHACHA20_POLY1305, 256
blowfish,         ENCRYPTION_ALGORITHM, ENCR_BLOWFISH,           128
blowfish128,      ENCRYPTION_ALGORITHM, ENCR_BLOWFISH,           128
blowfish192,      ENCRYPTION_ALGORITHM, ENCR_BLOWFISH,           192
blowfish256,      ENCRYPTION_ALGORITHM, ENCR_BLOWFISH,           256
camellia,         ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CBC,       128
camellia128,      ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CBC,       128
camellia192,      ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CBC,       192
camellia256,      ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CBC,       256
camellia128ctr,   ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CTR,       128
camellia192ctr,   ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CTR,       192
camellia256ctr,   ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CTR,       256
camellia128ccm8,  ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV8,  128
camellia128ccm64, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV8,  128
camellia128ccm12, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV12, 128
camellia128ccm96, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV12, 128
camellia128ccm16, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV16, 128
camellia128ccm128,ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV16, 128
camellia192ccm8,  ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV8,  192
camellia192ccm64, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV8,  192
camellia192ccm12, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV12, 192
camellia192ccm96, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV12, 192
camellia192ccm16, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV16, 192
camellia192ccm128,ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV16, 192
camellia256ccm8,  ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV8,  256
camellia256ccm64, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV8,  256
camellia256ccm12, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV12, 256
camellia256ccm96, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV12, 256
camellia256ccm16, ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV16, 256
camellia256ccm128,ENCRYPTION_ALGORITHM, ENCR_CAMELLIA_CCM_ICV16, 256
cast128,          ENCRYPTION_ALGORITHM, ENCR_CAST,               128
serpent,          ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC,        128
serpent128,       ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC,        128
serpent192,       ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC,        192
serpent256,       ENCRYPTION_ALGORITHM, ENCR_SERPENT_CBC,        256
twofish,          ENCRYPTION_ALGORITHM, ENCR_TWOFISH_CBC,        128
twofish128,       ENCRYPTION_ALGORITHM, ENCR_TWOFISH_CBC,        128
twofish192,       ENCRYPTION_ALGORITHM, ENCR_TWOFISH_CBC,        192
twofish256,       ENCRYPTION_ALGORITHM, ENCR_TWOFISH_CBC,        256
sha,              INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA1_96,         0
sha1,             INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA1_96,         0
sha1_160,         INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA1_160,        0
sha256,           INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA2_256_128,    0
sha2_256,         INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA2_256_128,    0
sha256_96,        INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA2_256_96,     0
sha2_256_96,      INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA2_256_96,     0
sha384,           INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA2_384_192,    0
sha2_384,         INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA2_384_192,    0
sha512,           INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA2_512_256,    0
sha2_512,         INTEGRITY_ALGORITHM,  AUTH_HMAC_SHA2_512_256,    0
md5,              INTEGRITY_ALGORITHM,  AUTH_HMAC_MD5_96,          0
md5_128,          INTEGRITY_ALGORITHM,  AUTH_HMAC_MD5_128,         0
aesxcbc,          INTEGRITY_ALGORITHM,  AUTH_AES_XCBC_96,          0
camelliaxcbc,     INTEGRITY_ALGORITHM,  AUTH_CAMELLIA_XCBC_96,     0
aescmac,          INTEGRITY_ALGORITHM,  AUTH_AES_CMAC_96,          0
prfsha1,          PSEUDO_RANDOM_FUNCTION, PRF_HMAC_SHA1,           0
prfsha256,        PSEUDO_RANDOM_FUNCTION, PRF_HMAC_SHA2_256,       0
prfsha384,        PSEUDO_RANDOM_FUNCTION, PRF_HMAC_SHA2_384,       0
prfsha512,        PSEUDO_RANDOM_FUNCTION, PRF_HMAC_SHA2_512,       0
prfmd5,           PSEUDO_RANDOM_FUNCTION, PRF_HMAC_MD5,            0
prfaesxcbc,       PSEUDO_RANDOM_FUNCTION, PRF_AES128_XCBC,         0
prfcamelliaxcbc,  PSEUDO_RANDOM_FUNCTION, PRF_CAMELLIA128_XCBC,    0
prfaescmac,       PSEUDO_RANDOM_FUNCTION, PRF_AES128_CMAC,         0
none,             KEY_EXCHANGE_METHOD, KE_NONE,                    0
modpnone,         KEY_EXCHANGE_METHOD, KE_NONE,                    0
modpnull,         KEY_EXCHANGE_METHOD, MODP_NULL,                  0
modp768,          KEY_EXCHANGE_METHOD, MODP_768_BIT,               0
modp1024,         KEY_EXCHANGE_METHOD, MODP_1024_BIT,              0
modp1536,         KEY_EXCHANGE_METHOD, MODP_1536_BIT,              0
modp2048,         KEY_EXCHANGE_METHOD, MODP_2048_BIT,              0
modp3072,         KEY_EXCHANGE_METHOD, MODP_3072_BIT,              0
modp4096,         KEY_EXCHANGE_METHOD, MODP_4096_BIT,              0
modp6144,         KEY_EXCHANGE_METHOD, MODP_6144_BIT,              0
modp8192,         KEY_EXCHANGE_METHOD, MODP_8192_BIT,              0
ecp192,           KEY_EXCHANGE_METHOD, ECP_192_BIT,                0
ecp224,           KEY_EXCHANGE_METHOD, ECP_224_BIT,                0
ecp256,           KEY_EXCHANGE_METHOD, ECP_256_BIT,                0
ecp384,           KEY_EXCHANGE_METHOD, ECP_384_BIT,                0
ecp521,           KEY_EXCHANGE_METHOD, ECP_521_BIT,                0
modp1024s160,     KEY_EXCHANGE_METHOD, MODP_1024_160,              0
modp2048s224,     KEY_EXCHANGE_METHOD, MODP_2048_224,              0
modp2048s256,     KEY_EXCHANGE_METHOD, MODP_2048_256,              0
ecp224bp,         KEY_EXCHANGE_METHOD, ECP_224_BP,                 0
ecp256bp,         KEY_EXCHANGE_METHOD, ECP_256_BP,                 0
ecp384bp,         KEY_EXCHANGE_METHOD, ECP_384_BP,                 0
ecp512bp,         KEY_EXCHANGE_METHOD, ECP_512_BP,                 0
curve25519,       KEY_EXCHANGE_METHOD, CURVE_25519,                0
x25519,           KEY_EXCHANGE_METHOD, CURVE_25519,                0
curve448,         KEY_EXCHANGE_METHOD, CURVE_448,                  0
x448,             KEY_EXCHANGE_METHOD, CURVE_448,                  0
gost256,          KEY_EXCHANGE_METHOD, GOST3410_256,               0
gost512,          KEY_EXCHANGE_METHOD, GOST3410_512,               0
mlkem512,         KEY_EXCHANGE_METHOD, ML_KEM_512,                 0
mlkem768,         KEY_EXCHANGE_METHOD, ML_KEM_768,                 0
mlkem1024,        KEY_EXCHANGE_METHOD, ML_KEM_1024,                0
noesn,            EXTENDED_SEQUENCE_NUMBERS, NO_EXT_SEQ_NUMBERS,   0
esn,              EXTENDED_SEQUENCE_NUMBERS, EXT_SEQ_NUMBERS,      0
