public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] crypto: Add akcipher interface without SGs
@ 2023-06-13  9:35 Herbert Xu
  2023-06-13  9:38 ` [PATCH 1/5] crypto: akcipher - Add sync interface without SG lists Herbert Xu
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Herbert Xu @ 2023-06-13  9:35 UTC (permalink / raw)
  To: Linus Torvalds, Roberto Sassu, David Howells, Eric Biggers,
	Stefan Berger, Mimi Zohar, dmitry.kasatkin, Jarkko Sakkinen,
	Ard Biesheuvel, keyrings, Linux Crypto Mailing List

The crypto akcipher interface has exactly one user, the keyring
subsystem.  That user only deals with kernel pointers, not SG lists.
Therefore the use of SG lists in the akcipher interface is
completely pointless.

As there is only one user, changing it isn't that hard.  This
patch series is a first step in that direction.  It introduces
a new interface for encryption and decryption without SG lists:

int crypto_akcipher_sync_encrypt(struct crypto_akcipher *tfm,
				 const void *src, unsigned int slen,
				 void *dst, unsigned int dlen);

int crypto_akcipher_sync_decrypt(struct crypto_akcipher *tfm,
				 const void *src, unsigned int slen,
				 void *dst, unsigned int dlen);

I've decided to split out signing and verification because most
(all but one) of our signature algorithms do not support encryption
or decryption.  These can now be accessed through the dsa interface:

int crypto_dsa_sign(struct crypto_dsa *tfm,
		    const void *src, unsigned int slen,
		    void *dst, unsigned int dlen);

int crypto_dsa_verify(struct crypto_dsa *tfm,
		      const void *src, unsigned int slen,
		      const void *digest, unsigned int dlen);

The keyring system has been converted to this interface.

The next step would be to convert the code within the Crypto API so
that SG lists are not used at all on the software path.  This
would eliminate the unnecessary copying that currently happens.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2023-06-29  4:49 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-13  9:35 [PATCH 0/5] crypto: Add akcipher interface without SGs Herbert Xu
2023-06-13  9:38 ` [PATCH 1/5] crypto: akcipher - Add sync interface without SG lists Herbert Xu
2023-06-13  9:38 ` [PATCH 2/5] crypto: dsa - Add interface for sign/verify Herbert Xu
2023-06-13  9:38 ` [PATCH 3/5] KEYS: Add forward declaration in asymmetric-parser.h Herbert Xu
2023-06-13  9:38 ` [PATCH 4/5] KEYS: asymmetric: Move sm2 code into x509_public_key Herbert Xu
2023-06-13 12:50   ` David Howells
2023-06-14 10:12     ` Herbert Xu
2023-06-13  9:38 ` [PATCH 5/5] KEYS: asymmetric: Use new crypto interface without scatterlists Herbert Xu
2023-06-13 12:53 ` [PATCH 0/5] crypto: Add akcipher interface without SGs David Howells
2023-06-14 10:10   ` Herbert Xu
2023-06-15 10:26   ` [v2 PATCH " Herbert Xu
2023-06-15 10:28     ` [PATCH 1/5] crypto: akcipher - Add sync interface without SG lists Herbert Xu
2023-06-15 10:28     ` [PATCH 2/5] crypto: sig - Add interface for sign/verify Herbert Xu
2023-06-15 10:28     ` [PATCH 3/5] KEYS: Add forward declaration in asymmetric-parser.h Herbert Xu
2023-06-15 10:28     ` [PATCH 4/5] KEYS: asymmetric: Move sm2 code into x509_public_key Herbert Xu
2023-06-15 10:28     ` [PATCH 5/5] KEYS: asymmetric: Use new crypto interface without scatterlists Herbert Xu
2023-06-26  9:21     ` [v2 PATCH 0/5] crypto: Add akcipher interface without SGs Ard Biesheuvel
2023-06-26  9:52       ` Herbert Xu
2023-06-26 10:03         ` Ard Biesheuvel
2023-06-26 10:13           ` Herbert Xu
2023-06-28  6:21             ` Eric Biggers
2023-06-28 16:58               ` Ard Biesheuvel
2023-06-28 17:33                 ` Eric Biggers
2023-06-28 17:44                   ` Ard Biesheuvel
2023-06-28 17:55                     ` Linus Torvalds
2023-06-28 18:34                       ` David Howells
2023-06-28 20:10                         ` Linus Torvalds
2023-06-29  4:49                           ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox