crypto_builtin_key_derivation.h
mbedtls/private_access.h
psa/crypto_driver_common.h
crypto_driver_contexts_key_derivation.h
mbedtls/build_info.h
mbedtls/check_config.h
mbedtls/config_adjust_legacy_crypto.h
mbedtls/config_adjust_psa_from_legacy.h
mbedtls/config_adjust_psa_superset_legacy.h
mbedtls/config_adjust_ssl.h
mbedtls/config_adjust_x509.h
mbedtls/config_psa.h
mbedtls/mbedtls_config.h
mbedtls/private_access.h
psa/build_info.h
psa/crypto_adjust_auto_enabled.h
psa/crypto_adjust_config_dependencies.h
psa/crypto_adjust_config_key_pair_types.h
psa/crypto_adjust_config_synonyms.h
crypto_builtin_key_derivation.h
psa/crypto_driver_common.h
psa/crypto_legacy.h
crypto_platform.h
psa/crypto_sizes.h
crypto_types.h
crypto_values.h
limits.h
stddef.h
stdint.h
debug.h
net_sockets.h
oid.h
pk.h
pkcs7.h
psa_util.h
ssl.h
ssl_cache.h
ssl_ciphersuites.h
ssl_cookie.h
ssl_ticket.h
x509.h
x509_crl.h
x509_crt.h
x509_csr.h
crypto.h
crypto_builtin_key_derivation.h
crypto_driver_contexts_key_derivation.h
crypto_struct.h
psa_hkdf_key_derivation_t
psa_tls12_ecjpake_to_pms_t
psa_tls12_prf_key_derivation_s
psa_tls12_prf_key_derivation_state_t
PSA_TLS12_PRF_STATE_INIT
PSA_TLS12_PRF_STATE_SEED_SET
PSA_TLS12_PRF_STATE_OTHER_KEY_SET
PSA_TLS12_PRF_STATE_KEY_SET
PSA_TLS12_PRF_STATE_LABEL_SET
PSA_TLS12_PRF_STATE_OUTPUT
struct psa_tls12_prf_key_derivation_s typedef struct psa_tls12_prf_key_derivation_s psa_tls12_prf_key_derivation_t psa_tls12_prf_key_derivation_t

    /*
    *ContextstructuredeclarationoftheMbedTLSsoftware-basedPSAdrivers
    *calledthroughthePSACryptodriverdispatchlayer.
    *Thisfilecontainsthecontextstructuresofkeyderivationalgorithms
    *whichneedtorelyonotheralgorithms.
    *
    *\noteThisfilemaynotbeincludeddirectly.Applicationsmust
    *includepsa/crypto.h.
    *
    *\noteThisheaderanditscontentarenotpartoftheMbedTLSAPIand
    *applicationsmustnotdependonit.Itsmainpurposeistodefinethe
    *multi-partstateobjectsoftheMbedTLSsoftware-basedPSAdrivers.The
    *definitionsoftheseobjectsarethenusedbycrypto_struct.htodefinethe
    *implementation-definedtypesofPSAmulti-partstateobjects.
    */
    /*
    *CopyrightTheMbedTLSContributors
    *SPDX-License-Identifier:Apache-2.0ORGPL-2.0-or-later
    */

    #ifndefPSA_CRYPTO_BUILTIN_KEY_DERIVATION_H
    #definePSA_CRYPTO_BUILTIN_KEY_DERIVATION_H
    #include"mbedtls/private_access.h"

    #include<psa/crypto_driver_common.h>

    #ifdefined(MBEDTLS_PSA_BUILTIN_ALG_HKDF)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXPAND)
    typedefstruct{
    uint8_t*MBEDTLS_PRIVATE(info);
    size_tMBEDTLS_PRIVATE(info_length);
    #ifPSA_HASH_MAX_SIZE>0xff
    #error"PSA_HASH_MAX_SIZEdoesnotfitinuint8_t"
    #endif
    uint8_tMBEDTLS_PRIVATE(offset_in_block);
    uint8_tMBEDTLS_PRIVATE(block_number);
    unsignedintMBEDTLS_PRIVATE(state):2;
    unsignedintMBEDTLS_PRIVATE(info_set):1;
    uint8_tMBEDTLS_PRIVATE(output_block)[PSA_HASH_MAX_SIZE];
    uint8_tMBEDTLS_PRIVATE(prk)[PSA_HASH_MAX_SIZE];
    structpsa_mac_operation_sMBEDTLS_PRIVATE(hmac);
    }psa_hkdf_key_derivation_t;
    #endif/*MBEDTLS_PSA_BUILTIN_ALG_HKDF||
    MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXTRACT||
    MBEDTLS_PSA_BUILTIN_ALG_HKDF_EXPAND*/
    #ifdefined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS)
    typedefstruct{
    uint8_tMBEDTLS_PRIVATE(data)[PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE];
    }psa_tls12_ecjpake_to_pms_t;
    #endif/*MBEDTLS_PSA_BUILTIN_ALG_TLS12_ECJPAKE_TO_PMS*/

    #ifdefined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF)||\
    defined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS)
    typedefenum{
    PSA_TLS12_PRF_STATE_INIT,/*noinputprovided*/
    PSA_TLS12_PRF_STATE_SEED_SET,/*seedhasbeenset*/
    PSA_TLS12_PRF_STATE_OTHER_KEY_SET,/*otherkeyhasbeenset-optional*/
    PSA_TLS12_PRF_STATE_KEY_SET,/*keyhasbeenset*/
    PSA_TLS12_PRF_STATE_LABEL_SET,/*labelhasbeenset*/
    PSA_TLS12_PRF_STATE_OUTPUT/*outputhasbeenstarted*/
    }psa_tls12_prf_key_derivation_state_t;

    typedefstructpsa_tls12_prf_key_derivation_s{
    #ifPSA_HASH_MAX_SIZE>0xff
    #error"PSA_HASH_MAX_SIZEdoesnotfitinuint8_t"
    #endif

    /*IndicateshowmanybytesinthecurrentHMACblockhave
    *notyetbeenreadbytheuser.*/
    uint8_tMBEDTLS_PRIVATE(left_in_block);

    /*The1-basednumberoftheblock.*/
    uint8_tMBEDTLS_PRIVATE(block_number);

    psa_tls12_prf_key_derivation_state_tMBEDTLS_PRIVATE(state);

    uint8_t*MBEDTLS_PRIVATE(secret);
    size_tMBEDTLS_PRIVATE(secret_length);
    uint8_t*MBEDTLS_PRIVATE(seed);
    size_tMBEDTLS_PRIVATE(seed_length);
    uint8_t*MBEDTLS_PRIVATE(label);
    size_tMBEDTLS_PRIVATE(label_length);
    #ifdefined(MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS)
    uint8_t*MBEDTLS_PRIVATE(other_secret);
    size_tMBEDTLS_PRIVATE(other_secret_length);
    #endif/*MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS*/

    uint8_tMBEDTLS_PRIVATE(Ai)[PSA_HASH_MAX_SIZE];

    /*`HMAC_hash(prk,A(i)+seed)`inthenotationofRFC5246,Sect.5.*/
    uint8_tMBEDTLS_PRIVATE(output_block)[PSA_HASH_MAX_SIZE];
    }psa_tls12_prf_key_derivation_t;
    #endif/*MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF)||
    *MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS*/
    #ifdefined(PSA_HAVE_SOFT_PBKDF2)
    typedefenum{
    PSA_PBKDF2_STATE_INIT,/*noinputprovided*/
    PSA_PBKDF2_STATE_INPUT_COST_SET,/*inputcosthasbeenset*/
    PSA_PBKDF2_STATE_SALT_SET,/*salthasbeenset*/
    PSA_PBKDF2_STATE_PASSWORD_SET,/*passwordhasbeenset*/
    PSA_PBKDF2_STATE_OUTPUT/*outputhasbeenstarted*/
    }psa_pbkdf2_key_derivation_state_t;

    typedefstruct{
    psa_pbkdf2_key_derivation_state_tMBEDTLS_PRIVATE(state);
    uint64_tMBEDTLS_PRIVATE(input_cost);
    uint8_t*MBEDTLS_PRIVATE(salt);
    size_tMBEDTLS_PRIVATE(salt_length);
    uint8_tMBEDTLS_PRIVATE(password)[PSA_HMAC_MAX_HASH_BLOCK_SIZE];
    size_tMBEDTLS_PRIVATE(password_length);
    uint8_tMBEDTLS_PRIVATE(output_block)[PSA_HASH_MAX_SIZE];
    uint8_tMBEDTLS_PRIVATE(bytes_used);
    uint32_tMBEDTLS_PRIVATE(block_number);
    }psa_pbkdf2_key_derivation_t;
    #endif/*PSA_HAVE_SOFT_PBKDF2*/

    #endif/*PSA_CRYPTO_BUILTIN_KEY_DERIVATION_H*/