Skip to contentSkip to conversation

crypto: implement new prng, Vegard's PRNG

PATCH In review Vegard Nossum 2 participants 2 messages Feb 25, 2009 – Mar 27, 2009 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: implement new prng, Vegard's PRNG

Quoted 1 line

From 0dea4a79c856eb5d0897fa3c83fd7b4aa1b5150f Mon Sep 17 00:00:00 2001

From: Vegard Nossum <[email protected]>
Date: Fri, 23 Jan 2009 20:17:08 +0100
Subject: [PATCH] crypto: implement new prng, Vegard's PRNG

Hi,

I realize that submitting a non-cryptographically secure algorithm to a crypto mailing list might not make too much sense. On the other hand, it shouldn't hurt either, and I've written this, so why not? I don't know if this is actually useful for anything at all, so this patch is more of an "it exists" rather than a serious patch submission.

The only obvious property of this algorithm is its fixed, known sequence period.

(Note: I didn't actually test the code either, so it could all be wrong.)

---
 crypto/Kconfig  |    7 ++
 crypto/Makefile |    1 +
 crypto/vprng.c  |  179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 187 insertions(+), 0 deletions(-)
 create mode 100644 crypto/vprng.c
crypto/Kconfig +7 -0
index 8dde4fc..e31c97d 100644
@@ -734,6 +734,13 @@ config CRYPTO_ANSI_CPRNG
 	  for cryptographic modules.  Uses the Algorithm specified in
 	  ANSI X9.31 A.2.4
 
+config CRYPTO_VPRNG
+	tristate "Vegard's Pseudo-Random Number Generator"
+	select CRYPTO_RNG
+	help
+	  A very simple PRNG. WARNING: This algorithm is not
+	  cryptographically secure!
+
 source "drivers/crypto/Kconfig"
 
 endif	# if CRYPTO
crypto/Makefile +1 -0
index 46b08bf..417b197 100644
@@ -77,6 +77,7 @@ obj-$(CONFIG_CRYPTO_LZO) += lzo.o
 obj-$(CONFIG_CRYPTO_RNG2) += rng.o
 obj-$(CONFIG_CRYPTO_RNG2) += krng.o
 obj-$(CONFIG_CRYPTO_ANSI_CPRNG) += ansi_cprng.o
+obj-$(CONFIG_CRYPTO_VPRNG) += vprng.o
 obj-$(CONFIG_CRYPTO_TEST) += tcrypt.o
 
 #
crypto/vprng.c new file +179 -0

179 lines not on this page · raw message

Signature · 1 line
1.6.0.6
maintainer
#1 lore raw
Quoted 7 lines · Vegard Nossum

I realize that submitting a non-cryptographically secure algorithm to a crypto mailing list might not make too much sense. On the other hand, it shouldn't hurt either, and I've written this, so why not? I don't know if this is actually useful for anything at all, so this patch is more of an "it exists" rather than a serious patch submission.

Quoted 6 lines

The only obvious property of this algorithm is its fixed, known sequence period.

(Note: I didn't actually test the code either, so it could all be wrong.)

If we actually had an in-kernel user for this then I'd be more than happy to add this :)

Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt