3333#include  "crypto/random/gnb_random.h" 
3434#include  "ed25519/ed25519.h" 
3535
36+ 
37+ #ifndef  GNB_SKIP_BUILD_TIME 
38+ #define  GNB_BUILD_STRING   "Build Time ["__DATE__","__TIME__"]"
39+ #else 
40+ #define  GNB_BUILD_STRING   "Build Time [Hidden]"
41+ #endif 
42+ 
43+ 
3644static  void  show_useage (int  argc ,char  * argv []){
3745
38-     printf ("Build[%s %s] \n" , __DATE__ ,  __TIME__ );
46+     printf ("%s \n" , GNB_BUILD_STRING );
3947
4048    printf ("usage: %s -c -p private_key_file -k public_key_file\n" ,argv [0 ]);
4149    printf ("example:\n" );
@@ -68,13 +76,14 @@ static void create_keypair(uint32_t uuid32, const char *private_key_file, const
6876    public_file_fd  =  open (public_key_file , O_WRONLY |O_CREAT ,S_IRUSR |S_IWUSR );
6977
7078    if  ( -1  ==  public_file_fd  ) {
79+         perror ("create public key file" );
7180        exit (0 );
7281    }
7382
7483    wlen  =  write (public_file_fd ,hex_string ,64 );
7584
7685    if  ( -1  ==  wlen  ) {
77-         perror ("write public_file " );
86+         perror ("write public key file " );
7887    }
7988
8089    close (public_file_fd );
@@ -84,13 +93,14 @@ static void create_keypair(uint32_t uuid32, const char *private_key_file, const
8493    private_file_fd  =  open (private_key_file , O_WRONLY |O_CREAT ,S_IRUSR |S_IWUSR );
8594
8695    if  ( -1  ==  private_file_fd  ) {
96+         perror ("create private key file" );
8797        exit (0 );
8898    }
8999
90100    wlen  =  write (private_file_fd ,hex_string ,128 );
91101
92102    if  ( -1  ==  wlen  ) {
93-         perror ("write private_file " );
103+         perror ("write private key file " );
94104    }
95105
96106    close (private_file_fd );
@@ -159,7 +169,3 @@ int main (int argc,char *argv[]){
159169    return  0 ;
160170
161171}
162- 
163- /* 
164- ./gnb_crypto -c -p 1010.private -k 1010.public 
165- */ 
0 commit comments