Linux cryptographic layer development
 help / color / mirror / Atom feed
* akcipher: continuous memory for input/output
@ 2015-07-08 15:27 Stephan Mueller
  2015-07-08 15:29 ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Stephan Mueller @ 2015-07-08 15:27 UTC (permalink / raw)
  To: Tadeusz Struk, Herbert Xu; +Cc: linux-crypto

Hi Herbert, Tadeusz,

I looked a bit further into the akcipher code to see how we can add an AF_ALG 
there.

What currently wonders me is the akcipher_request_set_crypt function: the 
memory for input/output buffers is *no* scatter list but a plain buffer. I 
think I can understand that for raw RSA operations as the input/output is not 
overly large.

But according to Tadeusz it may be viable to register hybrid asym ciphers with 
the akcipher API. If there is a full blown hybrid asym cipher we have to 
handle potentially large chunks of data. I am now wondering whether a flat 
buffer still makes sense or whether the akcipher should be converted to 
scatter lists as all the other cipher types.

If it shall stay as is, how would we be handling larger buffers?

Thanks
Stephan

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

* Re: akcipher: continuous memory for input/output
  2015-07-08 15:27 akcipher: continuous memory for input/output Stephan Mueller
@ 2015-07-08 15:29 ` Herbert Xu
  2015-07-08 15:54   ` Stephan Mueller
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2015-07-08 15:29 UTC (permalink / raw)
  To: Stephan Mueller; +Cc: Tadeusz Struk, linux-crypto

On Wed, Jul 08, 2015 at 05:27:15PM +0200, Stephan Mueller wrote:
> 
> But according to Tadeusz it may be viable to register hybrid asym ciphers with 
> the akcipher API. If there is a full blown hybrid asym cipher we have to 
> handle potentially large chunks of data. I am now wondering whether a flat 
> buffer still makes sense or whether the akcipher should be converted to 
> scatter lists as all the other cipher types.
> 
> If it shall stay as is, how would we be handling larger buffers?

What is a hybrid cipher and why would we want to have it in the
kernel?

Cheers,
-- 
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] 4+ messages in thread

* Re: akcipher: continuous memory for input/output
  2015-07-08 15:29 ` Herbert Xu
@ 2015-07-08 15:54   ` Stephan Mueller
  2015-07-10 13:36     ` Herbert Xu
  0 siblings, 1 reply; 4+ messages in thread
From: Stephan Mueller @ 2015-07-08 15:54 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Tadeusz Struk, linux-crypto

Am Mittwoch, 8. Juli 2015, 23:29:32 schrieb Herbert Xu:

Hi Herbert,

>On Wed, Jul 08, 2015 at 05:27:15PM +0200, Stephan Mueller wrote:
>> But according to Tadeusz it may be viable to register hybrid asym ciphers
>> with the akcipher API. If there is a full blown hybrid asym cipher we have
>> to handle potentially large chunks of data. I am now wondering whether a
>> flat buffer still makes sense or whether the akcipher should be converted
>> to scatter lists as all the other cipher types.
>> 
>> If it shall stay as is, how would we be handling larger buffers?
>
>What is a hybrid cipher and why would we want to have it in the
>kernel?

Please consider the thread from June 25 between Tadeusz and me. With hybrid 
cipher, I am referring to the asym + sym cipher combo to implement a "real" 
complete asymmetric encryption/decryption. Or I am referring to the asym + 
hash combo to implement a "real" signature generation/verification.

Tadeusz' rsa.c implements the raw RSA modular exponentiation operation. But 
that does not make a usable encryption or signature operation. For example, 
the kernel module signature verification illustrates that very nicely:

mod_verify_sig():
...
	/* hash the code */
        pks = mod_make_digest(ms.hash, mod, modlen);
...
	/* RSA verify the hash */
	ret = verify_signature(key, pks);

What I am wondering is that whether such hybrid operation (hash+asym or 
sym+asym) may be entirely implemented in hardware. If you tell me that this 
will never be the case, I will stop asking and would be happy with the plain 
buffer. :-)

But IIRC, there are systems out there which perform a full hybrid asym 
operation. Without having checked in detail, I believe this is true for IBM 
cryptoexpress or Cavium cards.


The reason for having it in the kernel is what Tadeusz describes: the kernel 
does not need asym operations. But the hardware is only accessible from kernel 
space. With this, the kernel crypto API together with a yet to be written 
AF_ALG akcipher would make the asym hardware available to user space.

Ciao
Stephan

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

* Re: akcipher: continuous memory for input/output
  2015-07-08 15:54   ` Stephan Mueller
@ 2015-07-10 13:36     ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2015-07-10 13:36 UTC (permalink / raw)
  To: Stephan Mueller; +Cc: Tadeusz Struk, linux-crypto

On Wed, Jul 08, 2015 at 05:54:35PM +0200, Stephan Mueller wrote:
>
> But IIRC, there are systems out there which perform a full hybrid asym 
> operation. Without having checked in detail, I believe this is true for IBM 
> cryptoexpress or Cavium cards.

Such systems won't be using the akcipher interface even if we
decided to support them.  As akcipher is only meant to support
the underlying cipher, not the whole system.

Cheers,
-- 
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] 4+ messages in thread

end of thread, other threads:[~2015-07-10 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 15:27 akcipher: continuous memory for input/output Stephan Mueller
2015-07-08 15:29 ` Herbert Xu
2015-07-08 15:54   ` Stephan Mueller
2015-07-10 13:36     ` Herbert Xu

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