Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1035710AbdDUFrl (ORCPT ); Fri, 21 Apr 2017 01:47:41 -0400 Received: from mail-dm3nam03on0076.outbound.protection.outlook.com ([104.47.41.76]:12096 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1035656AbdDUFr3 (ORCPT ); Fri, 21 Apr 2017 01:47:29 -0400 Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cavium.com; From: George Cherian To: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: george.cherian@cavium.com, herbert@gondor.apana.org.au, davem@davemloft.net Subject: [PATCH 3/3] crypto: cavium: Add more algorithms Date: Fri, 21 Apr 2017 11:16:06 +0000 Message-Id: <1492773366-17899-4-git-send-email-george.cherian@cavium.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1492773366-17899-1-git-send-email-george.cherian@cavium.com> References: <1492773366-17899-1-git-send-email-george.cherian@cavium.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0063.INDPRD01.PROD.OUTLOOK.COM (10.164.136.163) To BLUPR0701MB1699.namprd07.prod.outlook.com (10.163.85.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a1b44e6f-b0d2-4454-65b2-08d48879e48a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:BLUPR0701MB1699; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1699;3:X5tM9aFVc1VtNFQZsxITPS9IQTFPBn69Kq6dlVGwWTKL/D3uK+QYMU25me7tgCvEOVRYZ7fBPn+pDd5KlR05o3AMVtbOPdgaehR4dEHjzVMgN3ZmJHnVNDZ0QXONrIuTD55SsDY7Z0jGEYyp9B2Mbm+MhlM7Kq1nj+fpdZ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yv8ItR+0wGrcqfW71tDejqo0iZaP5c/TkzvI8YXJPAVG5WoLcNCN8z6sSQkJam5tC09f914P2j1K1296hWLOK+iblnvBvsNL+WjKDtncy4P6pqVqP9cQ3VtDa2qqIyvbMdwHNGl8AC90L0pJFiHqz1FjBAFrwKY7Lxt6oAm4Fhp4DeW/Pd/c2ArvMSCeMSkSJNKIQ/f67aj91J8nHZjf3tbN0hONJOEWRE5jmu7lvcV9FksA0Ep39HFFA8cnGf+jHkv3rL9h8jpxkT+TsNhmqz2mt9ldycHTl9FTTeO5/+paLMBeagO4UL1hkDiHnyuc6xIMpkwbKqZP2MOasV4abm/dFqOyknh46AIGNIUVSW X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(6041248)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(6072148);SRVR:BLUPR0701MB1699;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1699; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1699;4:WBLNnppxekF05aRGxAryY6GpzUnOcFax2Q9k8KO2pJgqxmS3FLQ7Q8JlY1+7XotFj8GuSl4m+YbL8mO7XwPuXgE9QBWX99PRjAPRQfZgzB82wIlu7S6ohJGEg2X3nYpdEpwFyhypfttC+I+4oX+NDvmTDfWQz3Iv6xQLAFLbT9JZF+E+Bu1fam7NxsT7BG1AENXGQsMXpsbZjloPba6CYW9tFOtTO62MoiIgWN1JlNpSK0kTvh3NuKL5wU3jTlAig5y732kgJo45t7MZ4uvNoRAMGYsbEJVeq7gsPHVqmRzevWJ4P1mQhZnUNieYSbRIyZ0X63NgkUHA1tsmTVEPO5AkNyno/kfhcdm/zUfk8MzoO5GvzO3tvu1dvWDt210VoRsOGDLKAvH+9GFTF6vFdvHe9YxLT4VLYOA69V8FzFwYvsrTCg5vvDBMARjMFmPvTaVQQOU01lg9mPcXLe1JGwC2sgOQPH9rTcP2SJeyIb7XTbNEXVPrfI5NP2S9EciMh2pFuX+FZJAUFQy/VS3BAJwGwLxbRkdaktMjsZn5rTqtUwayZ2w4qcF7DwmMOiOPMM3mN7PGeJcYEAyzR/ym/prsP5HjLKpU29LotIPgppBAA9VOSmnyw0YSUe2ORUZSili/tPFw6xg9amdkRNLoetSbbYFHz4pNOzTsKLNlCzGhwF5LjyUxtrLdh1BvbRJcwVY/a/BwAp+oN631PhVl4Q== X-Forefront-PRVS: 02843AA9E0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(39840400002)(39850400002)(39400400002)(39410400002)(39450400003)(6506006)(8676002)(305945005)(42186005)(7736002)(48376002)(86362001)(189998001)(53936002)(53416004)(6486002)(3846002)(50466002)(6512007)(6116002)(50226002)(5009440100003)(36756003)(66066001)(6666003)(50986999)(5003940100001)(33646002)(2906002)(25786009)(2950100002)(76176999)(47776003)(5660300001)(4326008)(38730400002)(110136004);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1699;H:ubuntu.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR0701MB1699;23:x3nlJzv52tG9r+BhjZLlpcOXPt9jqXWCZ2P2rbF?= =?us-ascii?Q?WeDlSigux74+NpugQo41Da/kIJ78x9dYNwnhb38UgbZ18soEQyrD9ggrf84K?= =?us-ascii?Q?M96NuwwRRBJRTm6bdgAwL1roYcnrUDYbk0eNsGITjuxG5ldULIIPfwTsbrUS?= =?us-ascii?Q?2ayCdnH2fmV53Up3mX2UCMYZuBJlzD6+zjNFbAorp5IU6Gy3pE1xR//p6+zD?= =?us-ascii?Q?WcE8BDJKv75g0ewXthAggrUVtyWtNr/UH7XTxKw4teKbGX2MJePYTcWbvMXZ?= =?us-ascii?Q?+wsm+GM47jly+QsELApAri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riginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2017 05:47:25.7093 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1699 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2730 Lines: 91 Add more algorithm support for the driver. Add support for ecb(aes), cfb(aes) and ecb(des3_ede). Signed-off-by: George Cherian --- drivers/crypto/cavium/cpt/cptvf_algs.c | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/drivers/crypto/cavium/cpt/cptvf_algs.c b/drivers/crypto/cavium/cpt/cptvf_algs.c index c365fc6..b980d13 100644 --- a/drivers/crypto/cavium/cpt/cptvf_algs.c +++ b/drivers/crypto/cavium/cpt/cptvf_algs.c @@ -385,6 +385,48 @@ struct crypto_alg algs[] = { { .cra_module = THIS_MODULE, }, { .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct cvm_enc_ctx), + .cra_alignmask = 7, + .cra_priority = 4001, + .cra_name = "ecb(aes)", + .cra_driver_name = "cavium-ecb-aes", + .cra_type = &crypto_ablkcipher_type, + .cra_u = { + .ablkcipher = { + .ivsize = AES_BLOCK_SIZE, + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, + .setkey = cvm_enc_dec_setkey, + .encrypt = cvm_encrypt, + .decrypt = cvm_decrypt, + }, + }, + .cra_init = cvm_enc_dec_init, + .cra_module = THIS_MODULE, +}, { + .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct cvm_enc_ctx), + .cra_alignmask = 7, + .cra_priority = 4001, + .cra_name = "cfb(aes)", + .cra_driver_name = "cavium-cfb-aes", + .cra_type = &crypto_ablkcipher_type, + .cra_u = { + .ablkcipher = { + .ivsize = AES_BLOCK_SIZE, + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, + .setkey = cvm_enc_dec_setkey, + .encrypt = cvm_encrypt, + .decrypt = cvm_decrypt, + }, + }, + .cra_init = cvm_enc_dec_init, + .cra_module = THIS_MODULE, +}, { + .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, .cra_blocksize = DES3_EDE_BLOCK_SIZE, .cra_ctxsize = sizeof(struct cvm_des3_ctx), .cra_alignmask = 7, @@ -404,6 +446,27 @@ struct crypto_alg algs[] = { { }, .cra_init = cvm_enc_dec_init, .cra_module = THIS_MODULE, +}, { + .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, + .cra_blocksize = DES3_EDE_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct cvm_des3_ctx), + .cra_alignmask = 7, + .cra_priority = 4001, + .cra_name = "ecb(des3_ede)", + .cra_driver_name = "cavium-ecb-des3_ede", + .cra_type = &crypto_ablkcipher_type, + .cra_u = { + .ablkcipher = { + .min_keysize = DES3_EDE_KEY_SIZE, + .max_keysize = DES3_EDE_KEY_SIZE, + .ivsize = DES_BLOCK_SIZE, + .setkey = cvm_enc_dec_setkey, + .encrypt = cvm_encrypt, + .decrypt = cvm_decrypt, + }, + }, + .cra_init = cvm_enc_dec_init, + .cra_module = THIS_MODULE, } }; static inline int cav_register_algs(void) -- 2.1.4