Skip to content

Commit 1ca492c

Browse files
kaleb-himesJacobBarthelmeh
authored andcommitted
full API updates to reflect design change
1 parent 443f684 commit 1ca492c

36 files changed

+279
-281
lines changed

Makefile.am

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ EXTRA_DIST+= tests
3232
EXTRA_DIST+= manpages
3333
EXTRA_DIST+= README.md
3434

35-
man_MANS+= manpages/wolfsslBenchmark.1
36-
man_MANS+= manpages/wolfsslDecrypt.1
37-
man_MANS+= manpages/wolfsslEncrypt.1
38-
man_MANS+= manpages/wolfsslHash.1
39-
man_MANS+= manpages/wolfsslMain.1
35+
man_MANS+= manpages/wolfCLU_benchmark.1
36+
man_MANS+= manpages/wolfCLU_decrypt.1
37+
man_MANS+= manpages/wolfCLU_encrypt.1
38+
man_MANS+= manpages/wolfCLU_hash.1
39+
man_MANS+= manpages/wolfssl.1
4040

4141
include clu_src/include.am
4242
include clu_include/include.am

clu_include/clu_header_main.h

+28-28
Original file line numberDiff line numberDiff line change
@@ -94,53 +94,53 @@
9494
*
9595
* @param argc holds all command line input
9696
* @param argv each holds one value from the command line input
97-
* @param action forwarded from wolfsslMain (-e, -d, -h, or -b)
97+
* @param action forwarded from wolfCLU_main (-e, -d, -h, or -b)
9898
*/
99-
int wolfsslSetup(int argc, char** argv, char action);
99+
int wolfCLU_setup(int argc, char** argv, char action);
100100

101101
/* hash argument function
102102
*
103103
* @param argc holds all command line input
104104
* @param argv each holds one value from the command line input
105105
*/
106-
int wolfsslHashSetup(int argc, char** argv);
106+
int wolfCLU_hashSetup(int argc, char** argv);
107107

108108
/* benchmark argument function
109109
*
110110
* @param argc holds all command line input
111111
* @param argv each holds one value from the command line input
112112
*/
113-
int wolfsslBenchSetup(int argc, char** argv);
113+
int wolfCLU_benchSetup(int argc, char** argv);
114114

115115
/*
116116
* generic help function
117117
*/
118-
void wolfsslHelp(void);
118+
void wolfCLU_help(void);
119119

120120
/*
121121
* verbose help function
122122
*/
123-
void wolfsslVerboseHelp(void);
123+
void wolfCLU_verboseHelp(void);
124124

125125
/*
126126
* encrypt help function
127127
*/
128-
void wolfsslEncryptHelp(void);
128+
void wolfCLU_encryptHelp(void);
129129

130130
/*
131131
* decrypt help function
132132
*/
133-
void wolfsslDecryptHelp(void);
133+
void wolfCLU_decryptHelp(void);
134134

135135
/*
136136
* hash help function
137137
*/
138-
void wolfsslHashHelp(void);
138+
void wolfCLU_hashHelp(void);
139139

140140
/*
141141
* benchmark help function
142142
*/
143-
void wolfsslBenchHelp(void);
143+
void wolfCLU_benchHelp(void);
144144

145145
/* find algorithm for encryption/decryption
146146
*
@@ -149,40 +149,40 @@ void wolfsslBenchHelp(void);
149149
* @param mode the mode as set by the user (cbc or ctr)
150150
* @param size set based on the algorithm specified
151151
*/
152-
int wolfsslGetAlgo(char* name, char** alg, char** mode, int* size);
152+
int wolfCLU_getAlgo(char* name, char** alg, char** mode, int* size);
153153

154154
/* generates key based on password provided
155155
*
156156
* @param rng the random number generator
157157
* @param pwdKey the password based key as provided by the user
158-
* @param size size as determined by wolfsslGetAlgo
158+
* @param size size as determined by wolfCLU_GetAlgo
159159
* @param salt the buffer to store the resulting salt after it's generated
160160
* @param pad a flag to let us know if there are padded bytes or not
161161
*/
162-
int wolfsslGenKey(RNG* rng, byte* pwdKey, int size, byte* salt, int pad);
162+
int wolfCLU_genKey(RNG* rng, byte* pwdKey, int size, byte* salt, int pad);
163163

