[Main]
Name=BN_prodMod
Type=Function
Subtype=ROM Call
Header Files=rsa.h
Definition=void BN_prodMod (BN *dest, const BN *b, const BN *n);

[ROM Call]
Index=$124

[Description]
Multiplies two big integers modulo n.

[Explanation]
BN_prodMod calculates Y&nbsp;=&nbsp;(Y&nbsp;*&nbsp;B)&nbsp;<B>mod</B>&nbsp;N
where Y, B and N are big integers (up to 2040 bits) stored in
<A HREF="$$LINK(BN)">BN</A> structures pointed to by <I>dest</I>, <I>b</I> and <I>n</I> respectively.
This routine is used in TIOS for RSA encryption, but may be used for any other purposes too
(see <A HREF="$$LINK(BN)">BN</A> for more info about how RSA works).
<BR><BR>
Here is an example of program (called "Big Numbers") which takes three (arbitrarily large) integers
A, B and N, calculates
(A&nbsp;*&nbsp;B)&nbsp;<B>mod</B>&nbsp;N and returns the result (assuming that A, B
and N are really integers, i.e. no checking is implemented). This program also illustrates how you
can get "big" integers from the expression stack, and push them to it:
$$EXAMPLE(Big Numbers.c)

[References]
In=BN_power17Mod, BN_powerMod
