Lines Matching full:size

4  * \brief PSA cryptography module: Mbed TLS buffer size macros
48 /** The size of the output of psa_hash_finish(), in bytes.
50 * This is also the hash size that psa_hash_verify() expects.
57 * \return The hash size for the specified hash algorithm.
77 /** The input block size of a hash algorithm, in bytes.
87 * \return The block size in bytes for the specified hash algorithm.
89 * An implementation can return either 0 or the correct size for a
111 * Maximum size of a hash.
114 * is the maximum size of a hash in bytes.
116 /* Note: for HMAC-SHA-3, the block size is 144 bytes for HMAC-SHA3-224,
155 * Maximum size of a MAC.
158 * is the maximum size of a MAC in bytes.
160 /* All non-HMAC MACs have a maximum size that's smaller than the
169 * This macro can be used to allocate a buffer of sufficient size to store the
175 * \param key_bits The size of the AEAD key in bits.
193 /** The maximum tag size for all supported AEAD algorithms, in bytes.
199 /* The maximum size of an RSA key on this implementation, in bits.
202 * Mbed TLS does not set a hard limit on the size of RSA keys: any key
208 * RSA key whose size is larger than the value defined here.
210 * Note that an implementation may set different size limits for different
214 /* The minimum size of an RSA key on this implementation, in bits.
226 /* The maximum size of an DH key on this implementation, in bits.
242 /* The maximum size of an ECC key on this implementation, in bits.
291 /* The expected size of input passed to psa_tls12_ecjpake_to_pms_input,
295 /* The size of a serialized K.X coordinate to be used in
304 /** The maximum size of a block cipher. */
307 /** The size of the output of psa_mac_sign_finish(), in bytes.
309 * This is also the MAC size that psa_mac_verify_finish() expects.
316 * \param key_bits The size of the MAC key in bits.
320 * \return The MAC size for the specified algorithm with
323 * \return Either 0 or the correct size for a MAC algorithm that
334 /** The maximum size of the output of psa_aead_encrypt(), in bytes.
336 * If the size of the ciphertext buffer is at least this large, it is
338 * insufficient buffer size. Depending on the algorithm, the actual size of
352 * \param plaintext_length Size of the plaintext in bytes.
354 * \return The AEAD ciphertext size for the specified
365 /** A sufficient output buffer size for psa_aead_encrypt(), for any of the
368 * If the size of the ciphertext buffer is at least this large, it is guaranteed
369 * that psa_aead_encrypt() will not fail due to an insufficient buffer size.
377 * \param plaintext_length Size of the plaintext in bytes.
379 * \return A sufficient output buffer size for any of the
387 /** The maximum size of the output of psa_aead_decrypt(), in bytes.
389 * If the size of the plaintext buffer is at least this large, it is
391 * insufficient buffer size. Depending on the algorithm, the actual size of
405 * \param ciphertext_length Size of the plaintext in bytes.
407 * \return The AEAD ciphertext size for the specified
419 /** A sufficient output buffer size for psa_aead_decrypt(), for any of the
422 * If the size of the plaintext buffer is at least this large, it is guaranteed
423 * that psa_aead_decrypt() will not fail due to an insufficient buffer size.
431 * \param ciphertext_length Size of the ciphertext in bytes.
433 * \return A sufficient output buffer size for any of the
440 /** The default nonce size for an AEAD algorithm, in bytes.
442 * This macro can be used to allocate a buffer of sufficient size to
447 * \note This is not the maximum size of nonce supported as input to
449 * just the default size that is generated by #psa_aead_generate_nonce().
461 * \return The default nonce size for the specified key type and algorithm.
474 /** The maximum default nonce size among all supported pairs of key types and
480 * \note This is not the maximum size of nonce supported as input to
482 * just the largest size that may be generated by
487 /** A sufficient output buffer size for psa_aead_update().
489 * If the size of the output buffer is at least this large, it is
491 * insufficient buffer size. The actual size of the output may be smaller
505 * \param input_length Size of the input in bytes.
507 * \return A sufficient output buffer size for the specified
524 /** A sufficient output buffer size for psa_aead_update(), for any of the
527 * If the size of the output buffer is at least this large, it is guaranteed
528 * that psa_aead_update() will not fail due to an insufficient buffer size.
532 * \param input_length Size of the input in bytes.
537 /** A sufficient ciphertext buffer size for psa_aead_finish().
539 * If the size of the ciphertext buffer is at least this large, it is
541 * insufficient ciphertext buffer size. The actual size of the output may
552 * \return A sufficient ciphertext buffer size for the
564 /** A sufficient ciphertext buffer size for psa_aead_finish(), for any of the
571 /** A sufficient plaintext buffer size for psa_aead_verify().
573 * If the size of the plaintext buffer is at least this large, it is
575 * insufficient plaintext buffer size. The actual size of the output may
586 * \return A sufficient plaintext buffer size for the
598 /** A sufficient plaintext buffer size for psa_aead_verify(), for any of the
611 * \brief ECDSA signature size for a given curve bit size
613 * \param curve_bits Curve size in bits.
614 * \return Signature size in bytes.
621 /** Sufficient signature buffer size for psa_sign_hash().
623 * This macro returns a sufficient buffer size for a signature using a key
624 * of the specified type and size, with the specified algorithm.
625 * Note that the actual size of the signature may be smaller
626 * (some algorithms produce a variable-size signature).
634 * \param key_bits The size of the key in bits.
638 * a buffer size in bytes that guarantees that
642 * return either a sensible size or 0.
656 * Maximum size of an asymmetric signature.
659 * is the maximum size of a signature in bytes.
674 /** Sufficient output buffer size for psa_asymmetric_encrypt().
676 * This macro returns a sufficient buffer size for a ciphertext produced using
677 * a key of the specified type and size, with the specified algorithm.
678 * Note that the actual size of the ciphertext may be smaller, depending
687 * \param key_bits The size of the key in bits.
691 * a buffer size in bytes that guarantees that
695 * return either a sensible size or 0.
704 /** A sufficient output buffer size for psa_asymmetric_encrypt(), for any
713 /** Sufficient output buffer size for psa_asymmetric_decrypt().
715 * This macro returns a sufficient buffer size for a plaintext produced using
716 * a key of the specified type and size, with the specified algorithm.
717 * Note that the actual size of the plaintext may be smaller, depending
726 * \param key_bits The size of the key in bits.
730 * a buffer size in bytes that guarantees that
734 * return either a sensible size or 0.
743 /** A sufficient output buffer size for psa_asymmetric_decrypt(), for any
753 /* Maximum size of the ASN.1 encoding of an INTEGER with the specified
766 /* Maximum size of the export encoding of an RSA public key.
780 /* Maximum size of the export encoding of an RSA key pair.
781 * Assumes that the public exponent is less than 2^32 and that the size
798 * - 7 half-size INTEGERs plus 2 full-size INTEGERs,
799 * overapproximated as 9 half-size INTEGERS;
805 /* Maximum size of the export encoding of a DSA public key.
818 * - 3 full-size INTEGERs (p, g, y);
819 * - 1 + 1 + 32 bytes for 1 sub-size INTEGER (q <= 256 bits).
824 /* Maximum size of the export encoding of a DSA key pair.
837 * - 3 full-size INTEGERs (p, g, y);
838 * - 2 * (1 + 1 + 32) bytes for 2 sub-size INTEGERs (q, x <= 256 bits).
843 /* Maximum size of the export encoding of an ECC public key.
849 * - where m is the bit size associated with the curve.
851 * - 1 byte + 2 * point size.
856 /* Maximum size of the export encoding of an ECC key pair.
863 /* Maximum size of the export encoding of an DH key pair.
870 /* Maximum size of the export encoding of an DH public key.
875 /** Sufficient output buffer size for psa_export_key() or
886 * a key by querying the key type and size at runtime.
904 * \param key_bits The size of the key in bits.
907 * a buffer size in bytes that guarantees that
911 * return either a sensible size or 0.
925 /** Sufficient output buffer size for psa_export_public_key().
935 * a public key by querying the key type and size at runtime.
953 * \param key_bits The size of the key in bits.
956 * a buffer size in bytes that guarantees that
960 * supported, return either a sensible size or 0.
976 /** Sufficient buffer size for exporting any asymmetric key pair.
979 * a sufficient buffer size when calling psa_export_key() to export any
980 * asymmetric key pair, regardless of the exact key type and key size.
1008 /** Sufficient buffer size for exporting any asymmetric public key.
1011 * a sufficient buffer size when calling psa_export_key() or
1013 * regardless of the exact key type and key size.
1045 /** Sufficient output buffer size for psa_raw_key_agreement().
1057 * \param key_bits The size of the key in bits.
1060 * a buffer size in bytes that guarantees that
1064 * is not supported, return either a sensible size or 0.
1072 /** Maximum size of the output from psa_raw_key_agreement().
1075 * maximum size of the output any raw key agreement algorithm, in bytes.
1094 * Since there is no additional PSA_WANT_xxx symbol to specifiy the size of
1113 /** The default IV size for a cipher algorithm, in bytes.
1118 * This macro can be used to allocate a buffer of sufficient size to
1132 * \return The default IV size for the specified key type and algorithm.
1150 /** The maximum IV size for all supported cipher algorithms, in bytes.
1156 /** The maximum size of the output of psa_cipher_encrypt(), in bytes.
1158 * If the size of the output buffer is at least this large, it is guaranteed
1159 * that psa_cipher_encrypt() will not fail due to an insufficient buffer size.
1160 * Depending on the algorithm, the actual size of the output might be smaller.
1172 * \param input_length Size of the input in bytes.
1174 * \return A sufficient output size for the specified key type and
1189 /** A sufficient output buffer size for psa_cipher_encrypt(), for any of the
1192 * If the size of the output buffer is at least this large, it is guaranteed
1193 * that psa_cipher_encrypt() will not fail due to an insufficient buffer size.
1197 * \param input_length Size of the input in bytes.
1205 /** The maximum size of the output of psa_cipher_decrypt(), in bytes.
1207 * If the size of the output buffer is at least this large, it is guaranteed
1208 * that psa_cipher_decrypt() will not fail due to an insufficient buffer size.
1209 * Depending on the algorithm, the actual size of the output might be smaller.
1217 * \param input_length Size of the input in bytes.
1219 * \return A sufficient output size for the specified key type and
1230 /** A sufficient output buffer size for psa_cipher_decrypt(), for any of the
1233 * If the size of the output buffer is at least this large, it is guaranteed
1234 * that psa_cipher_decrypt() will not fail due to an insufficient buffer size.
1238 * \param input_length Size of the input in bytes.
1243 /** A sufficient output buffer size for psa_cipher_update().
1245 * If the size of the output buffer is at least this large, it is guaranteed
1246 * that psa_cipher_update() will not fail due to an insufficient buffer size.
1247 * The actual size of the output might be smaller in any given call.
1255 * \param input_length Size of the input in bytes.
1257 * \return A sufficient output size for the specified key type and
1272 /** A sufficient output buffer size for psa_cipher_update(), for any of the
1275 * If the size of the output buffer is at least this large, it is guaranteed
1276 * that psa_cipher_update() will not fail due to an insufficient buffer size.
1280 * \param input_length Size of the input in bytes.
1285 /** A sufficient ciphertext buffer size for psa_cipher_finish().
1287 * If the size of the ciphertext buffer is at least this large, it is
1289 * ciphertext buffer size. The actual size of the output might be smaller in
1298 * \return A sufficient output size for the specified key type and
1309 /** A sufficient ciphertext buffer size for psa_cipher_finish(), for any of the