################################################################################
# Automated configuration
#
# This file is not meant for manually selecting options.
#

#
# The Curve25519 is not defined to be configurable as this is not PQC-resistant.
# It is only provided to allow a hybrid Dilithium / Kyber algorithm.
#
ifdef CONFIG_LEANCRYPTO_KEM_X25519
CONFIG_LEANCRYPTO_CURVE25519=y
endif
ifdef CONFIG_LEANCRYPTO_DILITHIUM_ED25519
CONFIG_LEANCRYPTO_CURVE25519=y
endif

#
# The Curve448 is not defined to be configurable as this is not PQC-resistant.
# It is only provided to allow a hybrid Dilithium / Kyber algorithm.
#
ifdef CONFIG_LEANCRYPTO_KEM_X448
CONFIG_LEANCRYPTO_CURVE448=y
endif
ifdef CONFIG_LEANCRYPTO_DILITHIUM_ED448
CONFIG_LEANCRYPTO_CURVE448=y
endif

#
# Automatically select the common Kyber code
#
ifdef CONFIG_LEANCRYPTO_KEM_KYBER_1024
CONFIG_LEANCRYPTO_KEM_KYBER=y
endif
ifdef CONFIG_LEANCRYPTO_KEM_KYBER_768
CONFIG_LEANCRYPTO_KEM_KYBER=y
endif
ifdef CONFIG_LEANCRYPTO_KEM_KYBER_512
CONFIG_LEANCRYPTO_KEM_KYBER=y
endif

#
# Automatically select the common Dilithium code
#
ifdef CONFIG_LEANCRYPTO_DILITHIUM_87
CONFIG_LEANCRYPTO_DILITHIUM=y
CONFIG_LEANCRYPTO_SIG_SUPPORT=y
endif
ifdef CONFIG_LEANCRYPTO_DILITHIUM_65
CONFIG_LEANCRYPTO_DILITHIUM=y
CONFIG_LEANCRYPTO_SIG_SUPPORT=y
endif
ifdef CONFIG_LEANCRYPTO_DILITHIUM_44
CONFIG_LEANCRYPTO_DILITHIUM=y
CONFIG_LEANCRYPTO_SIG_SUPPORT=y
endif

#
# Automatically select the common BIKE code
#
ifdef CONFIG_LEANCRYPTO_KEM_BIKE_5
CONFIG_LEANCRYPTO_KEM_BIKE=y
endif
ifdef CONFIG_LEANCRYPTO_KEM_BIKE_3
CONFIG_LEANCRYPTO_KEM_BIKE=y
endif
ifdef CONFIG_LEANCRYPTO_KEM_BIKE_1
CONFIG_LEANCRYPTO_KEM_BIKE=y
endif

#
# Automatically select the common HQC code
#
ifdef CONFIG_LEANCRYPTO_KEM_HQC_256
CONFIG_LEANCRYPTO_KEM_HQC=y
endif
ifdef CONFIG_LEANCRYPTO_KEM_HQC_192
CONFIG_LEANCRYPTO_KEM_HQC=y
endif
ifdef CONFIG_LEANCRYPTO_KEM_HQC_128
CONFIG_LEANCRYPTO_KEM_HQC=y
endif

#
# Automatically select the common Dilithium code
#
ifdef CONFIG_LEANCRYPTO_SPHINCS_256s
CONFIG_LEANCRYPTO_SPHINCS=y
CONFIG_LEANCRYPTO_SIG_SUPPORT=y
endif
ifdef CONFIG_LEANCRYPTO_SPHINCS_256f
CONFIG_LEANCRYPTO_SPHINCS=y
CONFIG_LEANCRYPTO_SIG_SUPPORT=y
endif
ifdef CONFIG_LEANCRYPTO_SPHINCS_192s
CONFIG_LEANCRYPTO_SPHINCS=y
CONFIG_LEANCRYPTO_SIG_SUPPORT=y
endif
ifdef CONFIG_LEANCRYPTO_SPHINCS_192f
CONFIG_LEANCRYPTO_SPHINCS=y
CONFIG_LEANCRYPTO_SIG_SUPPORT=y
endif
ifdef CONFIG_LEANCRYPTO_SPHINCS_128s
CONFIG_LEANCRYPTO_SPHINCS=y
CONFIG_LEANCRYPTO_SIG_SUPPORT=y
endif
ifdef CONFIG_LEANCRYPTO_SPHINCS_128f
CONFIG_LEANCRYPTO_SPHINCS=y
CONFIG_LEANCRYPTO_SIG_SUPPORT=y
endif

