60 const uint8_t *label,
const size_t labelLength,
61 const uint8_t *context,
const size_t contextLength,
105 #define ZRTP_CRYPTOAGREEMENT_INVALIDCONTEXT 0x1001 106 #define ZRTP_CRYPTOAGREEMENT_INVALIDMESSAGE 0x1002 107 #define ZRTP_CRYPTOAGREEMENT_INVALIDSELFALGO 0x1003 108 #define ZRTP_CRYPTOAGREEMENT_NOCOMMONALGOFOUND 0x1004 109 #define ZRTP_CRYPTOAGREEMENT_INVALIDCIPHER 0x1005 110 #define ZRTP_CRYPTOAGREEMENT_INVALIDHASH 0x1006 111 #define ZRTP_CRYPTOAGREEMENT_INVALIDAUTHTAG 0x1007 112 #define ZRTP_CRYPTOAGREEMENT_INVALIDSAS 0x1008 uint8_t bzrtp_byteToChar(uint8_t inputByte)
convert a byte which value is in range [0-15] into an hexa char [0-9a-fA-F]
Definition: cryptoUtils.c:903
#define BZRTP_EXPORT
Definition: bzrtp.h:41
uint8_t bzrtp_charToByte(uint8_t inputChar)
convert an hexa char [0-9a-fA-F] into the corresponding unsigned integer value Any invalid char will ...
Definition: cryptoUtils.c:875
unsigned short uint16_t
Definition: stdint.h:79
unsigned char uint8_t
Definition: stdint.h:78
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 uint16_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.c:119
uint8_t selectCommonAlgo(uint8_t masterArray[7], uint8_t masterArrayLength, uint8_t slaveArray[7], 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.c:556
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.c:178
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.c:299
BZRTP_EXPORT int bzrtp_updateCryptoFunctionPointers(bzrtpChannelContext_t *zrtpChannelContext)
Update context crypto function pointer according to related values of choosen algorithms fields (hash...
Definition: cryptoUtils.c:446
structure of the ZRTP engine context Store current state, timers, HMAC and encryption keys ...
Definition: typedef.h:202
unsigned int uint32_t
Definition: stdint.h:80
void bzrtp_int8ToStr(uint8_t *outputString, uint8_t *inputBytes, uint16_t inputBytesLength)
Convert a byte buffer into the corresponding hexadecimal string.
Definition: cryptoUtils.c:859
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.c:741
BZRTP_EXPORT uint32_t bzrtp_CRC32(uint8_t *input, uint16_t length)
CRC32 as defined in RFC4960 Appendix B - Polynomial is 0x1EDC6F41.
Definition: cryptoUtils.c:255
void bzrtp_strToUint8(uint8_t *outputBytes, uint8_t *inputString, uint16_t inputStringLength)
Convert an hexadecimal string into the corresponding byte buffer.
Definition: cryptoUtils.c:845
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.c:593
Hello Message rfc 5.2.
Definition: packetParser.h:92
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.c:166
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.c:644
BZRTP_EXPORT void bzrtp_DestroyKey(uint8_t *key, uint8_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.c:832
The zrtp context of a channel.
Definition: typedef.h:132
uint8_t bzrtpUtils_getAvailableCryptoTypes(uint8_t algoType, uint8_t availableTypes[7])
Definition: cryptoUtils.c:35