cipher_wrap: remove *setkey_dec_func in CIPHER_ENCRYPT_ONLY
There is no need to set decrypt key under CIPHER_ENCRYPT_ONLY,
so we can remove *setkey_dec_func from ctx to save extra code size.
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
diff --git a/library/cipher_wrap.h b/library/cipher_wrap.h
index c85a4ef..2cbc216 100644
--- a/library/cipher_wrap.h
+++ b/library/cipher_wrap.h
@@ -93,9 +93,11 @@
int (*setkey_enc_func)(void *ctx, const unsigned char *key,
unsigned int key_bitlen);
+#if !defined(MBEDTLS_CIPHER_ENCRYPT_ONLY)
/** Set key for decryption purposes */
int (*setkey_dec_func)(void *ctx, const unsigned char *key,
unsigned int key_bitlen);
+#endif
/** Allocate a new context */
void * (*ctx_alloc_func)(void);