164164
/* secure entry of password
165165
*
166166
* @param pwdKey the password provide by the user
167-
* @param size the size as determnined by wolfsslGetAlgo
167+
* @param size the size as determnined by wolfCLU_GetAlgo
168168
*/
169-
int wolfsslNoEcho(char* pwdKey, int size);
169+
int wolfCLU_noEcho(char* pwdKey, int size);
170170

171171
/* adds characters to end of string
172172
*
173173
* @param s the char array we'll be appending to
174174
* @param c the char that will be appended to s
175175
*/
176-
void wolfsslAppend(char* s, char c);
176+
void wolfCLU_append(char* s, char c);
177177

178178
/* interrupt function
179179
*
180180
* @param signo gets type cast to void, interrupts the loop.
181181
*/
182-
void wolfsslStop(int signo);
182+
void wolfCLU_stop(int signo);
183183

184184
/* finds current time during runtime */
185-
double wolfsslGetTime(void);
185+
double wolfCLU_getTime(void);
186186

187187
/* A function to convert from Hex to Binary
188188
*
@@ -199,7 +199,7 @@ double wolfsslGetTime(void);
199199
* @param b3Sz a word32 that will be set after conversion of b3, can be NULL
200200
* @param b4Sz a word32 that will be set after conversion of b4, can be NULL
201201
*/
202-
int wolfsslHexToBin(const char* h1, byte** b1, word32* b1Sz,
202+
int wolfCLU_hexToBin(const char* h1, byte** b1, word32* b1Sz,
203203
const char* h2, byte** b2, word32* b2Sz,
204204
const char* h3, byte** b3, word32* b3Sz,
205205
const char* h4, byte** b4, word32* b4Sz);
@@ -212,14 +212,14 @@ int wolfsslHexToBin(const char* h1, byte** b1, word32* b1Sz,
212212
* @param b4 a buffer to be freed, can be set to NULL
213213
* @param b5 a buffer to be freed, can be set to NULL
214214
*/
215-
void wolfsslFreeBins(byte* b1, byte* b2, byte* b3, byte* b4, byte* b5);
215+
void wolfCLU_freeBins(byte* b1, byte* b2, byte* b3, byte* b4, byte* b5);
216216

217217
/* function to display stats results from benchmark
218218
*
219219
* @param start the time when the benchmark was started
220220
* @param blockSize the block size of the algorithm being benchmarked
221221
*/
222-
void wolfsslStats(double start, int blockSize, int64_t blocks);
222+
void wolfCLU_stats(double start, int blockSize, int64_t blocks);
223223

224224
/* encryption function
225225
*
@@ -230,15 +230,15 @@ void wolfsslStats(double start, int blockSize, int64_t blocks);
230230
* @param pwdKey this is the user provided password to be used as the key
231231
* @param key if entered must be in hex, can be used to verify encryption with
232232
* nist test vectors.
233-
* @param size this is set by wolfsslGetAlgo and is used to stretch the password
233+
* @param size this is set by wolfCLU_GetAlgo and is used to stretch the password
234234
* @param in the filename or user input from command line
235235
* @param out the filename to output following en/de cryption
236236
* @param iv if entered must be in hex otherwise generated at run time
237237
* @param block size of block as determined by the algorithm being used
238238
* @param ivCheck a flag if user inputs a specific IV
239239
* @param inputHex a flag to specify encrypting hex data, instead of byte data
240240
*/
241-
int wolfsslEncrypt(char* alg, char* mode, byte* pwdKey, byte* key, int size,
241+
int wolfCLU_encrypt(char* alg, char* mode, byte* pwdKey, byte* key, int size,
242242
char* in, char* out, byte* iv, int block,
243243
int ivCheck, int inputHex);
244244

@@ -251,23 +251,23 @@ int wolfsslEncrypt(char* alg, char* mode, byte* pwdKey, byte* key, int size,
251251
* @param pwdKey this is the user provided password to be used as the key
252252
* @param key if entered must be in hex, can be used to verify encryption with
253253
* nist test vectors.
254-
* @param size this is set by wolfsslGetAlgo and is used to stretch the password
254+
* @param size this is set by wolfCLU_GetAlgo and is used to stretch the password
255255
* @param in the filename or user input from command line
256256
* @param out the filename to output following en/de cryption
257257
* @param iv if entered must be in hex otherwise generated at run time
258258
* @param block size of block as determined by the algorithm being used
259259
* @param keyType let's decrypt know if it's using a password based key or a
260260
* hexidecimal, user specified key.
261261
*/
262-
int wolfsslDecrypt(char* alg, char* mode, byte* pwdKey, byte* key, int size,
262+
int wolfCLU_decrypt(char* alg, char* mode, byte* pwdKey, byte* key, int size,
263263
char* in, char* out, byte* iv, int block, int keyType);
264264

265265
/* benchmarking function
266266
*
267267
* @param timer a timer to be started and stopped for benchmarking purposes
268268
* @param option a flag to allow benchmark execution
269269
*/
270-
int wolfsslBenchmark(int timer, int* option);
270+
int wolfCLU_benchmark(int timer, int* option);
271271

272272
/* hashing function
273273
*
@@ -277,11 +277,11 @@ int wolfsslBenchmark(int timer, int* option);
277277
* @param alg
278278
* @param size
279279
*/
280-
int wolfsslHash(char* in, char* out, char* alg, int size);
280+
int wolfCLU_hash(char* in, char* out, char* alg, int size);
281281
/*
282282
* get the current Version
283283
*/
284-
void wolfsslVersion(void);
284+
void wolfCLU_version(void);
285285
#endif
286286

287287
#endif /* _WOLFSSL_CLU_HEADER_ */

clu_include/x509/clu_cert.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
#include <wolfssl/wolfcrypt/error-crypt.h>
2424

2525
/* handles incoming arguments for certificate generation */
26-
int wolfsslCertSetup(int argc, char** argv);
26+
int wolfCLU_certSetup(int argc, char** argv);
2727

2828
/* print help info */
29-
void wolfsslCertHelp();
29+
void wolfCLU_certHelp();
3030

3131
/* check for user input errors */
3232
int error_check(int inpem_flag, int inder_flag, int outpem_flag,

clu_include/x509/clu_parse.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
*/
2121

2222
/* a helper function for wolfCLU_parse_file */
23-
int wolfCLU_inpem_outpem(char* infile, char* outfile, int silent_flag);
23+
int wolfCLU_inpemOutpem(char* infile, char* outfile, int silent_flag);
2424
/* a helper function for wolfCLU_parse_file */
25-
int wolfCLU_inpem_outder(char* infile, char* outfile, int silent_flag);
25+
int wolfCLU_inpemOutder(char* infile, char* outfile, int silent_flag);
2626
/* a helper function for wolfCLU_parse_file */
27-
int wolfCLU_inder_outpem(char* infile, char* outfile, int silent_flag);
27+
int wolfCLU_inderOutpem(char* infile, char* outfile, int silent_flag);
2828
/* a helper function for wolfCLU_parse_file */
29-
int wolfCLU_inder_outder(char* infile, char* outfile, int silent_flag);
29+
int wolfCLU_inderOutder(char* infile, char* outfile, int silent_flag);
3030
/* function for processing input/output based on format requests from user */
31-
int wolfCLU_parse_file(char* infile, int inform, char* outfile, int outform,
31+
int wolfCLU_parseFile(char* infile, int inform, char* outfile, int outform,
3232
int silent_flag);

clu_include/x509/clu_request.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
*/
2121

2222
/* handles incoming arguments for certificate requests */
23-
int wolfsslRequestSetup(int argc, char** argv);
23+
int wolfCLU_requestSetup(int argc, char** argv);
2424

2525

clu_src/benchmark/clu_bench_setup.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include "clu_include/clu_header_main.h"
2323

24-
int wolfsslBenchSetup(int argc, char** argv)
24+
int wolfCLU_benchSetup(int argc, char** argv)
2525
{
2626
int ret = 0; /* return variable */
2727
int time = 3; /* timer variable */
@@ -65,7 +65,7 @@ int wolfsslBenchSetup(int argc, char** argv)
6565
for (i = 2; i < argc; i++) {
6666
if (XSTRNCMP(argv[i], "-help", 5) == 0) {
6767
/* help checking */
68-
wolfsslBenchHelp();
68+
wolfCLU_benchHelp();
6969
return 0;
7070
}
7171
for (j = 0; j < (int) sizeof(algs)/(int) sizeof(algs[0]); j++) {
@@ -95,12 +95,12 @@ int wolfsslBenchSetup(int argc, char** argv)
9595
}
9696
if (optionCheck != 1) {
9797
/* help checking */
98-
wolfsslHelp();
98+
wolfCLU_help();
9999
}
100100
else {
101101
/* benchmarking function */
102102
printf("\nTesting for %d second(s)\n", time);
103-
ret = wolfsslBenchmark(time, option);
103+
ret = wolfCLU_benchmark(time, option);
104104
}
105105
return ret;
106106
}

0 commit comments

Comments
 (0)