@@ -5028,10 +5028,10 @@ \chapter{Elliptic Curve Cryptography}
50285028\subsection {Using Built--in Curves }
50295029
50305030First a function is provided to look up curve name or OID of built--in curves:
5031- \index {ecc\_ get \_ curve()}
5031+ \index {ecc\_ find \_ curve()}
50325032\begin {verbatim }
5033- int ecc_get_curve (const char *name_or_oid,
5034- const ltc_ecc_curve **cu);
5033+ int ecc_find_curve (const char *name_or_oid,
5034+ const ltc_ecc_curve **cu);
50355035\end {verbatim }
50365036
50375037The \textit {name\_ or\_ oid } argument will search by name, alternative name or OID as mentioned in Table \ref {fig:builtincurves }.
@@ -5059,7 +5059,7 @@ \subsection{Using Built--in Curves}
50595059 if (register_all_prngs() != CRYPT_OK) return -1;
50605060 wprng = find_prng("yarrow");
50615061 if (rng_make_prng(128, wprng, &prng, NULL) != CRYPT_OK) return -1;
5062- if (ecc_get_curve ("nistp256", &cu) != CRYPT_OK) return -1;
5062+ if (ecc_find_curve ("nistp256", &cu) != CRYPT_OK) return -1;
50635063 if (ecc_make_key_ex(&prng, wprng, &key, cu) != CRYPT_OK) return -1;
50645064\end {verbatim }
50655065\end {small }
@@ -5101,14 +5101,13 @@ \subsection{Extended Key Generation}
51015101
51025102The curve must be of the form $ y^2 = x^3 - a \cdot x + b$ , and all of the \textit {const char* } parameters have to be encoded in hexadecimal format.
51035103
5104- % FIXME/XXX: shouldn't this be called ecc_set_curve()?
5105- \index {ecc\_ set\_ dp()}
5104+ \index {ecc\_ set\_ curve()}
51065105\begin {verbatim }
5107- int ecc_set_dp (const ltc_ecc_curve *cu,
5108- ecc_key *key);
5106+ int ecc_set_curve (const ltc_ecc_curve *cu,
5107+ ecc_key *key);
51095108\end {verbatim }
51105109
5111- The function \textit {ecc\_ set\_ dp } initializes the \textit {key } structure with the curve parameters passed via \textit {cu }.
5110+ The function \textit {ecc\_ set\_ curve } initializes the \textit {key } structure with the curve parameters passed via \textit {cu }.
51125111
51135112\index {ecc\_ generate\_ key()}
51145113\begin {verbatim }
@@ -5123,15 +5122,15 @@ \subsection{Extended Key Generation}
51235122% FIXME/XXX: I'd say either we leave ecc_make_key_ex() in and don't tell about its origin or we remove it if we already
51245123% say that it's just a wrapper and only there for backwards compat...
51255124For backwards compatibility the function \textit {ecc\_ make\_ key\_ ex } is provided, which is just a wrapper
5126- around \textit {ecc\_ set\_ dp } and \textit {ecc\_ generate\_ key }.
5125+ around \textit {ecc\_ set\_ curve } and \textit {ecc\_ generate\_ key }.
51275126
51285127Advanced example of creating an ECC key:
51295128\begin {small }
51305129\begin {verbatim }
51315130 prng_state prng;
51325131 int wprng;
51335132 ecc_key key;
5134- const ltc_ecc_curve custom_dp = {
5133+ const ltc_ecc_curve custom_curve = {
51355134 "FFFFFFFFFFFFFFFFFFFFFFFFFDE7", /* prime */
51365135 "0000000000000000000000000000", /* A */
51375136 "0000000000000000000000000003", /* B */
@@ -5145,7 +5144,7 @@ \subsection{Extended Key Generation}
51455144 if (register_all_prngs() != CRYPT_OK) return -1;
51465145 wprng = find_prng("yarrow");
51475146 if (rng_make_prng(128, wprng, &prng, NULL) != CRYPT_OK) return -1;
5148- if (ecc_set_dp(&custom_dp , &key) != CRYPT_OK) return -1;
5147+ if (ecc_set_curve(&custom_curve , &key) != CRYPT_OK) return -1;
51495148 if (ecc_generate_key(&prng, wprng, &key) != CRYPT_OK) return -1;
51505149\end {verbatim }
51515150\end {small }
@@ -5182,12 +5181,12 @@ \subsection{Legacy Key Generation}
51825181\label {fig:legacy-curve-names }
51835182\end {table }
51845183
5185- It is also possible to use a combination of \textit {ecc\_ set\_ dp \_ by\_ size } (similar to \textit {ecc\_ set\_ dp }) and \textit {ecc\_ generate\_ key }.
5184+ It is also possible to use a combination of \textit {ecc\_ set\_ curve \_ by\_ size } (similar to \textit {ecc\_ set\_ curve }) and \textit {ecc\_ generate\_ key }.
51865185
5187- \index {ecc\_ set\_ dp \_ by\_ size}
5186+ \index {ecc\_ set\_ curve \_ by\_ size}
51885187\begin {verbatim }
5189- int ecc_set_dp_by_size ( int keysize,
5190- ecc_key *key);
5188+ int ecc_set_curve_by_size ( int keysize,
5189+ ecc_key *key);
51915190\end {verbatim }
51925191
51935192The \textit {keysize } maps to the specific curve according to table \ref {fig:legacy-curve-names }.
@@ -5271,10 +5270,10 @@ \subsection{Import Raw Key}
52715270\begin {small }
52725271\begin {verbatim }
52735272 ecc_key key;
5274- const ltc_ecc_curve* dp ;
5273+ const ltc_ecc_curve* cu ;
52755274
5276- if (ecc_get_curve ("nistp256", &dp ) != CRYPT_OK) return -1;
5277- if (ecc_set_dp(dp , &key) != CRYPT_OK) return -1;
5275+ if (ecc_find_curve ("nistp256", &cu ) != CRYPT_OK) return -1;
5276+ if (ecc_set_curve(cu , &key) != CRYPT_OK) return -1;
52785277 if (ecc_set_key(keybuf, keylen, PK_PRIVATE, &key) != CRYPT_OK) return -1;
52795278\end {verbatim }
52805279\end {small }
0 commit comments