PSA crypto library makes big binary

Trying to build program for ARM Renesas RA6M1 controller with PSA Crypto API library. Looks like adding cryptography library to my project makes too big binary whe it is debug build. I need only little part of whole library functionality:

  • generate keys RSA 2048 Bit RSA PKCS #1 v2.2
  • sign and check signature functionality RSASSA-PKCS1-v1_5
  • encrypt functionality RSASSA-PKCS1-v1_5

I found file crypto_config.h that looks like configuration file that allows select what is needed. I’m right? But my Segger Embedded project does not includes this header. Why?

How to make binary smaller with crypto library configuration?

Content of crypto_config.h:

#ifndef PSA_CRYPTO_CONFIG_H
#define PSA_CRYPTO_CONFIG_H

#define PSA_WANT_ALG_DETERMINISTIC_ECDSA        1
#define PSA_WANT_ALG_ECDH                       1
#define PSA_WANT_ALG_ECDSA                      1
#define PSA_WANT_ALG_HKDF                       1
#define PSA_WANT_ALG_HMAC                       1
#define PSA_WANT_ALG_MD2                        1
#define PSA_WANT_ALG_MD4                        1
#define PSA_WANT_ALG_MD5                        1
#define PSA_WANT_ALG_RIPEMD160                  1
#define PSA_WANT_ALG_RSA_OAEP                   1
#define PSA_WANT_ALG_RSA_PKCS1V15_CRYPT         1
#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN          1
#define PSA_WANT_ALG_RSA_PSS                    1
#define PSA_WANT_ALG_SHA_1                      1
#define PSA_WANT_ALG_SHA_224                    1
#define PSA_WANT_ALG_SHA_256                    1
#define PSA_WANT_ALG_SHA_384                    1
#define PSA_WANT_ALG_SHA_512                    1
#define PSA_WANT_ALG_TLS12_PRF                  1
#define PSA_WANT_ALG_TLS12_PSK_TO_MS            1
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR          1
#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY        1
#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR          1
#define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY        1

#endif /* PSA_CRYPTO_CONFIG_H */