Lines Matching +full:for +full:- +full:context

4  * \brief This file provides an API for the LMS post-quantum-safe stateful-hash
5 public-key signature scheme as defined in RFC8554 and NIST.SP.200-208.
9 * for IOT firmware upgrades (RFC9019).
13 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
24 #define MBEDTLS_ERR_LMS_BAD_INPUT_DATA -0x0011 /**< Bad data has been input to an LMS function */
25 #define MBEDTLS_ERR_LMS_OUT_OF_PRIVATE_KEYS -0x0013 /**< Specified LMS key has utilised all of its …
26 #define MBEDTLS_ERR_LMS_VERIFY_FAILED -0x0015 /**< LMS signature verification failed */
27 #define MBEDTLS_ERR_LMS_ALLOC_FAILED -0x0017 /**< LMS failed to allocate space for a private ke…
28 #define MBEDTLS_ERR_LMS_BUFFER_TOO_SMALL -0x0019 /**< Input/output buffer is too small to contain r…
30 /* Currently only defined for SHA256, 32 is the max hash output size */
49 /* The length of a hash output, Currently only implemented for SHA256.
72 * https://www.iana.org/assignments/leighton-micali-signatures/leighton-micali-signatures.xhtml
73 * We are only implementing a subset of the types, particularly H10, for the sake of simplicity.
80 * https://www.iana.org/assignments/leighton-micali-signatures/leighton-micali-signatures.xhtml.
81 * We are only implementing a subset of the types, particularly N32_W8, for the sake of simplicity.
99 mbedtls_lmots_algorithm_type_t MBEDTLS_PRIVATE(type); /*!< The LM-OTS key type identifier as
104 /** LMOTS public context structure.
108 * The context must be initialized before it is used. A public key must either
109 * be imported or generated from a private context.
113 * UNINITIALIZED -> INIT [label="init"];
114 * HAVE_PUBLIC_KEY -> INIT [label="free"];
115 * INIT -> HAVE_PUBLIC_KEY [label="import_public_key"];
116 * INIT -> HAVE_PUBLIC_KEY [label="calculate_public_key from private key"];
117 * HAVE_PUBLIC_KEY -> HAVE_PUBLIC_KEY [label="export_public_key"];
124 unsigned char MBEDTLS_PRIVATE(have_public_key); /*!< Whether the context contains a public key.
129 /** LMOTS private context structure.
131 * A LMOTS private key is one hash output for each of digit of the digest +
134 * The context must be initialized before it is used. A public key must either
135 * be imported or generated from a private context.
139 * UNINITIALIZED -> INIT [label="init"];
140 * HAVE_PRIVATE_KEY -> INIT [label="free"];
141 * INIT -> HAVE_PRIVATE_KEY [label="generate_private_key"];
142 * HAVE_PRIVATE_KEY -> INIT [label="sign"];
150 … unsigned char MBEDTLS_PRIVATE(have_private_key); /*!< Whether the context contains a private key.
164 mbedtls_lmots_algorithm_type_t MBEDTLS_PRIVATE(otstype); /*!< The LM-OTS key type identifier as
172 /** LMS public context structure.
177 * The context must be initialized before it is used. A public key must either
178 * be imported or generated from a private context.
182 * UNINITIALIZED -> INIT [label="init"];
183 * HAVE_PUBLIC_KEY -> INIT [label="free"];
184 * INIT -> HAVE_PUBLIC_KEY [label="import_public_key"];
185 * INIT -> HAVE_PUBLIC_KEY [label="calculate_public_key from private key"];
186 * HAVE_PUBLIC_KEY -> HAVE_PUBLIC_KEY [label="export_public_key"];
194 unsigned char MBEDTLS_PRIVATE(have_public_key); /*!< Whether the context contains a public key.
200 /** LMS private context structure.
205 * The context must be initialized before it is used. A public key must either
206 * be imported or generated from a private context.
210 * UNINITIALIZED -> INIT [label="init"];
211 * HAVE_PRIVATE_KEY -> INIT [label="free"];
212 * INIT -> HAVE_PRIVATE_KEY [label="generate_private_key"];
221for each leaf node in the Merkle tree. NULL
222 … when have_private_key is 0 and non-NULL otherwise.
227 non-NULL otherwise.
230 … unsigned char MBEDTLS_PRIVATE(have_private_key); /*!< Whether the context contains a private key.
236 * \brief This function initializes an LMS public context
238 * \param ctx The uninitialized LMS context that will then be
244 * \brief This function uninitializes an LMS public context
246 * \param ctx The initialized LMS context that will then be
253 * public LMS context.
255 * \note Before this function is called, the context must
258 * \note See IETF RFC8554 for details of the encoding of
261 * \param ctx The initialized LMS context store the key in.
268 * \return A non-zero error code on failure.
275 * LMS public context that already contains a public
278 * \note Before this function is called, the context must
279 * have been initialized and the context must contain
282 * \note See IETF RFC8554 for details of the encoding of
285 * \param ctx The initialized LMS public context that contains
294 * \return A non-zero error code on failure.
302 * LMS context that contains a public key.
304 * \note Before this function is called, the context must
308 * \param ctx The initialized LMS public context from which the
318 * \return A non-zero error code on failure.
326 * \brief This function initializes an LMS private context
328 * \param ctx The uninitialized LMS private context that will
333 * \brief This function uninitializes an LMS private context
335 * \param ctx The initialized LMS private context that will then
342 * stores in into an LMS private context.
344 * \warning This function is **not intended for use in
345 * production**, due to as-yet unsolved problems with
346 * handling stateful keys. The API for this function
351 * \param ctx The initialized LMOTS context to generate the key
356 * \param p_rng The RNG context to be passed to f_rng
362 * \return A non-zero error code on failure.
373 * LMS context that already contains a private key.
375 * \note Before this function is called, the context must
376 * have been initialized and the context must contain
379 * \param ctx The initialized LMS public context to calculate the key
382 * \param priv_ctx The LMS private context to read the private key
387 * \return A non-zero error code on failure.
394 * LMS context that contains unused private keys.
396 * \warning This function is **not intended for use in
397 * production**, due to as-yet unsolved problems with
398 * handling stateful keys. The API for this function
401 * \note Before this function is called, the context must
412 * \param ctx The initialized LMS private context from which the
414 * \param f_rng The RNG function to be used for signature
416 * \param p_rng The RNG context to be passed to f_rng
427 * \return A non-zero error code on failure.