bigpmpy.c revision 65c4736d9c0ebc6d9b1d991593b55566909da9cd
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews/* Copyright (C) RSA Data Security, Inc. created 1987, 1996. This is an
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews unpublished work protected as such under copyright law. This work
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews contains proprietary, confidential, and trade secret information of
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews RSA Data Security, Inc. Use, disclosure or reproduction without the
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews express written authorization of RSA Data Security, Inc. is
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews prohibited.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews */
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews#include "global.h"
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews#include "bigmath.h"
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews/* a = b * c.
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews */
d1cacbb37474b0cbee6c1ddd05d27f731b2b43baMark Andrewsvoid BigPmpy (a, b, c, n)
d48730a446ffffa8d75462a4abefce030425fa64Mark AndrewsUINT2 *a, *b, *c;
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrewsunsigned int n;
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews{
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews register unsigned int i;
ac9072210cea5283e554f1787876b647a08fda96Mark Andrews unsigned int cLen;
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews
d48730a446ffffa8d75462a4abefce030425fa64Mark Andrews BigZero (a, 2*n);
d1cacbb37474b0cbee6c1ddd05d27f731b2b43baMark Andrews cLen = BigLenw (c, n);
d1cacbb37474b0cbee6c1ddd05d27f731b2b43baMark Andrews for (i = 0; i < n; i++)
d1cacbb37474b0cbee6c1ddd05d27f731b2b43baMark Andrews a[cLen+i] = BigAcc (&a[i], (unsigned int)b[i], c, cLen);
d1cacbb37474b0cbee6c1ddd05d27f731b2b43baMark Andrews}
d1cacbb37474b0cbee6c1ddd05d27f731b2b43baMark Andrews