Skip to content

Commit c5d7bfb

Browse files
committed
manually fix the remaining leading _'s
1 parent 373974e commit c5d7bfb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+478
-480
lines changed

demos/constants.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Larry Bugbee, February 2013
1818
*/
1919

20-
static void _print_line(const char* cmd, const char* desc)
20+
static void s_print_line(const char* cmd, const char* desc)
2121
{
2222
printf(" %-16s - %s\n", cmd, desc);
2323
}
@@ -48,10 +48,10 @@ int main(int argc, char **argv)
4848
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
4949
char* base = strdup(basename(argv[0]));
5050
printf("Usage: %s [-a] [-s name]\n\n", base);
51-
_print_line("<no argument>", "The old behavior of the demo");
52-
_print_line("-a", "Only lists all constants");
53-
_print_line("-s name", "List a single constant given as argument");
54-
_print_line("-h", "The help you're looking at");
51+
s_print_line("<no argument>", "The old behavior of the demo");
52+
s_print_line("-a", "Only lists all constants");
53+
s_print_line("-s name", "List a single constant given as argument");
54+
s_print_line("-h", "The help you're looking at");
5555
free(base);
5656
} else if (strcmp(argv[1], "-a") == 0) {
5757
char *names_list;

demos/hashsum.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
#endif
2525

2626
/* thanks http://stackoverflow.com/a/8198009 */
27-
#define _base(x) ((x >= '0' && x <= '9') ? '0' : \
27+
#define s_base(x) ((x >= '0' && x <= '9') ? '0' : \
2828
(x >= 'a' && x <= 'f') ? 'a' - 10 : \
2929
(x >= 'A' && x <= 'F') ? 'A' - 10 : \
3030
'\255')
31-
#define HEXOF(x) (x - _base(x))
31+
#define HEXOF(x) (x - s_base(x))
3232

3333
static char* hashsum;
3434

