71 const uint8_t *label,
const size_t labelLength,
72 const uint8_t *context,
const size_t contextLength,
116 #define ZRTP_CRYPTOAGREEMENT_INVALIDCONTEXT 0x1001 117 #define ZRTP_CRYPTOAGREEMENT_INVALIDMESSAGE 0x1002 118 #define ZRTP_CRYPTOAGREEMENT_INVALIDSELFALGO 0x1003 119 #define ZRTP_CRYPTOAGREEMENT_NOCOMMONALGOFOUND 0x1004 120 #define ZRTP_CRYPTOAGREEMENT_INVALIDCIPHER 0x1005 121 #define ZRTP_CRYPTOAGREEMENT_INVALIDHASH 0x1006 122 #define ZRTP_CRYPTOAGREEMENT_INVALIDAUTHTAG 0x1007 123 #define ZRTP_CRYPTOAGREEMENT_INVALIDSAS 0x1008 #define BZRTP_EXPORT
Definition: bzrtp.h:41
uint16_t bzrtp_computeCommitMessageVariableLength(uint8_t keyAgreementAlgo)
Definition: cryptoUtils.cc:1320
int bzrtp_destroyKEMContext(bzrtp_KEMContext_t *ctx)
Definition: cryptoUtils.cc:1552
int bzrtp_KEM_generateKeyPair(bzrtp_KEMContext_t *ctx)
Definition: cryptoUtils.cc:1532
void bzrtp_destroyKeyMaterial(bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpChannelContext)
Destroy all the key material of a channel context.
Definition: cryptoUtils.cc:1076
unsigned short uint16_t
Definition: stdint.h:79
struct bzrtp_KEMContext_struct bzrtp_KEMContext_t
Definition: cryptoUtils.h:269
unsigned char uint8_t
Definition: stdint.h:78
int bzrtp_KEM_getPublicKey(bzrtp_KEMContext_t *ctx, uint8_t *publicKey)
Definition: cryptoUtils.cc:1536
int bzrtp_KEM_getSharedSecret(bzrtp_KEMContext_t *ctx, uint8_t *sharedSecret)
Definition: cryptoUtils.cc:1540
int bzrtp_KEM_encaps(bzrtp_KEMContext_t *ctx, uint8_t *publicKey, uint8_t *cipherText)
Definition: cryptoUtils.cc:1544
uint8_t keyAgreementAlgo
Definition: typedef.h:239
void bzrtp_base256(uint32_t sas, char *output, int outputSize)
SAS rendering from 32 bits to pgp word list Function defined in rfc section 5.1.6.
Definition: cryptoUtils.cc:286
BZRTP_EXPORT int bzrtp_cryptoAlgoAgreement(bzrtpContext_t *zrtpContext, bzrtpChannelContext_t *zrtpChannelContext, bzrtpHelloMessage_t *peerHelloMessage)
select a key agreement algorithm from the one available in context and the one provided by peer in He...
Definition: cryptoUtils.cc:427
BZRTP_EXPORT int bzrtp_updateCryptoFunctionPointers(bzrtpChannelContext_t *zrtpChannelContext)
Update context crypto function pointer according to related values of choosen algorithms fields (hash...
Definition: cryptoUtils.cc:588
structure of the ZRTP engine context Store current state, timers, HMAC and encryption keys ...
Definition: typedef.h:235
unsigned int uint32_t
Definition: stdint.h:80
bzrtp_KEMContext_t * bzrtp_createKEMContext(uint8_t keyAgreementAlgo, uint8_t hashAlgo)
Definition: cryptoUtils.cc:1529
bool_t bzrtp_isPostQuantum(uint8_t keyAgreementAlgo)
Check if the keyAgreementAlgo is a post quantum algorithm.
Definition: cryptoUtils.cc:394
BZRTP_EXPORT uint16_t bzrtp_computeKeyAgreementPublicValueLength(uint8_t keyAgreementAlgo, uint8_t messageTyoe)
Definition: cryptoUtils.cc:1209
uint8_t bzrtpUtils_getAllAvailableCryptoTypes(uint8_t algoType, uint8_t availableTypes[256])
Definition: cryptoUtils.cc:39
BZRTP_EXPORT void bzrtp_cryptoAlgoTypeIntToString(uint8_t algoTypeInt, uint8_t algoTypeString[4])
Unmap the string description of algo type to an int defined in cryptoWrapper.h.
Definition: cryptoUtils.cc:931
BZRTP_EXPORT uint32_t bzrtp_CRC32(uint8_t *input, uint16_t length)
CRC32 as defined in RFC4960 Appendix B - Polynomial is 0x1EDC6F41.
Definition: cryptoUtils.cc:363
bool_t bzrtp_isKem(uint8_t keyAgreementAlgo)
Definition: cryptoUtils.cc:1298
int bzrtp_KEM_decaps(bzrtp_KEMContext_t *ctx, uint8_t *cipherText)
Definition: cryptoUtils.cc:1548
BZRTP_EXPORT void bzrtp_addMandatoryCryptoTypesIfNeeded(uint8_t algoType, uint8_t algoTypes[7], uint8_t *algoTypesCount)
add mandatory crypto functions if they are not already included
Definition: cryptoUtils.cc:750
Hello Message rfc 5.2.
Definition: packetParser.h:152
uint8_t bzrtp_selectCommonAlgo(uint8_t masterArray[7], uint8_t masterArrayLength, uint8_t *slaveArray, uint8_t slaveArrayLength, uint8_t commonArray[7])
Select common algorithm from the given array where algo are represented by their 4 chars string defin...
Definition: cryptoUtils.cc:713
void bzrtp_base32(uint32_t sas, char *output, int outputSize)
SAS rendering from 32 bits to 4 characters Function defined in rfc section 5.1.6. ...
Definition: cryptoUtils.cc:274
BZRTP_EXPORT uint8_t bzrtp_cryptoAlgoTypeStringToInt(uint8_t algoType[4], uint8_t algoFamily)
Map the string description of algo type to an int defined in cryptoWrapper.h.
Definition: cryptoUtils.cc:801
The zrtp context of a channel.
Definition: typedef.h:157
BZRTP_EXPORT int bzrtp_keyDerivationFunction(const uint8_t *key, const size_t keyLength, const uint8_t *label, const size_t labelLength, const uint8_t *context, const size_t contextLength, const uint8_t hmacLength, void(*hmacFunction)(const uint8_t *, size_t, const uint8_t *, size_t, uint8_t, uint8_t *), uint8_t *output)
ZRTP Key Derivation Function as in rfc 4.5.1.
Definition: cryptoUtils.cc:227
uint8_t bzrtpUtils_getAvailableCryptoTypes(uint8_t algoType, uint8_t availableTypes[7])
Definition: cryptoUtils.cc:175
uint16_t bzrtp_computeKeyAgreementSharedSecretLength(uint8_t keyAgreementAlgo, uint8_t hashLength)
Definition: cryptoUtils.cc:1252
BZRTP_EXPORT void bzrtp_DestroyKey(uint8_t *key, size_t keyLength, void *rngContext)
Destroy a key by setting it to a random number Key is not freed, caller must deal with memory managem...
Definition: cryptoUtils.cc:1070