Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e28c190d authored by Gary R Hook's avatar Gary R Hook Committed by Herbert Xu
Browse files

csrypto: ccp - Expand RSA support for a v5 ccp



A version 5 CCP can handle an RSA modulus up to 16k bits.

Signed-off-by: default avatarGary R Hook <gary.hook@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent ceeec0af
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -60,6 +60,9 @@ static int ccp_rsa_complete(struct crypto_async_request *async_req, int ret)

static unsigned int ccp_rsa_maxsize(struct crypto_akcipher *tfm)
{
	if (ccp_version() > CCP_VERSION(3, 0))
		return CCP5_RSA_MAXMOD;
	else
		return CCP_RSA_MAXMOD;
}

+1 −0
Original line number Diff line number Diff line
@@ -255,6 +255,7 @@ struct ccp_rsa_req_ctx {
};

#define	CCP_RSA_MAXMOD	(4 * 1024 / 8)
#define	CCP5_RSA_MAXMOD	(16 * 1024 / 8)

/***** Common Context Structure *****/
struct ccp_ctx {
+1 −0
Original line number Diff line number Diff line
@@ -597,4 +597,5 @@ const struct ccp_vdata ccpv3 = {
	.setup = NULL,
	.perform = &ccp3_actions,
	.offset = 0x20000,
	.rsamax = CCP_RSA_MAX_WIDTH,
};
+2 −0
Original line number Diff line number Diff line
@@ -1112,6 +1112,7 @@ const struct ccp_vdata ccpv5a = {
	.setup = ccp5_config,
	.perform = &ccp5_actions,
	.offset = 0x0,
	.rsamax = CCP5_RSA_MAX_WIDTH,
};

const struct ccp_vdata ccpv5b = {
@@ -1120,4 +1121,5 @@ const struct ccp_vdata ccpv5b = {
	.setup = ccp5other_config,
	.perform = &ccp5_actions,
	.offset = 0x0,
	.rsamax = CCP5_RSA_MAX_WIDTH,
};
+1 −0
Original line number Diff line number Diff line
@@ -202,6 +202,7 @@
#define CCP_SHA_SB_COUNT		1

#define CCP_RSA_MAX_WIDTH		4096
#define CCP5_RSA_MAX_WIDTH		16384

#define CCP_PASSTHRU_BLOCKSIZE		256
#define CCP_PASSTHRU_MASKSIZE		32
Loading