aboutsummaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-05-30 10:08:27 +0000
committerSimon Tatham <anakin@pobox.com>2005-05-30 10:08:27 +0000
commit6b9e690c89973e8e98de7dfc768849f0b8b411a0 (patch)
tree0e776c25e300419011d8f5be831de802148a65ac /random.c
parent0f423f0b3a0bfaaac37fa2dba23794629088836f (diff)
downloadpuzzles-6b9e690c89973e8e98de7dfc768849f0b8b411a0.zip
puzzles-6b9e690c89973e8e98de7dfc768849f0b8b411a0.tar.gz
puzzles-6b9e690c89973e8e98de7dfc768849f0b8b411a0.tar.bz2
puzzles-6b9e690c89973e8e98de7dfc768849f0b8b411a0.tar.xz
Initial checkin of my Minesweeper clone, which uses a solver during
grid generation to arrange a mine layout that never requires guessing. [originally from svn r5859]
Diffstat (limited to 'random.c')
-rw-r--r--random.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/random.c b/random.c
index 664b11c..d70dd00 100644
--- a/random.c
+++ b/random.c
@@ -15,15 +15,6 @@
#include "puzzles.h"
-typedef unsigned long uint32;
-
-typedef struct {
- uint32 h[5];
- unsigned char block[64];
- int blkused;
- uint32 lenhi, lenlo;
-} SHA_State;
-
/* ----------------------------------------------------------------------
* Core SHA algorithm: processes 16-word blocks into a message digest.
*/
@@ -108,14 +99,14 @@ static void SHATransform(uint32 * digest, uint32 * block)
* the end, and pass those blocks to the core SHA algorithm.
*/
-static void SHA_Init(SHA_State * s)
+void SHA_Init(SHA_State * s)
{
SHA_Core_Init(s->h);
s->blkused = 0;
s->lenhi = s->lenlo = 0;
}
-static void SHA_Bytes(SHA_State * s, void *p, int len)
+void SHA_Bytes(SHA_State * s, void *p, int len)
{
unsigned char *q = (unsigned char *) p;
uint32 wordblock[16];
@@ -158,7 +149,7 @@ static void SHA_Bytes(SHA_State * s, void *p, int len)
}
}
-static void SHA_Final(SHA_State * s, unsigned char *output)
+void SHA_Final(SHA_State * s, unsigned char *output)
{
int i;
int pad;
@@ -196,7 +187,7 @@ static void SHA_Final(SHA_State * s, unsigned char *output)
}
}
-static void SHA_Simple(void *p, int len, unsigned char *output)
+void SHA_Simple(void *p, int len, unsigned char *output)
{
SHA_State s;