demos/openssl-enc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void dump_bytes(unsigned char *in, unsigned long len)
166166
* Output: number of bytes after padding resp. after unpadding
167167
* Side Effects: none
168168
*/
169-
static size_t _pkcs7_pad(union paddable *buf, size_t nb, int block_length,
169+
static size_t s_pkcs7_pad(union paddable *buf, size_t nb, int block_length,
170170
int is_padding)
171171
{
172172
unsigned long length;
@@ -224,7 +224,7 @@ int do_crypt(FILE *infd, FILE *outfd, unsigned char *key, unsigned char *iv,
224224
/* We're encrypting, so pad first (if at EOF) and then
225225
crypt */
226226
if(feof(infd))
227-
nb = _pkcs7_pad(&inbuf, nb,
227+
nb = s_pkcs7_pad(&inbuf, nb,
228228
aes_desc.block_length, 1);
229229

230230
ret = cbc_encrypt(inbuf.pad, outbuf.pad, nb, &cbc);
@@ -239,7 +239,7 @@ int do_crypt(FILE *infd, FILE *outfd, unsigned char *key, unsigned char *iv,
239239
return ret;
240240

241241
if(feof(infd))
242-
nb = _pkcs7_pad(&outbuf, nb,
242+
nb = s_pkcs7_pad(&outbuf, nb,
243243
aes_desc.block_length, 0);
244244
if(nb == 0)
245245
/* The file didn't decrypt correctly */

demos/sizes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
like Python - Larry Bugbee, February 2013
1616
*/
1717

18-
static void _print_line(const char* cmd, const char* desc)
18+
static void s_print_line(const char* cmd, const char* desc)
1919
{
2020
printf(" %-16s - %s\n", cmd, desc);
2121
}
@@ -44,10 +44,10 @@ int main(int argc, char **argv)
4444
if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) {
4545
char* base = strdup(basename(argv[0]));
4646
printf("Usage: %s [-a] [-s name]\n\n", base);
47-
_print_line("<no argument>", "The old behavior of the demo");
48-
_print_line("-a", "Only lists all sizes");
49-
_print_line("-s name", "List a single size given as argument");
50-
_print_line("-h", "The help you're looking at");
47+
s_print_line("<no argument>", "The old behavior of the demo");
48+
s_print_line("-a", "Only lists all sizes");
49+
s_print_line("-s name", "List a single size given as argument");
50+
s_print_line("-h", "The help you're looking at");
5151
free(base);
5252
} else if (strcmp(argv[1], "-a") == 0) {
5353
char *sizes_list;

doc/crypt.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ \subsection{Simple Encryption Demonstration}
560560

561561
\begin{small}
562562
\begin{verbatim}
563-
struct _cipher_descriptor {
563+
struct ltc_cipher_descriptor {
564564
/** name of cipher */
565565
char *name;
566566
@@ -745,14 +745,14 @@ \subsection{Notes}
745745
to use a cipher with the descriptor table you must register it first using:
746746
\index{register\_cipher()}
747747
\begin{verbatim}
748-
int register_cipher(const struct _cipher_descriptor *cipher);
748+
int register_cipher(const struct ltc_cipher_descriptor *cipher);
749749
\end{verbatim}
750750
Which accepts a pointer to a descriptor and returns the index into the global descriptor table. If an error occurs such
751751
as there is no more room (it can have 32 ciphers at most) it will return {\bf{-1}}. If you try to add the same cipher more
752752
than once it will just return the index of the first copy. To remove a cipher call:
753753
\index{unregister\_cipher()}
754754
\begin{verbatim}
755-
int unregister_cipher(const struct _cipher_descriptor *cipher);
755+
int unregister_cipher(const struct ltc_cipher_descriptor *cipher);
756756
\end{verbatim}
757757
Which returns {\bf CRYPT\_OK} if it removes the cipher, otherwise it returns {\bf CRYPT\_ERROR}.
758758
\begin{small}
@@ -2594,7 +2594,7 @@ \chapter{One-Way Cryptographic Hash Functions}
25942594
Like the set of ciphers, the set of hashes have descriptors as well. They are stored in an array called \textit{hash\_descriptor} and
25952595
are defined by:
25962596
\begin{verbatim}
2597-
struct _hash_descriptor {
2597+
struct ltc_hash_descriptor {
25982598
char *name;
25992599
26002600
unsigned long hashsize; /* digest output size in bytes */
@@ -2753,9 +2753,9 @@ \subsection{Hash Registration}
27532753
work exactly like those of the cipher registration code. The functions are:
27542754
\index{register\_hash()} \index{unregister\_hash()}
27552755
\begin{verbatim}
2756-
int register_hash(const struct _hash_descriptor *hash);
2756+
int register_hash(const struct ltc_hash_descriptor *hash);
27572757
2758-
int unregister_hash(const struct _hash_descriptor *hash);
2758+
int unregister_hash(const struct ltc_hash_descriptor *hash);
27592759
\end{verbatim}
27602760

27612761
The following hashes are provided as of this release within the LibTomCrypt library:
@@ -3824,7 +3824,7 @@ \subsection{Example}
38243824
PRNGs have descriptors that allow plugin driven functions to be created using PRNGs. The plugin descriptors are stored in the structure \textit{prng\_descriptor}. The
38253825
format of an element is:
38263826
\begin{verbatim}
3827-
struct _prng_descriptor {
3827+
struct ltc_prng_descriptor {
38283828
char *name;
38293829
int export_size; /* size in bytes of exported state */
38303830
@@ -3860,8 +3860,8 @@ \subsection{Example}
38603860
They are the following:
38613861
\index{register\_prng()} \index{unregister\_prng()}
38623862
\begin{verbatim}
3863-
int register_prng(const struct _prng_descriptor *prng);
3864-
int unregister_prng(const struct _prng_descriptor *prng);
3863+
int register_prng(const struct ltc_prng_descriptor *prng);
3864+
int unregister_prng(const struct ltc_prng_descriptor *prng);
38653865
\end{verbatim}
38663866

38673867
The register function will register the PRNG, and return the index into the table where it was placed (or -1 for error). It will avoid registering the same

src/ciphers/aes/aes.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ int SETUP(const unsigned char *key, int keylen, int num_rounds, symmetric_key *s
275275
@return CRYPT_OK if successful
276276
*/
277277
#ifdef LTC_CLEAN_STACK
278-
static int _rijndael_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
278+
static int s_rijndael_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
279279
#else
280280
int ECB_ENC(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
281281
#endif
@@ -443,7 +443,7 @@ int ECB_ENC(const unsigned char *pt, unsigned char *ct, const symmetric_key *ske
443443
#ifdef LTC_CLEAN_STACK
444444
int ECB_ENC(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
445445
{
446-
int err = _rijndael_ecb_encrypt(pt, ct, skey);
446+
int err = s_rijndael_ecb_encrypt(pt, ct, skey);
447447
burn_stack(sizeof(unsigned long)*8 + sizeof(unsigned long*) + sizeof(int)*2);
448448
return err;
449449
}
@@ -459,7 +459,7 @@ int ECB_ENC(const unsigned char *pt, unsigned char *ct, const symmetric_key *ske
459459
@return CRYPT_OK if successful
460460
*/
461461
#ifdef LTC_CLEAN_STACK
462-
static int _rijndael_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
462+
static int s_rijndael_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
463463
#else
464464
int ECB_DEC(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
465465
#endif
@@ -628,7 +628,7 @@ int ECB_DEC(const unsigned char *ct, unsigned char *pt, const symmetric_key *ske
628628
#ifdef LTC_CLEAN_STACK
629629
int ECB_DEC(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
630630
{
631-
int err = _rijndael_ecb_decrypt(ct, pt, skey);
631+
int err = s_rijndael_ecb_decrypt(ct, pt, skey);
632632
burn_stack(sizeof(unsigned long)*8 + sizeof(unsigned long*) + sizeof(int)*2);
633633
return err;
634634
}

src/ciphers/anubis.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ static const ulong32 rc[] = {
876876
@return CRYPT_OK if successful
877877
*/
878878
#ifdef LTC_CLEAN_STACK
879-
static int _anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
879+
static int s_anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
880880
#else
881881
int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
882882
#endif
@@ -1013,7 +1013,7 @@ int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetri
10131013
int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
10141014
{
10151015
int err;
1016-
err = _anubis_setup(key, keylen, num_rounds, skey);
1016+
err = s_anubis_setup(key, keylen, num_rounds, skey);
10171017
burn_stack(sizeof(int) * 5 + sizeof(ulong32) * (MAX_N + MAX_N + 5));
10181018
return err;
10191019
}

src/ciphers/blowfish.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ int blowfish_setup_with_data(const unsigned char *key, int keylen,
472472
@return CRYPT_OK if successful
473473
*/
474474
#ifdef LTC_CLEAN_STACK
475-
static int _blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
475+
static int s_blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
476476
#else
477477
int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
478478
#endif
@@ -499,7 +499,7 @@ int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symme
499499
#ifdef LTC_CLEAN_STACK
500500
int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
501501
{
502-
int err = _blowfish_ecb_encrypt(pt, ct, skey);
502+
int err = s_blowfish_ecb_encrypt(pt, ct, skey);
503503
burn_stack(sizeof(ulong32) * 2 + sizeof(int));
504504
return err;
505505
}
@@ -513,7 +513,7 @@ int blowfish_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symme
513513
@return CRYPT_OK if successful
514514
*/
515515
#ifdef LTC_CLEAN_STACK
516-
static int _blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
516+
static int s_blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
517517
#else
518518
int blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
519519
#endif
@@ -560,7 +560,7 @@ int blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symme
560560
#ifdef LTC_CLEAN_STACK
561561
int blowfish_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
562562
{
563-
int err = _blowfish_ecb_decrypt(ct, pt, skey);
563+
int err = s_blowfish_ecb_decrypt(ct, pt, skey);
564564
burn_stack(sizeof(ulong32) * 2 + sizeof(int));
565565
return err;
566566
}

src/ciphers/cast5.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static const ulong32 S8[256] = {
398398
@return CRYPT_OK if successful
399399
*/
400400
#ifdef LTC_CLEAN_STACK
401-
static int _cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
401+
static int s_cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
402402
#else
403403
int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
404404
#endif
@@ -485,7 +485,7 @@ int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_
485485
int cast5_setup(const unsigned char *key, int keylen, int num_rounds, symmetric_key *skey)
486486
{
487487
int z;
488-
z = _cast5_setup(key, keylen, num_rounds, skey);
488+
z = s_cast5_setup(key, keylen, num_rounds, skey);
489489
burn_stack(sizeof(ulong32)*8 + 16 + sizeof(int)*2);
490490
return z;
491491
}
@@ -522,7 +522,7 @@ LTC_INLINE static ulong32 FIII(ulong32 R, ulong32 Km, ulong32 Kr)
522522
@param skey The key as scheduled
523523
*/
524524
#ifdef LTC_CLEAN_STACK
525-
static int _cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
525+
static int s_cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
526526
#else
527527
int cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
528528
#endif
@@ -562,7 +562,7 @@ int cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetri
562562
#ifdef LTC_CLEAN_STACK
563563
int cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetric_key *skey)
564564
{
565-
int err =_cast5_ecb_encrypt(pt,ct,skey);
565+
int err = s_cast5_ecb_encrypt(pt,ct,skey);
566566
burn_stack(sizeof(ulong32)*3);
567567
return err;
568568
}
@@ -575,7 +575,7 @@ int cast5_ecb_encrypt(const unsigned char *pt, unsigned char *ct, const symmetri
575575
@param skey The key as scheduled
576576
*/
577577
#ifdef LTC_CLEAN_STACK
578-
static int _cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
578+
static int s_cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
579579
#else
580580
int cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
581581
#endif
@@ -615,7 +615,7 @@ int cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetri
615615
#ifdef LTC_CLEAN_STACK
616616
int cast5_ecb_decrypt(const unsigned char *ct, unsigned char *pt, const symmetric_key *skey)
617617
{
618-
int err = _cast5_ecb_decrypt(ct,pt,skey);
618+
int err = s_cast5_ecb_decrypt(ct,pt,skey);
619619
burn_stack(sizeof(ulong32)*3);
620620
return err;
621621
}

src/ciphers/des.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ static const ulong64 des_fp[8][256] = {
12931293
static void cookey(const ulong32 *raw1, ulong32 *keyout);
12941294

12951295
#ifdef LTC_CLEAN_STACK
1296-
static void _deskey(const unsigned char *key, short edf, ulong32 *keyout)
1296+
static void s_deskey(const unsigned char *key, short edf, ulong32 *keyout)
12971297
#else
12981298
static void deskey(const unsigned char *key, short edf, ulong32 *keyout)
12991299
#endif
@@ -1347,13 +1347,13 @@ static void deskey(const unsigned char *key, short edf, ulong32 *keyout)
13471347
#ifdef LTC_CLEAN_STACK
13481348
static void deskey(const unsigned char *key, short edf, ulong32 *keyout)
13491349
{
1350-
_deskey(key, edf, keyout);
1350+
s_deskey(key, edf, keyout);
13511351
burn_stack(sizeof(int)*5 + sizeof(ulong32)*32 + sizeof(unsigned char)*112);
13521352
}
13531353
#endif
13541354

13551355
#ifdef LTC_CLEAN_STACK
1356-
static void _cookey(const ulong32 *raw1, ulong32 *keyout)
1356+
static void s_cookey(const ulong32 *raw1, ulong32 *keyout)
13571357
#else
13581358
static void cookey(const ulong32 *raw1, ulong32 *keyout)
13591359
#endif
@@ -1383,15 +1383,15 @@ static void cookey(const ulong32 *raw1, ulong32 *keyout)
13831383
#ifdef LTC_CLEAN_STACK
13841384
static void cookey(const ulong32 *raw1, ulong32 *keyout)
13851385
{
1386-
_cookey(raw1, keyout);
1386+
s_cookey(raw1, keyout);
13871387
burn_stack(sizeof(ulong32 *) * 2 + sizeof(ulong32)*32 + sizeof(int));
13881388
}
13891389
#endif
13901390

13911391
#ifndef LTC_CLEAN_STACK
13921392
static void desfunc(ulong32 *block, const ulong32 *keys)
13931393
#else
1394-
static void _desfunc(ulong32 *block, const ulong32 *keys)
1394+
static void s_desfunc(ulong32 *block, const ulong32 *keys)
13951395
#endif
13961396
{
13971397
ulong32 work, right, leftt;
@@ -1505,7 +1505,7 @@ static void _desfunc(ulong32 *block, const ulong32 *keys)
15051505
#ifdef LTC_CLEAN_STACK
15061506
static void desfunc(ulong32 *block, const ulong32 *keys)
15071507
{
1508-
_desfunc(block, keys);
1508+
s_desfunc(block, keys);
15091509
burn_stack(sizeof(ulong32) * 4 + sizeof(int));
15101510
}
15111511
#endif

0 commit comments

Comments
 (0)