Missing OpenSSL wrapper declarations
aes_icm_bytes_encrypted also lacked definition.
diff --git a/crypto/cipher/aes_icm_ossl.c b/crypto/cipher/aes_icm_ossl.c
index b2e3ce1..db3b944 100644
--- a/crypto/cipher/aes_icm_ossl.c
+++ b/crypto/cipher/aes_icm_ossl.c
@@ -221,12 +221,16 @@
* the salt is unpredictable (but not necessarily secret) data which
* randomizes the starting point in the keystream
*/
-err_status_t aes_icm_openssl_context_init (aes_icm_ctx_t *c, const uint8_t *key)
+err_status_t aes_icm_openssl_context_init (aes_icm_ctx_t *c, const uint8_t *key, int len)
{
/*
* set counter and initial values to 'offset' value, being careful not to
* go past the end of the key buffer
*/
+
+ if (c->key_size + SALT_SIZE != len)
+ return err_status_bad_param;
+
v128_set_to_zero(&c->counter);
v128_set_to_zero(&c->offset);
memcpy(&c->counter, key + c->key_size, SALT_SIZE);
@@ -325,6 +329,11 @@
return err_status_ok;
}
+uint16_t aes_icm_bytes_encrypted(aes_icm_ctx_t *c)
+{
+ return htons(c->counter.v16[7]);
+}
+
/*
* Name of this crypto engine
*/
diff --git a/crypto/include/aes_icm_ossl.h b/crypto/include/aes_icm_ossl.h
index 89da7e0..90ec954 100644
--- a/crypto/include/aes_icm_ossl.h
+++ b/crypto/include/aes_icm_ossl.h
@@ -67,6 +67,9 @@
} aes_icm_ctx_t;
err_status_t aes_icm_openssl_set_iv(aes_icm_ctx_t *c, void *iv, int dir);
+err_status_t aes_icm_openssl_context_init(aes_icm_ctx_t *c, const uint8_t *key, int len);
+err_status_t aes_icm_output(aes_icm_ctx_t *c, uint8_t *buffer, int num_octets_to_output);
+uint16_t aes_icm_bytes_encrypted(aes_icm_ctx_t *c);
#endif /* AES_ICM_H */