Skip to content

Commit 2028d1f

Browse files
committed
doc/dox_comments/header_files/ecc.h: add docs for wc_ecc_make_pub() and wc_ecc_make_pub_ex(), and update docs for wc_ecc_export_x963() and wc_ecc_export_x963_ex() to reflect that they export the public key, and add see-alsos to wc_ecc_make_pub.
1 parent 2a1df11 commit 2028d1f

File tree

1 file changed

+118
-6
lines changed
  • doc/dox_comments/header_files

1 file changed

+118
-6
lines changed

doc/dox_comments/header_files/ecc.h

Lines changed: 118 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,114 @@ int wc_ecc_make_key(WC_RNG* rng, int keysize, ecc_key* key);
113113

114114
int wc_ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, int curve_id);
115115

116+
/*!
117+
\ingroup ECC
118+
119+
\brief wc_ecc_make_pub computes the public component from an ecc_key with an
120+
existing private component. If pubOut is supplied, the computed public key
121+
is stored there, else it is stored in the supplied ecc_key public component
122+
slot.
123+
124+
\return 0 Returned on success.
125+
\return ECC_BAD_ARG_E Returned if rng or key evaluate to NULL
126+
\return BAD_FUNC_ARG Returned if the supplied key is not a valid ecc_key.
127+
\return MEMORY_E Returned if there is an error allocating memory while
128+
computing the public key
129+
\return MP_INIT_E may be returned if there is an error while computing
130+
the public key
131+
\return MP_READ_E may be returned if there is an error while computing
132+
the public key
133+
\return MP_CMP_E may be returned if there is an error while computing the
134+
public key
135+
\return MP_INVMOD_E may be returned if there is an error while computing
136+
the public key
137+
\return MP_EXPTMOD_E may be returned if there is an error while computing
138+
the public key
139+
\return MP_MOD_E may be returned if there is an error while computing the
140+
public key
141+
\return MP_MUL_E may be returned if there is an error while computing the
142+
public key
143+
\return MP_ADD_E may be returned if there is an error while computing the
144+
public key
145+
\return MP_MULMOD_E may be returned if there is an error while computing
146+
the public key
147+
\return MP_TO_E may be returned if there is an error while computing the
148+
public key
149+
\return MP_MEM may be returned if there is an error while computing the
150+
public key
151+
\return ECC_OUT_OF_RANGE_E may be returned if there is an error while computing the
152+
public key
153+
\return ECC_PRIV_KEY_E may be returned if there is an error while computing the
154+
public key
155+
\return ECC_INF_E may be returned if there is an error while computing the
156+
public key
157+
158+
\param key Pointer to an ecc_key containing a valid private component
159+
\param pubOut Optional pointer to an ecc_point struct in which to store
160+
the computed public key
161+
162+
\sa wc_ecc_make_pub_ex
163+
\sa wc_ecc_make_key
164+
*/
165+
166+
int wc_ecc_make_pub(ecc_key* key, ecc_point* pubOut);
167+
168+
/*!
169+
\ingroup ECC
170+
171+
\brief wc_ecc_make_pub_ex computes the public component from an ecc_key with
172+
an existing private component. If pubOut is supplied, the computed public
173+
key is stored there, else it is stored in the supplied ecc_key public
174+
component slot. The supplied rng, if non-NULL, is used to blind the private
175+
key value used in the computation. If rng is NULL, an ephemeral rng is
176+
instantiated internally.
177+
178+
\return 0 Returned on success.
179+
\return ECC_BAD_ARG_E Returned if rng or key evaluate to NULL
180+
\return BAD_FUNC_ARG Returned if the supplied key is not a valid ecc_key.
181+
\return MEMORY_E Returned if there is an error allocating memory while
182+
computing the public key
183+
\return MP_INIT_E may be returned if there is an error while computing
184+
the public key
185+
\return MP_READ_E may be returned if there is an error while computing
186+
the public key
187+
\return MP_CMP_E may be returned if there is an error while computing the
188+
public key
189+
\return MP_INVMOD_E may be returned if there is an error while computing
190+
the public key
191+
\return MP_EXPTMOD_E may be returned if there is an error while computing
192+
the public key
193+
\return MP_MOD_E may be returned if there is an error while computing the
194+
public key
195+
\return MP_MUL_E may be returned if there is an error while computing the
196+
public key
197+
\return MP_ADD_E may be returned if there is an error while computing the
198+
public key
199+
\return MP_MULMOD_E may be returned if there is an error while computing
200+
the public key
201+
\return MP_TO_E may be returned if there is an error while computing the
202+
public key
203+
\return MP_MEM may be returned if there is an error while computing the
204+
public key
205+
\return ECC_OUT_OF_RANGE_E may be returned if there is an error while computing the
206+
public key
207+
\return ECC_PRIV_KEY_E may be returned if there is an error while computing the
208+
public key
209+
\return ECC_INF_E may be returned if there is an error while computing the
210+
public key
211+
212+
\param key Pointer to an ecc_key containing a valid private component
213+
\param pubOut Optional pointer to an ecc_point struct in which to store
214+
the computed public key
215+
\param rng Rng to be used in the public key computation
216+
217+
\sa wc_ecc_make_pub
218+
\sa wc_ecc_make_key
219+
\sa wc_InitRng
220+
*/
221+
222+
int wc_ecc_make_pub_ex(ecc_key* key, ecc_point* pubOut, WC_RNG* rng);
223+
116224
/*!
117225
\ingroup ECC
118226
@@ -960,30 +1068,33 @@ int wc_ecc_mulmod(mp_int* k, ecc_point *G, ecc_point *R,
9601068
9611069
\sa wc_ecc_export_x963_ex
9621070
\sa wc_ecc_import_x963
1071+
\sa wc_ecc_make_pub
9631072
*/
9641073

