Skip to content

Commit 75cfdaa

Browse files
committed
documentation: add new rsa generate key API
Add rsa_make_key_ubin_e api documentation. Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
1 parent d6bc30e commit 75cfdaa

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

doc/crypt.tex

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4326,10 +4326,27 @@ \subsection{RSA Key Generation}
43264326
trivial math attacks, and not super slow. The \textit{key} parameter is where the constructed key is placed. All keys must be at
43274327
least 128 bytes, and no more than 512 bytes in size (\textit{that is from 1024 to 4096 bits}).
43284328

4329+
\index{rsa\_make\_key\_ubin\_e()}
4330+
\begin{verbatim}
4331+
int rsa_make_key_ubin_e(
4332+
prng_state *prng,
4333+
int wprng,
4334+
int size,
4335+
const unsigned char *e,
4336+
unsigned long elen,
4337+
rsa_key *key);
4338+
\end{verbatim}
4339+
4340+
Where \textit{wprng} is the index into the PRNG descriptor array. The \textit{size} parameter is the size in bytes of the RSA modulus desired.
4341+
The \textit{e} parameter is the hexadecimal buffer of the encryption exponent desired, from 3 upto 255 bits value. Stick with 65537 since it is big enough
4342+
to prevent trivial math attacks, and not super slow. The \textit{elen} parameter is the size in bytes of the encryption exponent \textit{e}.
4343+
The \textit{key} parameter is where the constructed key is placed. All keys must be at
4344+
least 128 bytes, and no more than 512 bytes in size (\textit{that is from 1024 to 4096 bits}).
4345+
43294346
\index{rsa\_free()}
4330-
Note: the \textit{rsa\_make\_key()} function allocates memory at run--time when you make the key. Make sure to call
4331-
\textit{rsa\_free()} (see below) when you are finished with the key. If \textit{rsa\_make\_key()} fails it will automatically
4332-
free the memory allocated.
4347+
Note: the \textit{rsa\_make\_key()} and \textit{rsa\_make\_key\_ubin\_e()} functions allocates memory at run--time when you make the key.
4348+
Make sure to call \textit{rsa\_free()} (see below) when you are finished with the key. If \textit{rsa\_make\_key()} or \textit{rsa\_make\_key\_ubin\_e()}
4349+
fails it will automatically free the memory allocated.
43334350

43344351
\index{PK\_PRIVATE} \index{PK\_PUBLIC}
43354352
There are two types of RSA keys. The types are {\bf PK\_PRIVATE} and {\bf PK\_PUBLIC}. The first type is a private

0 commit comments

Comments
 (0)