if (_dig) {
switch (i) {
case 0: /* n */
- mp32bsethex(&_dig->rsa_pk.n, pgpMpiHex(p));
+ mpbsethex(&_dig->rsa_pk.n, pgpMpiHex(p));
/* Get the keyid */
if (_digp) {
uint32* np = _dig->rsa_pk.n.modl;
if (_dig) {
switch (i) {
case 0: /* p */
- mp32bsethex(&_dig->p, pgpMpiHex(p));
+ mpbsethex(&_dig->p, pgpMpiHex(p));
if (_debug && _print)
fprintf(stderr, "\t p = "), mp32println(stderr, _dig->p.size, _dig->p.modl);
/*@switchbreak@*/ break;
case 1: /* q */
- mp32bsethex(&_dig->q, pgpMpiHex(p));
+ mpbsethex(&_dig->q, pgpMpiHex(p));
if (_debug && _print)
fprintf(stderr, "\t q = "), mp32println(stderr, _dig->q.size, _dig->q.modl);
/*@switchbreak@*/ break;
/*@=branchstate@*/
dig->sha1ctx = NULL;
- mp32bfree(&dig->p);
- mp32bfree(&dig->q);
+ mpbfree(&dig->p);
+ mpbfree(&dig->q);
mpnfree(&dig->g);
mpnfree(&dig->y);
mpnfree(&dig->hm);
/*@=branchstate@*/
dig->md5ctx = NULL;
- mp32bfree(&dig->rsa_pk.n);
+ mpbfree(&dig->rsa_pk.n);
mpnfree(&dig->rsa_pk.e);
mpnfree(&dig->m);
mpnfree(&dig->c);
#include "system.h"
-#include "mp32barrett.h"
+#include "mpbarrett.h"
#include "mp32.h"
#include "popt.h"
#include "debug.h"
static int _debug = 0;
-static int Zmp32binv_w(const mp32barrett* b, uint32 xsize, const uint32* xdata, uint32* result, uint32* wksp)
+static int Zmpbinv_w(const mpbarrett* b, uint32 xsize, const uint32* xdata, uint32* result, uint32* wksp)
{
uint32 ysize = b->size+1;
int ubits, vbits;
return 1;
}
-static int Ymp32binv_w(const mp32barrett* b, uint32 xsize, const uint32* xdata, uint32* result, uint32* wksp)
+static int Ympbinv_w(const mpbarrett* b, uint32 xsize, const uint32* xdata, uint32* result, uint32* wksp)
{
uint32 ysize = b->size+1;
int k;
* needs workspace of (6*size+6) words
* @note xdata and result cannot point to the same area
*/
-static int Xmp32binv_w(const mp32barrett* b, uint32 xsize, const uint32* xdata, uint32* result, uint32* wksp)
+static int Xmpbinv_w(const mpbarrett* b, uint32 xsize, const uint32* xdata, uint32* result, uint32* wksp)
{
/*
* Fact: if a element of Zn, then a is invertible if and only if gcd(a,n) = 1
main(int argc, const char * argv[])
{
poptContext optCon = poptGetContext(argv[0], argc, argv, optionsTable, 0);
- mp32barrett q;
+ mpbarrett q;
mpnumber s;
uint32 qsize;
uint32* qtemp;
}
}
- mp32bzero(&q); mp32bsethex(&q, dsa_q);
+ mpbzero(&q); mpbsethex(&q, dsa_q);
qsize = q.size;
qtemp = malloc((13*qsize+13) * sizeof(*qtemp));
qwksp = qtemp+2*qsize;
mpnzero(&s); mpnsethex(&s, dsa_s[i]);
fprintf(stderr, "-------------------------------------------------- %d\n", i);
- rc = Xmp32binv_w(&q, s.size, s.data, qtemp, qwksp);
+ rc = Xmpbinv_w(&q, s.size, s.data, qtemp, qwksp);
fprintf(stderr, "beecrypt: "); mp32println(stderr, qsize, qtemp);
fprintf(stderr, "-------------------------------------------------- %d\n", i);
- rc = Ymp32binv_w(&q, s.size, s.data, qtemp, qwksp);
+ rc = Ympbinv_w(&q, s.size, s.data, qtemp, qwksp);
fprintf(stderr, " Knuth: "); mp32println(stderr, qsize, qtemp);
fprintf(stderr, "-------------------------------------------------- %d\n", i);
- rc = Zmp32binv_w(&q, s.size, s.data, qtemp, qwksp);
+ rc = Zmpbinv_w(&q, s.size, s.data, qtemp, qwksp);
fprintf(stderr, " Brent: "); mp32println(stderr, qsize, qtemp);
fprintf(stderr, "-------------------------------------------------- %d\n", i);
dig = pgpNewDig();
- mp32bzero(&dig->p); mp32bsethex(&dig->p, fips_p);
- mp32bzero(&dig->q); mp32bsethex(&dig->q, fips_q);
+ mpbzero(&dig->p); mpbsethex(&dig->p, fips_p);
+ mpbzero(&dig->q); mpbsethex(&dig->q, fips_q);
mpnzero(&dig->g); mpnsethex(&dig->g, fips_g);
mpnzero(&dig->y); mpnsethex(&dig->y, fips_y);
mpnzero(&dig->r); mpnsethex(&dig->r, fips_r);
fprintf(stderr, "=============================== DSA FIPS-186-1: rc %d\n", rc);
- mp32bfree(&dig->p);
- mp32bfree(&dig->q);
+ mpbfree(&dig->p);
+ mpbfree(&dig->q);
mpnfree(&dig->g);
mpnfree(&dig->y);
fprintf(stderr, "=============================== DSA verify: rc %d\n", rc);
- mp32bfree(&dig->p);
- mp32bfree(&dig->q);
+ mpbfree(&dig->p);
+ mpbfree(&dig->q);
mpnfree(&dig->g);
mpnfree(&dig->y);