Skip to content

Commit

Permalink
version 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lumley authored and gaborcsardi committed Jan 13, 2012
1 parent 86058a6 commit b0d3d32
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 15 deletions.
16 changes: 10 additions & 6 deletions DESCRIPTION
@@ -1,10 +1,14 @@
Package: randaes
Title: Random number generator based on AES cipher
Description: The deterministic part of the Fortuna cryptographic pseudorandom number generator, described by Scheier & Ferguson "Practical Cryptography"
Version: 0.1
Description: The deterministic part of the Fortuna cryptographic
pseudorandom number generator, described by Schneier & Ferguson
"Practical Cryptography"
Version: 0.3
Author: Thomas Lumley
Maintainer: Thomas Lumley <tlumley@u.washington.edu>
License: GPL 2
Depends:
Suggests:
Packaged: Fri Sep 9 18:42:52 2005; tlumley
License: GPL-2
Depends:
Suggests:
Packaged: 2012-01-13 01:22:39 UTC; tlum005
Repository: CRAN
Date/Publication: 2012-01-13 08:06:00
8 changes: 8 additions & 0 deletions MD5
@@ -0,0 +1,8 @@
a21c40f1ccca1456b4f517e3f1298857 *COPYRIGHTS
de001cb8468a3c06d07da76c9a612bc7 *DESCRIPTION
e45c6ce2be94f8389edb2eeb51ef1131 *NAMESPACE
6817936c964ac3652b64c7b3d10a185c *R/test.R
0a09ab0fcff2ea48e2cfc4e41a6e5686 *man/randaes.package.Rd
0817cfd8e7791f667a53297b00ea430a *src/aes.c
12398d282dd19894ed5548fc55fff7c4 *src/aes.h
37a225939830662cb96565a4f542f1a0 *src/raes.c
1 change: 1 addition & 0 deletions NAMESPACE
@@ -0,0 +1 @@
useDynLib(randaes)
3 changes: 0 additions & 3 deletions R/firstlib.R

This file was deleted.

2 changes: 2 additions & 0 deletions R/test.R
@@ -0,0 +1,2 @@
makeUseDynLibWork<-function() NULL

11 changes: 5 additions & 6 deletions src/raes.c
Expand Up @@ -74,13 +74,14 @@ static void fortuna_generate(int *result){
error("RAES not initialized");
reseed_counter[0]++;
aes_encrypt(ctx, (uint8 *) counter, (uint8 *) result);
if (reseed_counter[0] > 65536) {
if (reseed_counter[0] > 65535) {
/* Rekey after 2^20 bytes of output */
INC_COUNTER;
aes_encrypt(ctx, (uint8 *) counter, (uint8 *) newkey);
INC_COUNTER;
aes_encrypt(ctx, (uint8 *) counter, (uint8 *) (newkey+4));
aes_set_key(ctx, (uint8 *) key, 256);
memcpy(key,newkey,32);
aes_set_key(ctx, (uint8 *) key, 256);
reseed_counter[0]=0;
}

Expand Down Expand Up @@ -132,9 +133,6 @@ void fortuna_ints(int *n, int result[]){
}


#undef RANDOMSEED

#ifdef RANDOMSEED
int *user_unif_nseed(void){
return ((int *)(&seedlength));
}
Expand All @@ -154,4 +152,5 @@ void user_PutRNGState(void){
buffer=reseed_counter+1;
aes_set_key(ctx, (uint8 *) key, 256);
}
#endif


0 comments on commit b0d3d32

Please sign in to comment.