#
# Automatically select the common AEAD code
#
ifdef CONFIG_LEANCRYPTO_SYMHMAC_CRYPT
CONFIG_LEANCRYPTO_AEAD=y
endif
ifdef CONFIG_LEANCRYPTO_SYMKMAC_CRYPT
CONFIG_LEANCRYPTO_AEAD=y
endif
ifdef CONFIG_LEANCRYPTO_HASH_CRYPT
CONFIG_LEANCRYPTO_AEAD=y
endif
ifdef CONFIG_LEANCRYPTO_CSHAKE_CRYPT
CONFIG_LEANCRYPTO_AEAD=y
endif
ifdef CONFIG_LEANCRYPTO_KMAC_CRYPT
CONFIG_LEANCRYPTO_AEAD=y
endif
ifdef CONFIG_LEANCRYPTO_ASCON_CRYPT
CONFIG_LEANCRYPTO_AEAD=y
endif
ifdef CONFIG_LEANCRYPTO_CHACHA20_POLY1305
CONFIG_LEANCRYPTO_AEAD=y
endif
ifdef CONFIG_LEANCRYPTO_AES_GCM
CONFIG_LEANCRYPTO_AEAD=y
endif

#
# Enabled ciphers
#
ifdef CONFIG_LEANCRYPTO_AES
ccflags-y	+= -DLC_AES
endif
ifdef CONFIG_LEANCRYPTO_AES_CBC
ccflags-y	+= -DLC_AES_CBC
endif
ifdef CONFIG_LEANCRYPTO_AES_CTR
ccflags-y	+= -DLC_AES_CTR
endif
ifdef CONFIG_LEANCRYPTO_AES_XTS
ccflags-y	+= -DLC_AES_XTS
endif
ifdef CONFIG_LEANCRYPTO_AES_KW
ccflags-y	+= -DLC_AES_KW
endif
ifdef CONFIG_LEANCRYPTO_SHA2_256
ccflags-y	+= -DLC_SHA2_256
endif
ifdef CONFIG_LEANCRYPTO_SHA2_512
ccflags-y	+= -DLC_SHA2_512
endif
ifdef CONFIG_LEANCRYPTO_SHA3
ccflags-y	+= -DLC_SHA3
endif
ifdef CONFIG_LEANCRYPTO_KEM_KYBER
ccflags-y	+= -DLC_KYBER
endif
ifdef CONFIG_LEANCRYPTO_DILITHIUM
ccflags-y	+= -DLC_DILITHIUM
endif
ifdef CONFIG_LEANCRYPTO_DILITHIUM_ED25519
ccflags-y	+= -DLC_DILITHIUM_ED25519
endif
ifdef CONFIG_LEANCRYPTO_DILITHIUM_ED448
ccflags-y	+= -DLC_DILITHIUM_ED448
endif
ifdef CONFIG_LEANCRYPTO_SPHINCS
ccflags-y	+= -DLC_SPHINCS
endif
ifdef CONFIG_LEANCRYPTO_KEM_BIKE
ccflags-y	+= -DLC_BIKE
endif
ifdef CONFIG_LEANCRYPTO_KEM_HQC
ccflags-y	+= -DLC_HQC
endif
ifdef CONFIG_LEANCRYPTO_CURVE25519
ccflags-y	+= -DLC_CURVE25519
endif
ifdef CONFIG_LEANCRYPTO_CURVE448
ccflags-y	+= -DLC_CURVE448
endif

#
# The seeded RNG is always present
#
ccflags-y			+= -DLC_DRNG_PRESENT
