/* -*-c-*-
*
- * $Id: rsa-test.c,v 1.1 2004/04/08 01:36:15 mdw Exp $
+ * $Id$
*
* Testing RSA padding operations
*
* (c) 2004 Straylight/Edgeware
*/
-/*----- Licensing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
*
* This file is part of Catacomb.
*
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
- *
+ *
* Catacomb 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Library General Public
* License along with Catacomb; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
mp_drop(c);
xfree(q);
assert(mparena_count(MPARENA_GLOBAL) == 0);
- return (ok);
+ return (ok);
}
#define tsigpad tencpad
mp_drop(c);
dstr_destroy(&d);
assert(mparena_count(MPARENA_GLOBAL) == 0);
- return (ok);
+ return (ok);
}
static int tvrfpad(int nbits,
mp_drop(c);
dstr_destroy(&d);
assert(mparena_count(MPARENA_GLOBAL) == 0);
- return (ok);
+ return (ok);
}
static int tencpub(rsa_pub *rp,
dstr_destroy(&d);
GR_DESTROY(r);
assert(mparena_count(MPARENA_GLOBAL) == 0);
- return (ok);
+ return (ok);
}
static int tvrfpub(rsa_pub *rp,
MP_EPRINTX("*** input", c);
fprintf(stderr, "*** message = "); type_hex.dump(m, stderr);
if (rc < 0)
- fprintf(stderr, "*** expected failure\n");
+ fprintf(stderr, "\n*** expected failure\n");
else {
- fprintf(stderr, "*** expected = %d: ", rc); type_hex.dump(p, stderr);
+ fprintf(stderr, "\n*** expected = %d: ", rc); type_hex.dump(p, stderr);
fprintf(stderr, "\n*** computed = %d: ", n); type_hex.dump(&d, stderr);
fprintf(stderr, "\n");
}
mp_drop(c);
dstr_destroy(&d);
assert(mparena_count(MPARENA_GLOBAL) == 0);
- return (ok);
+ return (ok);
}
/*----- Deep magic --------------------------------------------------------*
rp.d = *(mp **)v++->buf; \
rsa_recover(&rp);
#define ARG_priv \
- &rp,
+ &rp,
#define TAB_priv \
&type_mp, &type_mp, &type_mp,
rp.n = *(mp **)v++->buf; \
rp.e = *(mp **)v++->buf;
#define ARG_pub \
- &rp,
+ &rp,
#define TAB_pub \
- &type_mp, &type_mp,
+ &type_mp, &type_mp,
#define DECL_pad \
int nbits;
static grand *fib;
-TESTS(FUNCS)
+TESTS(FUNCS)
static const test_chunk tests[] = {
TESTS(TAB)