diff mbox

[RFC,1/2] crypto: add PKE API

Message ID 5547C7F0.5010905@intel.com (mailing list archive)
State RFC
Headers show

Commit Message

Tadeusz Struk May 4, 2015, 7:26 p.m. UTC
On 05/02/2015 05:07 PM, Herbert Xu wrote:
>>>> > >>  #define CRYPTO_ALG_TYPE_AHASH		0x0000000a
>>>>> > >> > +#define CRYPTO_ALG_TYPE_PKE		0x0000000b
>>>>> > >> >  #define CRYPTO_ALG_TYPE_RNG		0x0000000c
>>> > > Will filling a hole cause a problem with something that got obsoleted?
>> > 
>> > I hope not. I checked as far back as 2.6.18 and I don't see any clash.
>> > Herbert, what do you think?
> Indeed you can't use this hole as it'll make you a hash algorithm.

So in this case isn't RNG a hash algorithm as well?
Anyway will something like this be ok with you:



--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Herbert Xu May 5, 2015, 1:33 a.m. UTC | #1
On Mon, May 04, 2015 at 12:26:40PM -0700, Tadeusz Struk wrote:
> 
> So in this case isn't RNG a hash algorithm as well?

No RNG is at 12 and HASH is 8-11.

> Anyway will something like this be ok with you:

This is unnecesary.  You can use 13/14 (d/e).

Cheers,
diff mbox

Patch

diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index ee14140..ac18cd3 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -41,7 +41,7 @@ 
 /*
  * Algorithm masks and types.
  */
-#define CRYPTO_ALG_TYPE_MASK           0x0000000f
+#define CRYPTO_ALG_TYPE_MASK           0xf000000f
 #define CRYPTO_ALG_TYPE_CIPHER         0x00000001
 #define CRYPTO_ALG_TYPE_COMPRESS       0x00000002
 #define CRYPTO_ALG_TYPE_AEAD           0x00000003
@@ -54,6 +54,7 @@ 
 #define CRYPTO_ALG_TYPE_AHASH          0x0000000a
 #define CRYPTO_ALG_TYPE_RNG            0x0000000c
 #define CRYPTO_ALG_TYPE_PCOMPRESS      0x0000000f
+#define CRYPTO_ALG_TYPE_PKE            0x10000001
 
 #define CRYPTO_ALG_TYPE_HASH_MASK      0x0000000e
 #define CRYPTO_ALG_TYPE_AHASH_MASK     0x0000000c