medfall

A super great game engine
Log | Files | Refs

commit a695a3ab706bf16ad9588c339f223fe1eb65dac5
parent 8bb38c433a084050325dc7f8648aa8d536a63bd9
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Mon Apr  3 00:09:09 +0300

Trim down genkeys a bit

Diffstat:
utils/genkeys/genkeys.cc | 26+++-----------------------
1 file changed, 3 insertions(+), 23 deletions(-)
diff --git a/utils/genkeys/genkeys.cc b/utils/genkeys/genkeys.cc @@ -8,23 +8,9 @@ int main( int argc, char ** argv ) { u8 secret_key[ 32 ]; - if( argc == 1 ) { - int ok = getentropy( secret_key, sizeof( secret_key ) ); - if( ok == -1 ) { - FATAL( "getentropy" ); - } - } - else if( argc == 2 ) { - size_t key_len; - u8 * key = file_get_contents( argv[ 1 ], &key_len ); - if( key_len != sizeof( secret_key ) ) { - FATAL( "secret key should be 32 bytes" ); - } - memcpy( secret_key, key, sizeof( secret_key ) ); - } - else { - fprintf( stderr, "usage: %s [path/to/secret_key]\n", argv[ 0 ] ); - return 1; + int ok = getentropy( secret_key, sizeof( secret_key ) ); + if( ok == -1 ) { + FATAL( "getentropy" ); } u8 public_key[ 32 ]; @@ -45,12 +31,6 @@ int main( int argc, char ** argv ) { printf( "\n};\n" ); - ggprint( "secret key: " ); - for( size_t i = 0; i < sizeof( secret_key ); i++ ) { - ggprint( "{02x}", secret_key[ i ] ); - } - ggprint( "\n" ); - printf( "const u8 secret_key[] = {" ); for( size_t i = 0; i < sizeof( secret_key ); i++ ) {