LibreOffice: rtl/digest.h File Reference

LibreOffice LibreOffice 7.3 SDK C/C++ API Reference

Loading...
Searching...
No Matches
Macros | Typedefs | Enumerations | Functions
digest.h File Reference
`#include "sal/config.h"`
`#include "sal/saldllapi.h"`
`#include "sal/types.h"`

Go to the source code of this file.

## Macros
#define | RTL_DIGEST_LENGTH_MD2 16
#define | RTL_DIGEST_LENGTH_MD5 16
#define | RTL_DIGEST_LENGTH_SHA 20
#define | RTL_DIGEST_LENGTH_SHA1 20
#define | RTL_DIGEST_LENGTH_HMAC_MD5 RTL_DIGEST_LENGTH_MD5
#define | RTL_DIGEST_LENGTH_HMAC_SHA1 RTL_DIGEST_LENGTH_SHA1

## Typedefs
typedef void * | rtlDigest
| Digest Handle opaque type.
typedef enum __rtl_DigestAlgorithm | rtlDigestAlgorithm
| Digest Algorithm type.
typedef enum __rtl_DigestError | rtlDigestError
| Error Code type.

## Enumerations
enum | __rtl_DigestAlgorithm { rtl_Digest_AlgorithmMD2 , rtl_Digest_AlgorithmMD5 , rtl_Digest_AlgorithmSHA , rtl_Digest_AlgorithmSHA1 , rtl_Digest_AlgorithmHMAC_MD5 , rtl_Digest_AlgorithmHMAC_SHA1 , rtl_Digest_AlgorithmInvalid , rtl_Digest_Algorithm_FORCE_EQUAL_SIZE = SAL_MAX_ENUM }
| Digest Algorithm enumeration. More...
enum | __rtl_DigestError { rtl_Digest_E_None , rtl_Digest_E_Argument , rtl_Digest_E_Algorithm , rtl_Digest_E_BufferSize , rtl_Digest_E_Memory , rtl_Digest_E_Unknown , rtl_Digest_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM }
| Error Code enumeration. More...

## Functions
SAL_DLLPUBLIC rtlDigest | rtl_digest_create (rtlDigestAlgorithm Algorithm) SAL_THROW_EXTERN_C()
| Create a digest handle for the given algorithm.
SAL_DLLPUBLIC void | rtl_digest_destroy (rtlDigest Digest) SAL_THROW_EXTERN_C()
| Destroy a digest handle.
SAL_DLLPUBLIC rtlDigestAlgorithm | rtl_digest_queryAlgorithm (rtlDigest Digest) SAL_THROW_EXTERN_C()
| Query the algorithm of a given digest.
SAL_DLLPUBLIC sal_uInt32 | rtl_digest_queryLength (rtlDigest Digest) SAL_THROW_EXTERN_C()
| Query the length of a given digest.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_init (rtlDigest Digest, const sal_uInt8 *pData, sal_uInt32 nDatLen) SAL_THROW_EXTERN_C()
| Initialize a digest with given data.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_update (rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) SAL_THROW_EXTERN_C()
| Update a digest with given data.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_get (rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Finalize a digest and retrieve the digest value.
SAL_DLLPUBLIC rtlDigest | rtl_digest_createMD2 (void) SAL_THROW_EXTERN_C()
| Create a MD2 digest handle.
SAL_DLLPUBLIC void | rtl_digest_destroyMD2 (rtlDigest Digest) SAL_THROW_EXTERN_C()
| Destroy a MD2 digest handle.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_updateMD2 (rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) SAL_THROW_EXTERN_C()
| Update a MD2 digest with given data.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_getMD2 (rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Finalize a MD2 digest and retrieve the digest value.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_MD2 (const void *pData, sal_uInt32 nDatLen, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Evaluate a MD2 digest value from given data.
SAL_DLLPUBLIC rtlDigest | rtl_digest_createMD5 (void) SAL_THROW_EXTERN_C()
| Create a MD5 digest handle.
SAL_DLLPUBLIC void | rtl_digest_destroyMD5 (rtlDigest Digest) SAL_THROW_EXTERN_C()
| Destroy a MD5 digest handle.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_updateMD5 (rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) SAL_THROW_EXTERN_C()
| Update a MD5 digest with given data.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_getMD5 (rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Finalize a MD5 digest and retrieve the digest value.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_rawMD5 (rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Retrieve the raw (not finalized) MD5 digest value.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_MD5 (const void *pData, sal_uInt32 nDatLen, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Evaluate a MD5 digest value from given data.
SAL_DLLPUBLIC rtlDigest | rtl_digest_createSHA (void) SAL_THROW_EXTERN_C()
| Create a SHA digest handle.
SAL_DLLPUBLIC void | rtl_digest_destroySHA (rtlDigest Digest) SAL_THROW_EXTERN_C()
| Destroy a SHA digest handle.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_updateSHA (rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) SAL_THROW_EXTERN_C()
| Update a SHA digest with given data.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_getSHA (rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Finalize a SHA digest and retrieve the digest value.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_SHA (const void *pData, sal_uInt32 nDatLen, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Evaluate a SHA digest value from given data.
SAL_DLLPUBLIC rtlDigest | rtl_digest_createSHA1 (void) SAL_THROW_EXTERN_C()
| Create a SHA1 digest handle.
SAL_DLLPUBLIC void | rtl_digest_destroySHA1 (rtlDigest Digest) SAL_THROW_EXTERN_C()
| Destroy a SHA1 digest handle.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_updateSHA1 (rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) SAL_THROW_EXTERN_C()
| Update a SHA1 digest with given data.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_getSHA1 (rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Finalize a SHA1 digest and retrieve the digest value.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_SHA1 (const void *pData, sal_uInt32 nDatLen, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Evaluate a SHA1 digest value from given data.
SAL_DLLPUBLIC rtlDigest | rtl_digest_createHMAC_MD5 (void) SAL_THROW_EXTERN_C()
| Create a HMAC_MD5 digest handle.
SAL_DLLPUBLIC void | rtl_digest_destroyHMAC_MD5 (rtlDigest Digest) SAL_THROW_EXTERN_C()
| Destroy a HMAC_MD5 digest handle.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_initHMAC_MD5 (rtlDigest Digest, const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen) SAL_THROW_EXTERN_C()
| Initialize a HMAC_MD5 digest.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_updateHMAC_MD5 (rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) SAL_THROW_EXTERN_C()
| Update a HMAC_MD5 digest with given data.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_getHMAC_MD5 (rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Finalize a HMAC_MD5 digest and retrieve the digest value.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_HMAC_MD5 (const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen, const void *pData, sal_uInt32 nDatLen, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Evaluate a HMAC_MD5 digest value from given data.
SAL_DLLPUBLIC rtlDigest | rtl_digest_createHMAC_SHA1 (void) SAL_THROW_EXTERN_C()
| Create a HMAC_SHA1 digest handle.
SAL_DLLPUBLIC void | rtl_digest_destroyHMAC_SHA1 (rtlDigest Digest) SAL_THROW_EXTERN_C()
| Destroy a HMAC_SHA1 digest handle.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_initHMAC_SHA1 (rtlDigest Digest, const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen) SAL_THROW_EXTERN_C()
| Initialize a HMAC_SHA1 digest.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_updateHMAC_SHA1 (rtlDigest Digest, const void *pData, sal_uInt32 nDatLen) SAL_THROW_EXTERN_C()
| Update a HMAC_SHA1 digest with given data.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_getHMAC_SHA1 (rtlDigest Digest, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Finalize a HMAC_SHA1 digest and retrieve the digest value.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_HMAC_SHA1 (const sal_uInt8 *pKeyData, sal_uInt32 nKeyLen, const void *pData, sal_uInt32 nDatLen, sal_uInt8 *pBuffer, sal_uInt32 nBufLen) SAL_THROW_EXTERN_C()
| Evaluate a HMAC_SHA1 digest value from given data.
SAL_DLLPUBLIC rtlDigestError | rtl_digest_PBKDF2 (sal_uInt8 *pKeyData, sal_uInt32 nKeyLen, const sal_uInt8 *pPassData, sal_uInt32 nPassLen, const sal_uInt8 *pSaltData, sal_uInt32 nSaltLen, sal_uInt32 nCount) SAL_THROW_EXTERN_C()
| Password-Based Key Derivation Function.

## Macro Definition Documentation

## ◆ RTL_DIGEST_LENGTH_HMAC_MD5

#define RTL_DIGEST_LENGTH_HMAC_MD5 RTL_DIGEST_LENGTH_MD5

## ◆ RTL_DIGEST_LENGTH_HMAC_SHA1

#define RTL_DIGEST_LENGTH_HMAC_SHA1 RTL_DIGEST_LENGTH_SHA1

## ◆ RTL_DIGEST_LENGTH_MD2

#define RTL_DIGEST_LENGTH_MD2 16

## ◆ RTL_DIGEST_LENGTH_MD5

#define RTL_DIGEST_LENGTH_MD5 16

## ◆ RTL_DIGEST_LENGTH_SHA

#define RTL_DIGEST_LENGTH_SHA 20

## ◆ RTL_DIGEST_LENGTH_SHA1

#define RTL_DIGEST_LENGTH_SHA1 20

## Typedef Documentation

## ◆ rtlDigest

typedef void* rtlDigest

Digest Handle opaque type.

## ◆ rtlDigestAlgorithm

typedef enum __rtl_DigestAlgorithm rtlDigestAlgorithm

Digest Algorithm type.

## ◆ rtlDigestError

typedef enum __rtl_DigestError rtlDigestError

Error Code type.

## Enumeration Type Documentation

## ◆ __rtl_DigestAlgorithm

enum __rtl_DigestAlgorithm

Digest Algorithm enumeration.

See also
  rtl_digest_create()

Enumerator
rtl_Digest_AlgorithmMD2 |
rtl_Digest_AlgorithmMD5 |
rtl_Digest_AlgorithmSHA |
rtl_Digest_AlgorithmSHA1 |
rtl_Digest_AlgorithmHMAC_MD5 |
rtl_Digest_AlgorithmHMAC_SHA1 |
rtl_Digest_AlgorithmInvalid |
rtl_Digest_Algorithm_FORCE_EQUAL_SIZE |

## ◆ __rtl_DigestError

enum __rtl_DigestError

Error Code enumeration.

Enumerator
rtl_Digest_E_None |
rtl_Digest_E_Argument |
rtl_Digest_E_Algorithm |
rtl_Digest_E_BufferSize |
rtl_Digest_E_Memory |
rtl_Digest_E_Unknown |
rtl_Digest_E_FORCE_EQUAL_SIZE |

## Function Documentation

## ◆ rtl_digest_create()

SAL_DLLPUBLIC rtlDigest rtl_digest_create | ( | rtlDigestAlgorithm | Algorithm | ) |

Create a digest handle for the given algorithm.

See also
  rtlDigestAlgorithm

Parameters

  [in] | Algorithm | digest algorithm.

Returns
  Digest handle, or 0 upon failure.

## ◆ rtl_digest_createHMAC_MD5()

SAL_DLLPUBLIC rtlDigest rtl_digest_createHMAC_MD5 | ( | void |  | ) |

Create a HMAC_MD5 digest handle.

The HMAC_MD5 digest algorithm is specified in

RFC 2104 (Informational) HMAC: Keyed-Hashing for Message Authentication

See also
  rtl_digest_create()

## ◆ rtl_digest_createHMAC_SHA1()

SAL_DLLPUBLIC rtlDigest rtl_digest_createHMAC_SHA1 | ( | void |  | ) |

Create a HMAC_SHA1 digest handle.

The HMAC_SHA1 digest algorithm is specified in RFC 2104 (Informational) HMAC: Keyed-Hashing for Message Authentication RFC 2898 (Informational) PKCS #5: Password-Based Cryptography Specification Version 2.0

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_create()

## ◆ rtl_digest_createMD2()

SAL_DLLPUBLIC rtlDigest rtl_digest_createMD2 | ( | void |  | ) |

Create a MD2 digest handle.

The MD2 digest algorithm is specified in RFC 1319 (Informational) The MD2 Message-Digest Algorithm

See also
  rtl_digest_create()

## ◆ rtl_digest_createMD5()

SAL_DLLPUBLIC rtlDigest rtl_digest_createMD5 | ( | void |  | ) |

Create a MD5 digest handle.

The MD5 digest algorithm is specified in RFC 1321 (Informational) The MD5 Message-Digest Algorithm

See also
  rtl_digest_create()

## ◆ rtl_digest_createSHA()

SAL_DLLPUBLIC rtlDigest rtl_digest_createSHA | ( | void |  | ) |

Create a SHA digest handle.

The SHA digest algorithm is specified in FIPS PUB 180 (Superseded by FIPS PUB 180-1) Secure Hash Standard

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_create()

## ◆ rtl_digest_createSHA1()

SAL_DLLPUBLIC rtlDigest rtl_digest_createSHA1 | ( | void |  | ) |

Create a SHA1 digest handle.

The SHA1 digest algorithm is specified in FIPS PUB 180-1 (Supersedes FIPS PUB 180) Secure Hash Standard

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_create()

## ◆ rtl_digest_destroy()

SAL_DLLPUBLIC void rtl_digest_destroy | ( | rtlDigest | Digest | ) |

Destroy a digest handle.

Postcondition
  Digest handle destroyed and invalid.

Parameters

  [in] | Digest | digest handle to be destroyed.

Returns
  None.

## ◆ rtl_digest_destroyHMAC_MD5()

SAL_DLLPUBLIC void rtl_digest_destroyHMAC_MD5 | ( | rtlDigest | Digest | ) |

Destroy a HMAC_MD5 digest handle.

See also
  rtl_digest_destroy()

## ◆ rtl_digest_destroyHMAC_SHA1()

SAL_DLLPUBLIC void rtl_digest_destroyHMAC_SHA1 | ( | rtlDigest | Digest | ) |

Destroy a HMAC_SHA1 digest handle.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_destroy()

## ◆ rtl_digest_destroyMD2()

SAL_DLLPUBLIC void rtl_digest_destroyMD2 | ( | rtlDigest | Digest | ) |

Destroy a MD2 digest handle.

See also
  rtl_digest_destroy()

## ◆ rtl_digest_destroyMD5()

SAL_DLLPUBLIC void rtl_digest_destroyMD5 | ( | rtlDigest | Digest | ) |

Destroy a MD5 digest handle.

See also
  rtl_digest_destroy()

## ◆ rtl_digest_destroySHA()

SAL_DLLPUBLIC void rtl_digest_destroySHA | ( | rtlDigest | Digest | ) |

Destroy a SHA digest handle.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_destroy()

## ◆ rtl_digest_destroySHA1()

SAL_DLLPUBLIC void rtl_digest_destroySHA1 | ( | rtlDigest | Digest | ) |

Destroy a SHA1 digest handle.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_destroy()

## ◆ rtl_digest_get()

SAL_DLLPUBLIC rtlDigestError rtl_digest_get | ( | rtlDigest | Digest,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Finalize a digest and retrieve the digest value.

Precondition
  Digest value length must not be less than digest length.

Postcondition
  Digest initialized to accept another update sequence.

See also
  rtl_digest_queryLength()
  rtl_digest_update()

Parameters

  [in] | Digest | digest handle.
  [in] | pBuffer | digest value buffer.
  [in] | nBufLen | digest value length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_getHMAC_MD5()

SAL_DLLPUBLIC rtlDigestError rtl_digest_getHMAC_MD5 | ( | rtlDigest | Digest,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Finalize a HMAC_MD5 digest and retrieve the digest value.

See also
  rtl_digest_get()

## ◆ rtl_digest_getHMAC_SHA1()

SAL_DLLPUBLIC rtlDigestError rtl_digest_getHMAC_SHA1 | ( | rtlDigest | Digest,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Finalize a HMAC_SHA1 digest and retrieve the digest value.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_get()

## ◆ rtl_digest_getMD2()

SAL_DLLPUBLIC rtlDigestError rtl_digest_getMD2 | ( | rtlDigest | Digest,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Finalize a MD2 digest and retrieve the digest value.

See also
  rtl_digest_get()

## ◆ rtl_digest_getMD5()

SAL_DLLPUBLIC rtlDigestError rtl_digest_getMD5 | ( | rtlDigest | Digest,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Finalize a MD5 digest and retrieve the digest value.

See also
  rtl_digest_get()

## ◆ rtl_digest_getSHA()

SAL_DLLPUBLIC rtlDigestError rtl_digest_getSHA | ( | rtlDigest | Digest,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Finalize a SHA digest and retrieve the digest value.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_get()

## ◆ rtl_digest_getSHA1()

SAL_DLLPUBLIC rtlDigestError rtl_digest_getSHA1 | ( | rtlDigest | Digest,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Finalize a SHA1 digest and retrieve the digest value.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_get()

## ◆ rtl_digest_HMAC_MD5()

SAL_DLLPUBLIC rtlDigestError rtl_digest_HMAC_MD5 | ( | const sal_uInt8 * | pKeyData,
|  | sal_uInt32 | nKeyLen,
|  | const void * | pData,
|  | sal_uInt32 | nDatLen,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Evaluate a HMAC_MD5 digest value from given data.

This function performs an optimized call sequence on a single data buffer, avoiding digest creation and destruction.

See also
  rtl_digest_initHMAC_MD5()
  rtl_digest_updateHMAC_MD5()
  rtl_digest_getHMAC_MD5()

Parameters

  [in] | pKeyData | key material buffer.
  [in] | nKeyLen | key material length.
  [in] | pData | data buffer.
  [in] | nDatLen | data length.
  [in] | pBuffer | digest value buffer.
  [in] | nBufLen | digest value length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_HMAC_SHA1()

SAL_DLLPUBLIC rtlDigestError rtl_digest_HMAC_SHA1 | ( | const sal_uInt8 * | pKeyData,
|  | sal_uInt32 | nKeyLen,
|  | const void * | pData,
|  | sal_uInt32 | nDatLen,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Evaluate a HMAC_SHA1 digest value from given data.

This function performs an optimized call sequence on a single data buffer, avoiding digest creation and destruction.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_initHMAC_SHA1()
  rtl_digest_updateHMAC_SHA1()
  rtl_digest_getHMAC_SHA1()

Parameters

  [in] | pKeyData | key material buffer.
  [in] | nKeyLen | key material length.
  [in] | pData | data buffer.
  [in] | nDatLen | data length.
  [in] | pBuffer | digest value buffer.
  [in] | nBufLen | digest value length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_init()

SAL_DLLPUBLIC rtlDigestError rtl_digest_init | ( | rtlDigest | Digest,
|  | const sal_uInt8 * | pData,
|  | sal_uInt32 | nDatLen
| ) |  |

Initialize a digest with given data.

Parameters

  [in] | Digest | digest handle.
  [in] | pData | data buffer.
  [in] | nDatLen | data length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_initHMAC_MD5()

SAL_DLLPUBLIC rtlDigestError rtl_digest_initHMAC_MD5 | ( | rtlDigest | Digest,
|  | const sal_uInt8 * | pKeyData,
|  | sal_uInt32 | nKeyLen
| ) |  |

Initialize a HMAC_MD5 digest.

See also
  rtl_digest_init()

Parameters

  [in] | Digest | digest handle.
  [in] | pKeyData | key material buffer.
  [in] | nKeyLen | key material length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_initHMAC_SHA1()

SAL_DLLPUBLIC rtlDigestError rtl_digest_initHMAC_SHA1 | ( | rtlDigest | Digest,
|  | const sal_uInt8 * | pKeyData,
|  | sal_uInt32 | nKeyLen
| ) |  |

Initialize a HMAC_SHA1 digest.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_init()

Parameters

  [in] | Digest | digest handle.
  [in] | pKeyData | key material buffer.
  [in] | nKeyLen | key material length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_MD2()

SAL_DLLPUBLIC rtlDigestError rtl_digest_MD2 | ( | const void * | pData,
|  | sal_uInt32 | nDatLen,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Evaluate a MD2 digest value from given data.

This function performs an optimized call sequence on a single data buffer, avoiding digest creation and destruction.

See also
  rtl_digest_updateMD2()
  rtl_digest_getMD2()

Parameters

  [in] | pData | data buffer.
  [in] | nDatLen | data length.
  [in] | pBuffer | digest value buffer.
  [in] | nBufLen | digest value length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_MD5()

SAL_DLLPUBLIC rtlDigestError rtl_digest_MD5 | ( | const void * | pData,
|  | sal_uInt32 | nDatLen,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Evaluate a MD5 digest value from given data.

This function performs an optimized call sequence on a single data buffer, avoiding digest creation and destruction.

See also
  rtl_digest_updateMD5()
  rtl_digest_getMD5()

Parameters

  [in] | pData | data buffer.
  [in] | nDatLen | data length.
  [in] | pBuffer | digest value buffer.
  [in] | nBufLen | digest value length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_PBKDF2()

SAL_DLLPUBLIC rtlDigestError rtl_digest_PBKDF2 | ( | sal_uInt8 * | pKeyData,
|  | sal_uInt32 | nKeyLen,
|  | const sal_uInt8 * | pPassData,
|  | sal_uInt32 | nPassLen,
|  | const sal_uInt8 * | pSaltData,
|  | sal_uInt32 | nSaltLen,
|  | sal_uInt32 | nCount
| ) |  |

Password-Based Key Derivation Function.

The PBKDF2 key derivation function is specified in RFC 2898 (Informational) PKCS #5: Password-Based Cryptography Specification Version 2.0

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility or if the input is guaranteed to have a good length by a start-key derivation round.

Parameters

  [out] | pKeyData | derived key
  [in] | nKeyLen | derived key length
  [in] | pPassData | password
  [in] | nPassLen | password length
  [in] | pSaltData | salt
  [in] | nSaltLen | salt length
  [in] | nCount | iteration count

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_queryAlgorithm()

SAL_DLLPUBLIC rtlDigestAlgorithm rtl_digest_queryAlgorithm | ( | rtlDigest | Digest | ) |

Query the algorithm of a given digest.

Parameters

  [in] | Digest | digest handle.

Returns
  digest algorithm, or `rtl_Digest_AlgorithmInvalid` upon failure.

## ◆ rtl_digest_queryLength()

SAL_DLLPUBLIC sal_uInt32 rtl_digest_queryLength | ( | rtlDigest | Digest | ) |

Query the length of a given digest.

Parameters

  [in] | Digest | digest handle.

Returns
  digest length, or 0 upon failure.

## ◆ rtl_digest_rawMD5()

SAL_DLLPUBLIC rtlDigestError rtl_digest_rawMD5 | ( | rtlDigest | Digest,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Retrieve the raw (not finalized) MD5 digest value.

This function is a non-standard replacement for rtl_digest_getMD5() and must be used with caution.

Postcondition
  Digest initialized to accept another update sequence.

See also
  rtl_digest_get()

## ◆ rtl_digest_SHA()

SAL_DLLPUBLIC rtlDigestError rtl_digest_SHA | ( | const void * | pData,
|  | sal_uInt32 | nDatLen,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Evaluate a SHA digest value from given data.

This function performs an optimized call sequence on a single data buffer, avoiding digest creation and destruction.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_updateSHA()
  rtl_digest_getSHA()

Parameters

  [in] | pData | data buffer.
  [in] | nDatLen | data length.
  [in] | pBuffer | digest value buffer.
  [in] | nBufLen | digest value length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_SHA1()

SAL_DLLPUBLIC rtlDigestError rtl_digest_SHA1 | ( | const void * | pData,
|  | sal_uInt32 | nDatLen,
|  | sal_uInt8 * | pBuffer,
|  | sal_uInt32 | nBufLen
| ) |  |

Evaluate a SHA1 digest value from given data.

This function performs an optimized call sequence on a single data buffer, avoiding digest creation and destruction.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_updateSHA1()
  rtl_digest_getSHA1()

Parameters

  [in] | pData | data buffer.
  [in] | nDatLen | data length.
  [in] | pBuffer | digest value buffer.
  [in] | nBufLen | digest value length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_update()

SAL_DLLPUBLIC rtlDigestError rtl_digest_update | ( | rtlDigest | Digest,
|  | const void * | pData,
|  | sal_uInt32 | nDatLen
| ) |  |

Update a digest with given data.

Parameters

  [in] | Digest | digest handle.
  [in] | pData | data buffer.
  [in] | nDatLen | data length.

Return values

  rtl_Digest_E_None | upon success.

## ◆ rtl_digest_updateHMAC_MD5()

SAL_DLLPUBLIC rtlDigestError rtl_digest_updateHMAC_MD5 | ( | rtlDigest | Digest,
|  | const void * | pData,
|  | sal_uInt32 | nDatLen
| ) |  |

Update a HMAC_MD5 digest with given data.

See also
  rtl_digest_update()

## ◆ rtl_digest_updateHMAC_SHA1()

SAL_DLLPUBLIC rtlDigestError rtl_digest_updateHMAC_SHA1 | ( | rtlDigest | Digest,
|  | const void * | pData,
|  | sal_uInt32 | nDatLen
| ) |  |

Update a HMAC_SHA1 digest with given data.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_update()

## ◆ rtl_digest_updateMD2()

SAL_DLLPUBLIC rtlDigestError rtl_digest_updateMD2 | ( | rtlDigest | Digest,
|  | const void * | pData,
|  | sal_uInt32 | nDatLen
| ) |  |

Update a MD2 digest with given data.

See also
  rtl_digest_update()

## ◆ rtl_digest_updateMD5()

SAL_DLLPUBLIC rtlDigestError rtl_digest_updateMD5 | ( | rtlDigest | Digest,
|  | const void * | pData,
|  | sal_uInt32 | nDatLen
| ) |  |

Update a MD5 digest with given data.

See also
  rtl_digest_update()

## ◆ rtl_digest_updateSHA()

SAL_DLLPUBLIC rtlDigestError rtl_digest_updateSHA | ( | rtlDigest | Digest,
|  | const void * | pData,
|  | sal_uInt32 | nDatLen
| ) |  |

Update a SHA digest with given data.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_update()

## ◆ rtl_digest_updateSHA1()

SAL_DLLPUBLIC rtlDigestError rtl_digest_updateSHA1 | ( | rtlDigest | Digest,
|  | const void * | pData,
|  | sal_uInt32 | nDatLen
| ) |  |

Update a SHA1 digest with given data.

Deprecated:
  The implementation is buggy and generates incorrect results for 52 <= (len % 64) <= 55; use only for bug-compatibility.

See also
  rtl_digest_update()