SDK Crypt API documentation

Version: stable

FUNCTIONS
dmCrypt::Base64Decode() Base64 decode a buffer
dmCrypt::Base64Encode() Base64 encode a buffer
dmCrypt::Decrypt() Decrypt data in place
dmCrypt::Encrypt() Encrypt data in place
dmCrypt::HashMd5() Hash buffer using MD5
dmCrypt::HashSha1() Hash buffer using SHA1
dmCrypt::HashSha256() Hash buffer using SHA256
dmCrypt::HashSha512() Hash buffer using SHA512
ENUMS
Algorithm encryption algorithm enumeration
Result result enumeration

Functions

dmCrypt::Base64Decode()

dmCrypt::Base64Decode(src,src_len,dst,dst_len[in,out])

Base64 decode a buffer

PARAMETERS

src const uint8_t* The source data to encode
src_len uint32_t key The length of source data in bytes
dst uint8_t* The destination buffer
dst_len[in,out] uint32_t* In: The length of the destination in bytes. Out: The length of the decoded string.

RETURNS

success bool true if the decoding went ok

dmCrypt::Base64Encode()

dmCrypt::Base64Encode(src,src_len,dst,dst_len[in,out])

Base64 encode a buffer

PARAMETERS

src const uint8_t* The source data to encode
src_len uint32_t key The length of source data in bytes
dst uint8_t* The destination buffer
dst_len[in,out] uint32_t* In: The length of the destination in bytes. Out: The length of the encoded string.

RETURNS

success bool true if the encoding went ok

dmCrypt::Decrypt()

dmCrypt::Decrypt(algo,data,datalen,key,keylen)

Decrypt data in place

PARAMETERS

algo dmCrypt::Algorithm algorithm
data const uint8_t* data
datalen uint32_t data length in bytes
key const uint8_t* key
keylen uint32_t key length

RETURNS

result dmCrypt::Result the decryption result

dmCrypt::Encrypt()

dmCrypt::Encrypt(algo,data,datalen,key,keylen)

Encrypt data in place

PARAMETERS

algo dmCrypt::Algorithm algorithm
data const uint8_t* data
datalen uint32_t data length in bytes
key const uint8_t* key
keylen uint32_t key length

RETURNS

result dmCrypt::Result the encryption result

dmCrypt::HashMd5()

dmCrypt::HashMd5(buf,buflen,digest)

Hash buffer using MD5

PARAMETERS

buf const uint8_t* The source data to hash
buflen uint32_t key The length of source data in bytes
digest const uint8_t* The destination buffer (16 bytes)

dmCrypt::HashSha1()

dmCrypt::HashSha1(buf,buflen,digest)

Hash buffer using SHA1

PARAMETERS

buf const uint8_t* The source data to hash
buflen uint32_t The length of source data in bytes
digest uint8_t* The destination buffer (20 bytes)

dmCrypt::HashSha256()

dmCrypt::HashSha256(buf,buflen,digest)

Hash buffer using SHA256

PARAMETERS

buf const uint8_t* The source data to hash
buflen uint32_t key The length of source data in bytes
digest uint8_t* The destination buffer (32 bytes)

dmCrypt::HashSha512()

dmCrypt::HashSha512(buf,buflen,digest)

Hash buffer using SHA512

PARAMETERS

buf const uint8_t* The source data to hash
buflen uint32_t key The length of source data in bytes
digest uint8_t* The destination buffer (64 bytes)