crypter: Define a ChaCha20/Poly1305 AEAD algorithm identifier
authorMartin Willi <martin@revosec.ch>
Wed, 1 Apr 2015 17:14:47 +0000 (19:14 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 29 Jun 2015 15:32:03 +0000 (17:32 +0200)
src/libstrongswan/crypto/crypters/crypter.c
src/libstrongswan/crypto/crypters/crypter.h
src/libstrongswan/crypto/iv/iv_gen.c

index 1e73baa..3e33765 100644 (file)
@@ -40,13 +40,14 @@ ENUM_NEXT(encryption_algorithm_names, ENCR_AES_GCM_ICV8, ENCR_NULL_AUTH_AES_GMAC
        "AES_GCM_12",
        "AES_GCM_16",
        "NULL_AES_GMAC");
-ENUM_NEXT(encryption_algorithm_names, ENCR_CAMELLIA_CBC, ENCR_CAMELLIA_CCM_ICV16, ENCR_NULL_AUTH_AES_GMAC,
+ENUM_NEXT(encryption_algorithm_names, ENCR_CAMELLIA_CBC, ENCR_CHACHA20_POLY1305, ENCR_NULL_AUTH_AES_GMAC,
        "CAMELLIA_CBC",
        "CAMELLIA_CTR",
        "CAMELLIA_CCM_8",
        "CAMELLIA_CCM_12",
-       "CAMELLIA_CCM_16");
-ENUM_NEXT(encryption_algorithm_names, ENCR_UNDEFINED, ENCR_RC2_CBC, ENCR_CAMELLIA_CCM_ICV16,
+       "CAMELLIA_CCM_16",
+       "CHACHA20_POLY1305");
+ENUM_NEXT(encryption_algorithm_names, ENCR_UNDEFINED, ENCR_RC2_CBC, ENCR_CHACHA20_POLY1305,
        "UNDEFINED",
        "DES_ECB",
        "SERPENT_CBC",
@@ -184,6 +185,7 @@ bool encryption_algorithm_is_aead(encryption_algorithm_t alg)
                case ENCR_CAMELLIA_CCM_ICV8:
                case ENCR_CAMELLIA_CCM_ICV12:
                case ENCR_CAMELLIA_CCM_ICV16:
+               case ENCR_CHACHA20_POLY1305:
                        return TRUE;
                default:
                        return FALSE;
index 849aea5..19ba55d 100644 (file)
@@ -57,6 +57,7 @@ enum encryption_algorithm_t {
        ENCR_CAMELLIA_CCM_ICV8 =  25,
        ENCR_CAMELLIA_CCM_ICV12 = 26,
        ENCR_CAMELLIA_CCM_ICV16 = 27,
+       ENCR_CHACHA20_POLY1305 =  28,
        ENCR_UNDEFINED =        1024,
        ENCR_DES_ECB =          1025,
        ENCR_SERPENT_CBC =      1026,
index e188432..7d6570a 100644 (file)
@@ -48,6 +48,7 @@ iv_gen_t* iv_gen_create_for_alg(encryption_algorithm_t alg)
                case ENCR_CAMELLIA_CCM_ICV8:
                case ENCR_CAMELLIA_CCM_ICV12:
                case ENCR_CAMELLIA_CCM_ICV16:
+               case ENCR_CHACHA20_POLY1305:
                case ENCR_NULL_AUTH_AES_GMAC:
                        return iv_gen_seq_create();
                case ENCR_NULL: