aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-10-23 14:43:43 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-10-23 14:43:43 +0000
commit7156f2c323f5b4d6a3f9eec7673b0b1680fb8ff9 (patch)
tree759246e8d5beac64e8acafcb5e5e37903b907f69 /os/hal/include
parent7707340e0b2e9e6552378d1520993686856f8134 (diff)
downloadChibiOS-7156f2c323f5b4d6a3f9eec7673b0b1680fb8ff9.tar.gz
ChibiOS-7156f2c323f5b4d6a3f9eec7673b0b1680fb8ff9.tar.bz2
ChibiOS-7156f2c323f5b4d6a3f9eec7673b0b1680fb8ff9.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10888 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r--os/hal/include/hal_crypto.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/os/hal/include/hal_crypto.h b/os/hal/include/hal_crypto.h
index 433953e45..8836dafd5 100644
--- a/os/hal/include/hal_crypto.h
+++ b/os/hal/include/hal_crypto.h
@@ -95,8 +95,7 @@ typedef enum {
CRY_ERR_INV_ALGO = 1, /**< Invalid cypher/mode. */
CRY_ERR_INV_KEY_SIZE = 2, /**< Invalid key size. */
CRY_ERR_INV_KEY_TYPE = 3, /**< Invalid key type. */
- CRY_ERR_INV_KEY_ID = 4, /**< Invalid key type. */
- CRY_ERR_AUTH_FAILED = 5 /**< Authentication failed. */
+ CRY_ERR_INV_KEY_ID = 4 /**< Invalid key type. */
} cryerror_t;
/**
@@ -120,6 +119,7 @@ typedef enum {
#define CRY_LLD_SUPPORTS_AES_CBC FALSE
#define CRY_LLD_SUPPORTS_AES_CFB FALSE
#define CRY_LLD_SUPPORTS_AES_CTR FALSE
+#define CRY_LLD_SUPPORTS_AES_GCM FALSE
typedef uint_fast8_t crykey_t;
@@ -141,8 +141,9 @@ struct CRYDriver {
#if !defined(CRY_LLD_SUPPORTS_AES_ECB) || \
!defined(CRY_LLD_SUPPORTS_AES_CBC) || \
!defined(CRY_LLD_SUPPORTS_AES_CFB) || \
- !defined(CRY_LLD_SUPPORTS_AES_CTR)
-#error "CRYPTO LLD does not export required switches"
+ !defined(CRY_LLD_SUPPORTS_AES_CTR) || \
+ !defined(CRY_LLD_SUPPORTS_AES_GCM)
+#error "CRYPTO LLD does not export the required switches"
#endif
/*===========================================================================*/
@@ -209,33 +210,31 @@ extern "C" {
size_t size,
const uint8_t *in,
uint8_t *out,
- const uint8_t *nonce,
- uint8_t *cnt);
+ const uint8_t *iv);
cryerror_t cryDecryptAES_CTR(CRYDriver *cryp,
crykey_t key_id,
size_t size,
const uint8_t *in,
uint8_t *out,
- const uint8_t *nonce,
- uint8_t *cnt);
+ const uint8_t *iv);
cryerror_t cryEncryptAES_GCM(CRYDriver *cryp,
crykey_t key_id,
- bitsize_t size,
+ size_t size,
const uint8_t *in,
uint8_t *out,
- bitsize_t ivsize,
const uint8_t *iv,
- bitsize_t authsize,
- uint8_t *authout);
+ size_t aadsize,
+ const uint8_t *aad,
+ uint8_t *authtag);
cryerror_t cryDecryptAES_GCM(CRYDriver *cryp,
crykey_t key_id,
- bitsize_t size,
+ size_t size,
const uint8_t *in,
uint8_t *out,
- bitsize_t ivsize,
const uint8_t *iv,
- bitsize_t authsize,
- const uint8_t *authin);
+ size_t aadsize,
+ const uint8_t *aad,
+ uint8_t *authtag);
#ifdef __cplusplus
}
#endif