X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=main.c;h=71d67f39dd746233e2ac08c4f9084e01b8d224cc;hb=cc8bd8d6de90aef0bdbf3af9ba916f4f14ab6fb0;hp=3363ec1de5f3809b78f2811aaa819c7917dee1f8;hpb=a9a4ac1407a715fe29713380953904de440d9f50;p=xonotic%2Fd0_blind_id.git diff --git a/main.c b/main.c index 3363ec1..71d67f3 100644 --- a/main.c +++ b/main.c @@ -1,21 +1,36 @@ /* -Blind-ID library for user identification using RSA blind signatures -Copyright (C) 2010 Rudolf Polzer - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ + * FILE: d0_iobuf.c + * AUTHOR: Rudolf Polzer - divVerent@xonotic.org + * + * Copyright (c) 2010, Rudolf Polzer + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + */ #include "d0_blind_id.h" @@ -35,7 +50,9 @@ void bench(double *b) lastclock = b; } +#ifndef WIN32 #include +#endif volatile BOOL quit = 0; void mysignal(int signo) { @@ -43,7 +60,17 @@ void mysignal(int signo) quit = 1; } -#include +#include +#include +static void errx(int status, const char *format, ...) +{ + va_list ap; + va_start(ap, format); + vfprintf(stderr, format, ap); + fputs("\n", stderr); + exit(status); +} + int main(int argc, char **argv) { char buf[65536]; size_t bufsize; @@ -76,7 +103,9 @@ int main(int argc, char **argv) errx(3, "readpub fail"); */ +#ifndef WIN32 signal(SIGINT, mysignal); +#endif int n = 0; double bench_gen = 0, bench_fp = 0, bench_stop = 0;