openssl: optimizations based on ARCH/small flash
[openwrt/openwrt.git] / package / libs / openssl / Config.in
index 53b91ddb942a77f8ad5d39d69cfd7295b1533690..c9a853193fa265dc35737df19a00158565777488 100644 (file)
@@ -4,6 +4,7 @@ comment "Build Options"
 
 config OPENSSL_OPTIMIZE_SPEED
        bool
+       default y if x86_64 || i386
        prompt "Enable optimization for speed instead of size"
        select OPENSSL_WITH_ASM
        help
@@ -15,7 +16,7 @@ config OPENSSL_OPTIMIZE_SPEED
 
 config OPENSSL_WITH_ASM
        bool
-       default y
+       default y if !SMALL_FLASH || !arm
        prompt "Compile with optimized assembly code"
        depends on !arc
        help
@@ -63,6 +64,7 @@ config OPENSSL_NO_DEPRECATED
 
 config OPENSSL_WITH_ERROR_MESSAGES
        bool
+       default y if !SMALL_FLASH && !LOW_MEMORY_FOOTPRINT
        prompt "Include error messages"
        help
                This option aids debugging, but increases package size and
@@ -147,6 +149,18 @@ config OPENSSL_WITH_CHACHA_POLY1305
                It is 3x faster than AES, when not using a CPU with AES-specific
                instructions, as is the case of most embedded devices.
 
+config OPENSSL_PREFER_CHACHA_OVER_GCM
+       bool
+       default y if !x86_64 && !aarch64
+       prompt "Prefer ChaCha20-Poly1305 over AES-GCM by default"
+       depends on OPENSSL_WITH_CHACHA_POLY1305
+       help
+               The default openssl preference is for AES-GCM before ChaCha, but
+               that takes into account AES-NI capable chips.  It is not the
+               case with most embedded chips, so it may be better to invert
+               that preference.  This is just for the default case. The
+               application can always override this.
+
 config OPENSSL_WITH_PSK
        bool
        default y