some changes

This commit is contained in:
cathugger 2017-09-25 23:57:27 +03:00
parent 4504c9eeb6
commit 249ffd19ec
2 changed files with 10 additions and 7 deletions

View file

@ -18,8 +18,7 @@ Use -h switch to obtain all avaiable options.
ACKNOWLEDGEMENTS & LEGAL:
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software.
If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
keccak.c is based on <https://github.com/gvanas/KeccakCodePackage/blob/master/Standalone/CompactFIPS202/Keccak-more-compact.c>.
ed25519/ref10 is taken from SUPERCOP <https://bench.cr.yp.to/supercop.html>.

14
main.c
View file

@ -62,7 +62,7 @@ static void termhandler(int sig)
}
struct binfilter {
u8 *f;
u8 f[PUBLIC_LEN];
size_t len; // real len minus one
u8 mask;
} ;
@ -90,7 +90,6 @@ static void filters_add(const char *filter)
fprintf(stderr, "filter \"%s\" is too long\n", filter);
return;
}
bf.f = malloc(ret);
ret2 = base32_from(bf.f,&bf.mask,filter);
assert(ret == ret2);
//printf("--m:%02X\n", bf.mask);
@ -100,12 +99,14 @@ static void filters_add(const char *filter)
static void filters_clean()
{
for (size_t i = 0; i < VEC_LENGTH(bfilters); ++i) {
free(VEC_BUF(bfilters, i).f);
}
VEC_FREE(bfilters);
}
static size_t filters_count()
{
return VEC_LENGTH(bfilters);
}
static void loadfilterfile(const char *fname)
{
char buf[128];
@ -543,6 +544,9 @@ int main(int argc, char **argv)
if (!quietflag)
printfilters();
if (!filters_count())
return 0;
if (workdir)
mkdir(workdir, 0700);