SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
SharkSslPSAConsumerPBKDF2.h File Reference
#include "SharkSSL.h"

Go to the source code of this file.

Functions

SHARKSSL_API int SharkSslPSAPBKDF2_derive (U8 *output, const U8 *password, const U8 *salt, psa_algorithm_t alg, U32 passwordLen, U32 saltLen, U32 iterations, U16 outputLen)
 Derive bytes with PSA PBKDF2-HMAC or PBKDF2-AES-CMAC-PRF-128. More...
 

Detailed Description

See Choose a SharkSSL API for build scope and the owning API layer.

Function Documentation

◆ SharkSslPSAPBKDF2_derive()

int SharkSslPSAPBKDF2_derive ( U8 *  output,
const U8 *  password,
const U8 *  salt,
psa_algorithm_t  alg,
U32  passwordLen,
U32  saltLen,
U32  iterations,
U16  outputLen 
)

Derive bytes with PSA PBKDF2-HMAC or PBKDF2-AES-CMAC-PRF-128.

The caller owns output and supplies its exact size in outputLen. Returns zero on success; clears output and returns -1 on failure.

Parameters
outputU8 *; required caller-owned buffer of outputLen bytes; cleared on failure after output validation.
passwordconst U8 *; password bytes, or NULL with passwordLen=0.
saltconst U8 *; salt bytes, or NULL with saltLen=0.
algpsa_algorithm_t; a supported PSA_ALG_PBKDF2_HMAC(hash), or PSA_ALG_PBKDF2_AES_CMAC_PRF_128 when declared.
passwordLenU32; password byte count.
saltLenU32; salt byte count.
iterationsU32; positive iteration count.
outputLenU16; positive requested derived length in bytes.
Returns
int: 0 on success; -1 for invalid arguments, unsupported algorithms/policies, or provider failure.