le_iks_ecc_interface.h
Go to the documentation of this file.
49 //--------------------------------------------------------------------------------------------------53 //--------------------------------------------------------------------------------------------------56 //--------------------------------------------------------------------------------------------------59 * Connect the current client thread to the service providing this API. Block until the service is63 * called before any other functions in this API. Normally, ConnectService is automatically called68 //--------------------------------------------------------------------------------------------------74 //--------------------------------------------------------------------------------------------------77 * Try to connect the current client thread to the service providing this API. Return with an error81 * called before any other functions in this API. Normally, ConnectService is automatically called90 * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).93 //--------------------------------------------------------------------------------------------------99 //--------------------------------------------------------------------------------------------------103 * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants106 //--------------------------------------------------------------------------------------------------113 //--------------------------------------------------------------------------------------------------119 * longer a connection to the service, and the functions in this API can't be used. For details, see124 //--------------------------------------------------------------------------------------------------131 //--------------------------------------------------------------------------------------------------138 * This function may be used as part of a key exchange protocol. The shared secret is unpredictable139 * (assuming the private portions of both keys are kept secret) but not uniformly distributed and145 * If the buffer is too small to hold the shared secret the shared secret will be truncated to fit.155 //--------------------------------------------------------------------------------------------------168 //--------------------------------------------------------------------------------------------------176 * bytes. Note that when the key size is 521 bits, zero-valued high-order padding bits are added to191 //--------------------------------------------------------------------------------------------------206 //--------------------------------------------------------------------------------------------------214 * bytes. Note that when the key size is 521 bits, zero-valued high-order padding bits are added to225 //--------------------------------------------------------------------------------------------------240 //--------------------------------------------------------------------------------------------------245 * Hybrid encryption combines an asymmetric encryption system with a symmetric encryption system to250 * ECIES provides hybrid encryption through a method that is more efficient than manually performing252 * generate a shared secret, the shared secret is then used to generate a symmetric key using a KDF271 //--------------------------------------------------------------------------------------------------306 //--------------------------------------------------------------------------------------------------311 * Hybrid encryption combines an asymmetric encryption system with a symmetric encryption system to316 * ECIES provides hybrid encryption through a method that is more efficient than manually performing318 * generate a shared secret, the shared secret is then used to generate a symmetric key using a KDF334 //--------------------------------------------------------------------------------------------------369 //--------------------------------------------------------------------------------------------------371 * Starts a process to encrypt and integrity protect a message with ECIES (Elliptic Curve Integrated374 * Hybrid encryption combines an asymmetric encryption system with a symmetric encryption system to402 * only HKDF requires a salt. If present the salt will be the same size as the hash function output415 //--------------------------------------------------------------------------------------------------434 //--------------------------------------------------------------------------------------------------449 //--------------------------------------------------------------------------------------------------460 //--------------------------------------------------------------------------------------------------473 //--------------------------------------------------------------------------------------------------488 //--------------------------------------------------------------------------------------------------493 * larger than or equal to the maximum authentication tag size then the full authentication tag is507 //--------------------------------------------------------------------------------------------------518 //--------------------------------------------------------------------------------------------------523 * Hybrid encryption combines an asymmetric encryption system with a symmetric encryption system to524 * encrypt (possibly long) messages that can only be decrypted with the holder of the private key.525 * Hybrid encryption is usually accomplished by using a symmetric encryption system to bulk encrypt528 * ECIES provides hybrid encryption through a method that is more efficient than manually performing530 * generate a shared secret, the shared secret is then used to generate a symmetric key using a KDF563 //--------------------------------------------------------------------------------------------------582 //--------------------------------------------------------------------------------------------------595 //--------------------------------------------------------------------------------------------------610 //--------------------------------------------------------------------------------------------------623 //--------------------------------------------------------------------------------------------------void le_iks_ecc_DisconnectService(void)le_result_t le_iks_ecc_Ecies_EncryptPacket(uint64_t keyRef, const uint8_t *labelPtr, size_t labelSize, const uint8_t *aadPtr, size_t aadSize, const uint8_t *plaintextPtr, size_t plaintextSize, uint8_t *ciphertextPtr, size_t *ciphertextSizePtr, uint8_t *ephemKeyPtr, size_t *ephemKeySizePtr, uint8_t *saltPtr, size_t *saltSizePtr, uint8_t *tagPtr, size_t *tagSizePtr)le_result_t le_iks_ecc_Ecdsa_GenSig(uint64_t keyRef, const uint8_t *digestPtr, size_t digestSize, uint8_t *signaturePtr, size_t *signatureSizePtr)le_result_t le_iks_ecc_Ecies_DecryptPacket(uint64_t keyRef, const uint8_t *labelPtr, size_t labelSize, const uint8_t *aadPtr, size_t aadSize, const uint8_t *ephemKeyPtr, size_t ephemKeySize, const uint8_t *saltPtr, size_t saltSize, const uint8_t *ciphertextPtr, size_t ciphertextSize, uint8_t *plaintextPtr, size_t *plaintextSizePtr, const uint8_t *tagPtr, size_t tagSize)void le_iks_ecc_ConnectService(void)le_result_t le_iks_ecc_Ecies_StartDecrypt(uint64_t session, const uint8_t *labelPtr, size_t labelSize, const uint8_t *ephemKeyPtr, size_t ephemKeySize, const uint8_t *saltPtr, size_t saltSize)le_result_t le_iks_ecc_Ecies_StartEncrypt(uint64_t session, const uint8_t *labelPtr, size_t labelSize, uint8_t *ephemKeyPtr, size_t *ephemKeySizePtr, uint8_t *saltPtr, size_t *saltSizePtr)le_result_t le_iks_ecc_Ecies_Encrypt(uint64_t session, const uint8_t *plaintextChunkPtr, size_t plaintextChunkSize, uint8_t *ciphertextChunkPtr, size_t *ciphertextChunkSizePtr)le_result_t le_iks_ecc_Ecies_DoneEncrypt(uint64_t session, uint8_t *tagPtr, size_t *tagSizePtr)le_result_t le_iks_ecc_Ecies_DoneDecrypt(uint64_t session, const uint8_t *tagPtr, size_t tagSize)le_result_t le_iks_ecc_Ecdh_GetSharedSecret(uint64_t privKeyRef, uint64_t pubKeyRef, uint8_t *secretPtr, size_t *secretSizePtr)le_result_t le_iks_ecc_Ecies_ProcessAad(uint64_t session, const uint8_t *aadChunkPtr, size_t aadChunkSize)le_result_t le_iks_ecc_Ecies_Decrypt(uint64_t session, const uint8_t *ciphertextChunkPtr, size_t ciphertextChunkSize, uint8_t *plaintextChunkPtr, size_t *plaintextChunkSizePtr)void(* le_iks_ecc_DisconnectHandler_t)(void *)Definition: le_iks_ecc_interface.h:54LE_FULL_API void le_iks_ecc_SetServerDisconnectHandler(le_iks_ecc_DisconnectHandler_t disconnectHandler, void *contextPtr)le_result_t le_iks_ecc_Ecdsa_VerifySig(uint64_t keyRef, const uint8_t *digestPtr, size_t digestSize, const uint8_t *signaturePtr, size_t signatureSize)le_result_t le_iks_ecc_TryConnectService(void)