Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Tadeusz Struk <tadeusz.struk@intel.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	David Howells <dhowells@redhat.com>,
	linux-crypto@vger.kernel.org
Subject: Re: Proposal for adding setpubkey callback to akcipher_alg
Date: Mon, 03 Aug 2015 08:39:51 +0200	[thread overview]
Message-ID: <1704807.Rn4DsddD6R@tauon.atsec.com> (raw)
In-Reply-To: <905E1812-AD9B-4188-A668-3CD8985EA1BF@holtmann.org>

Am Sonntag, 2. August 2015, 22:28:33 schrieb Marcel Holtmann:

Hi Marcel,

>Hi Tadeusz,
>
>I think we need to split the akcipher_alg setkey callback into a setkey and
>setpubkey.
>
>diff --git a/include/crypto/akcipher.h b/include/crypto/akcipher.h
>index 69d163e39101..ca93952b6d19 100644
>--- a/include/crypto/akcipher.h
>+++ b/include/crypto/akcipher.h
>@@ -91,6 +91,8 @@ struct akcipher_alg {
>        int (*decrypt)(struct akcipher_request *req);
>        int (*setkey)(struct crypto_akcipher *tfm, const void *key,
>                      unsigned int keylen);
>+       int (*setpubkey)(struct crypto_akcipher *tfm, const void *key,
>+                        unsigned int keylen);
>        int (*init)(struct crypto_akcipher *tfm);
>        void (*exit)(struct crypto_akcipher *tfm);
>
>If the cipher actually uses two different formats for the public + private

The public key is n + e.

The private key is n + d.

Both are encoded in the BER structure the current API requires. It is 
perfectly valid to provide only n + e when you do public key operations.

Please see in the testmgr.h for the 2048 bit key test vector (i.e. the one 
with public_key_vec = true). The BER structure has nice comments from Tadeusz 
to indicate it only contains n and e without d.

Thus, I do not currently understand your request. May I ask you to give more 
explanation why the use of BER is insufficient?


Ciao
Stephan

  reply	other threads:[~2015-08-03  6:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03  5:28 Proposal for adding setpubkey callback to akcipher_alg Marcel Holtmann
2015-08-03  6:39 ` Stephan Mueller [this message]
2015-08-03  7:03   ` Marcel Holtmann
2015-08-03  7:15     ` Stephan Mueller
2015-08-03  7:25       ` Marcel Holtmann
2015-08-05  2:46         ` Herbert Xu
2015-08-05  4:02           ` Marcel Holtmann
2015-08-05  4:06             ` Herbert Xu
2015-08-05  4:33               ` Marcel Holtmann
2015-08-05  5:10                 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1704807.Rn4DsddD6R@tauon.atsec.com \
    --to=smueller@chronox.de \
    --cc=dhowells@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=tadeusz.struk@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox