diff options
author | Yicheng Li <yichengli@chromium.org> | 2019-07-24 17:38:23 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-07-26 20:49:01 +0000 |
commit | 30ab5997d7aed6c71943c9779544792695f4608f (patch) | |
tree | 9c3ce75fbde3e4f8f83a752f159a9553971614a5 /include/fpsensor_crypto.h | |
parent | 9ff89625dc098838a60ace547b2db4ebb27dee41 (diff) | |
download | chrome-ec-30ab5997d7aed6c71943c9779544792695f4608f.tar.gz |
fpsensor: Change crypto functions to return error code instead of result code
EC_RES_SUCCESS and EC_RES_ERROR are meant to be returned in EC command
handler to represent command result, so change crypto functions to
return EC_SUCCESS and EC error codes instead.
BRANCH=nocturne
BUG=none
TEST=make -j buildall
TEST=tested enrollment, matching, deletion and multifinger on
nocturne DUT
Change-Id: Ia98fa7469ab4e5dba00ede19dd34c5007d17b054
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715512
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Diffstat (limited to 'include/fpsensor_crypto.h')
-rw-r--r-- | include/fpsensor_crypto.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/fpsensor_crypto.h b/include/fpsensor_crypto.h index 26fe96a328..ebda41bcb9 100644 --- a/include/fpsensor_crypto.h +++ b/include/fpsensor_crypto.h @@ -13,7 +13,7 @@ * * @param outkey the pointer to buffer holding the output key. * @param salt the salt to use in HKDF. - * @return EC_RES_SUCCESS on success and EC_RES_ERROR otherwise. + * @return EC_SUCCESS on success and error code otherwise. */ int derive_encryption_key(uint8_t *out_key, const uint8_t *salt); @@ -29,7 +29,7 @@ int derive_encryption_key(uint8_t *out_key, const uint8_t *salt); * @param nonce_size the size of |nonce| in bytes. * @param tag the tag to hold the authenticator after encryption. * @param tag_size the size of |tag|. - * @return EC_RES_SUCCESS on success and EC_RES_ERROR otherwise. + * @return EC_SUCCESS on success and error code otherwise. */ int aes_gcm_encrypt(const uint8_t *key, int key_size, const uint8_t *plaintext, @@ -49,7 +49,7 @@ int aes_gcm_encrypt(const uint8_t *key, int key_size, * @param nonce_size the size of |nonce| in bytes. * @param tag the tag to compare against when decryption finishes. * @param tag_size the length of tag to compare against. - * @return EC_RES_SUCCESS on success and EC_RES_ERROR otherwise. + * @return EC_SUCCESS on success and error code otherwise. */ int aes_gcm_decrypt(const uint8_t *key, int key_size, uint8_t *plaintext, const uint8_t *ciphertext, int text_size, |