9651074
int wc_ecc_export_x963(ecc_key* key, byte* out, word32* outLen);
9661075

9671076
/*!
9681077
\ingroup ECC
9691078
970-
\brief This function exports the ECC key from the ecc_key structure,
1079+
\brief This function exports the public key from the ecc_key structure,
9711080
storing the result in out. The key will be stored in ANSI X9.63 format.
9721081
It stores the bytes written to the output buffer in outLen. This function
9731082
allows the additional option of compressing the certificate through the
9741083
compressed parameter. When this parameter is true, the key will be stored
9751084
in ANSI X9.63 compressed format.
9761085
977-
\return 0 Returned on successfully exporting the ecc_key
1086+
\return 0 Returned on successfully exporting the ecc_key public component
1087+
\return ECC_PRIVATEKEY_ONLY Returned if the ecc_key public component is
1088+
missing
9781089
\return NOT_COMPILED_IN Returned if the HAVE_COMP_KEY was not enabled at
9791090
compile time, but the key was requested in compressed format
9801091
\return LENGTH_ONLY_E Returned if the output buffer evaluates to NULL, but
9811092
the other two input parameters are valid. Indicates that the function is
982-
only returning the length required to store the key
1093+
only returning the length required to store the public key
9831094
\return ECC_BAD_ARG_E Returned if any of the input parameters are NULL, or
9841095
the key is unsupported (has an invalid index)
9851096
\return BUFFER_E Returned if the output buffer is too small to store the
986-
ecc key. If the output buffer is too small, the size needed will be
1097+
public key. If the output buffer is too small, the size needed will be
9871098
returned in outLen
9881099
\return MEMORY_E Returned if there is an error allocating memory with
9891100
XMALLOC
@@ -1010,9 +1121,9 @@ int wc_ecc_export_x963(ecc_key* key, byte* out, word32* outLen);
10101121
10111122
\param key pointer to the ecc_key object to export
10121123
\param out pointer to the buffer in which to store the ANSI X9.63
1013-
formatted key
1124+
formatted public key
10141125
\param outLen size of the output buffer. On successfully storing the
1015-
key, will hold the bytes written to the output buffer
1126+
public key, will hold the bytes written to the output buffer
10161127
\param compressed indicator of whether to store the key in compressed
10171128
format. 1==compressed, 0==uncompressed
10181129
@@ -1031,6 +1142,7 @@ int wc_ecc_export_x963(ecc_key* key, byte* out, word32* outLen);
10311142
10321143
\sa wc_ecc_export_x963
10331144
\sa wc_ecc_import_x963
1145+
\sa wc_ecc_make_pub
10341146
*/
10351147

10361148
int wc_ecc_export_x963_ex(ecc_key* key, byte* out, word32* outLen, int compressed);

0 commit comments

Comments
 (0)