Skip to content

Commit

Permalink
drivers: crypto: generic resources for crypto device driver - RSA
Browse files Browse the repository at this point in the history
TEE Crypto generic APIs to HW driver interface

Signed-off-by: Cedric Neveux <[email protected]>
Acked-by: Jens Wiklander <[email protected]>
  • Loading branch information
cneveux authored and jforissier committed Feb 28, 2020
1 parent 8d02ec6 commit f5a70e3
Show file tree
Hide file tree
Showing 16 changed files with 1,971 additions and 6 deletions.
4 changes: 3 additions & 1 deletion core/arch/arm/plat-imx/conf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ $(call force,CFG_IMX_CAAM,n)
# it with generic crypto API can be enabled.
CFG_CRYPTO_DRIVER ?= y
# Crypto Driver Debug
CFG_CRYPTO_DRIVER_DEBUG ?= n
# DRV_DBG_TRACE BIT32(0) // Driver trace
# DRV_DBG_BUF BIT32(1) // Driver dump Buffer
CFG_CRYPTO_DRIVER_DEBUG ?= 0
else
$(call force,CFG_CRYPTO_DRIVER,n)
$(call force,CFG_WITH_SOFTWARE_PRNG,y)
Expand Down
34 changes: 34 additions & 0 deletions core/drivers/crypto/crypto_api/acipher/local.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright 2018-2020 NXP
*
* Definition of the functions shared locally.
*/
#ifndef __LOCAL_H__
#define __LOCAL_H__

#include <drvcrypt_acipher.h>

/*
* Mask Generation function. Use a Hash operation
* to generate an output @mask from a input @seed
*
* @mgf_data [in/out] MGF data
*/
TEE_Result drvcrypt_rsa_mgf1(struct drvcrypt_rsa_mgf *mgf_data);

/*
* PKCS#1 - Signature of RSA message and encodes the signature.
*
* @ssa_data [in/out] RSA data to sign / Signature
*/
TEE_Result drvcrypt_rsassa_sign(struct drvcrypt_rsa_ssa *ssa_data);

/*
* PKCS#1 - Verification the encoded signature of RSA message.
*
* @ssa_data RSA Encoded signature data
*/
TEE_Result drvcrypt_rsassa_verify(struct drvcrypt_rsa_ssa *ssa_data);

#endif /* __LOCAL_H__ */
Loading

2 comments on commit f5a70e3

@Zephyrus29
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hash_oid.c is missing an include.

TEE_ALG_GET_MAIN_ALG cannot be found, utee_defines.h needs to be included

@jforissier
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hash_oid.c is missing an include.

TEE_ALG_GET_MAIN_ALG cannot be found, utee_defines.h needs to be included

Patch welcome

Please sign in to comment.