Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SoftEtherVPN/SoftEtherVPN_Stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordnobori <da.git@softether.co.jp>2019-07-07 15:25:52 +0300
committerdnobori <da.git@softether.co.jp>2019-07-07 15:25:52 +0300
commit55d1ac0402a2f9cc546566485ad07cb1f8321b5d (patch)
tree186053d28d88e53a05968d54d948a679940c7ff0 /src/Mayaqua/Encrypt.h
parent92837bc8b46e244f3101c1d6425c171997ce79b1 (diff)
v4.30-9695-betav4.30-9695-beta
Diffstat (limited to 'src/Mayaqua/Encrypt.h')
-rw-r--r--src/Mayaqua/Encrypt.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Mayaqua/Encrypt.h b/src/Mayaqua/Encrypt.h
index 1be31649..d5b334b7 100644
--- a/src/Mayaqua/Encrypt.h
+++ b/src/Mayaqua/Encrypt.h
@@ -105,6 +105,10 @@
#ifndef ENCRYPT_H
#define ENCRYPT_H
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+//#define USE_OPENSSL_AEAD_CHACHA20POLY1305
+#endif
+
// Function of OpenSSL
void RAND_Init_For_SoftEther();
void RAND_Free_For_SoftEther();
@@ -132,6 +136,12 @@ void RAND_Free_For_SoftEther();
#define AES_IV_SIZE 16 // AES IV size
#define AES_MAX_KEY_SIZE 32 // Maximum AES key size
+// RFC 8439: ChaCha20 and Poly1305 for IETF Protocols
+#define AEAD_CHACHA20_POLY1305_MAC_SIZE 16 // MAC size
+#define AEAD_CHACHA20_POLY1305_NONCE_SIZE 12 // Nonce size
+#define AEAD_CHACHA20_POLY1305_KEY_SIZE 32 // Key size
+
+
// IANA definitions taken from IKEv1 Phase 1
#define SHA1_160 2
#define SHA2_256 4
@@ -574,6 +584,22 @@ BUF *EasyDecrypt(BUF *src_buf);
void DisableIntelAesAccel();
+int GetSslClientCertIndex();
+
+void Aead_ChaCha20Poly1305_Ietf_Encrypt_Embedded(void *dst, void *src, UINT src_size, void *key, void *nonce, void *aad, UINT aad_size);
+bool Aead_ChaCha20Poly1305_Ietf_Decrypt_Embedded(void *dst, void *src, UINT src_size, void *key, void *nonce, void *aad, UINT aad_size);
+
+void Aead_ChaCha20Poly1305_Ietf_Encrypt_OpenSSL(void *dst, void *src, UINT src_size, void *key, void *nonce, void *aad, UINT aad_size);
+bool Aead_ChaCha20Poly1305_Ietf_Decrypt_OpenSSL(void *dst, void *src, UINT src_size, void *key, void *nonce, void *aad, UINT aad_size);
+
+void Aead_ChaCha20Poly1305_Ietf_Encrypt(void *dst, void *src, UINT src_size, void *key, void *nonce, void *aad, UINT aad_size);
+bool Aead_ChaCha20Poly1305_Ietf_Decrypt(void *dst, void *src, UINT src_size, void *key, void *nonce, void *aad, UINT aad_size);
+
+bool Aead_ChaCha20Poly1305_Ietf_IsOpenSSL();
+
+void Aead_ChaCha20Poly1305_Ietf_Test();
+
+
#ifdef ENCRYPT_C
// Inner function