Files
qt6-migration-pipeline/external/rti_connext_dds-7.7.0/include/ndds/osapi/osapi_sha1.h
T
torstenandCopilot 342ffd3e5c Update submodule to latest BUILD_RTI fixes
- HandlerMinelayerData: BUILD_RTI Guards für RTI-Abhängigkeiten
- svcTabCommon: Export-Header-Fix via Fallback-Target
- TrainingAreaBase: Stub-Header für BUILD_RTI=OFF
- ddsfts: Include-Pfad und Dependency-Fixes
- BUILD_RTI=OFF Compilation vollständig unterstützt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Entire-Checkpoint: 01M0JNZA586SACX1PRZ2DJAE5S
2026-08-21 19:30:20 +02:00

103 lines
2.9 KiB
C

/*
* (c) Copyright, Real-Time Innovations, 2025.
* All rights reserved.
*
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*/
#ifndef osapi_sha1_h
#define osapi_sha1_h
#include "osapi/osapi_dll.h"
#include "osapi/osapi_type.h"
#define RTI_OSAPI_SHA1_DIGEST_SIZE 20
#ifdef __cplusplus
extern "C" {
#endif
/**
* @internal
* @brief SHA1 state structure for incremental hashing.
*/
struct RTIOsapiSHA1State {
RTI_UINT32 State[5];
RTI_UINT32 Count[2];
RTI_UINT8 Buffer[64];
};
/**
* @internal
* @brief Initializes or resets a SHA1 state.
*
* @attention This SHA1 implementation is not intended for use in any
* security-related features and MUST NOT BE USED for such purposes.
*
* @param[out] self Pointer to the SHA1 state to initialize.
*/
extern RTIOsapiDllExport void RTIOsapiSHA1State_start(
struct RTIOsapiSHA1State *self);
/**
* @internal
* @brief Adds data to the SHA1 state.
*
* This processes the data and updates the internal state.
* Call repeatedly until all data is added, then call RTIOsapiSHA1State_finish.
*
* @attention This SHA1 implementation is not intended for use in any
* security-related features and MUST NOT BE USED for such purposes.
*
* @param[in,out] self Pointer to the SHA1 state.
* @param[in] input Pointer to the data buffer to add.
* @param[in] inputSize Size of the data buffer in bytes.
*/
extern RTIOsapiDllExport void RTIOsapiSHA1State_update(
struct RTIOsapiSHA1State *self,
const RTI_UINT8 *input,
RTI_UINT32 inputSize);
/**
* @internal
* @brief Finalizes the SHA1 hash and writes the digest.
*
* After calling this, RTIOsapiSHA1State_start must be used to reuse the state.
*
* @attention This SHA1 implementation is not intended for use in any
* security-related features and MUST NOT BE USED for such purposes.
*
* @param[in,out] self Pointer to the SHA1 state.
* @param[out] digest Pointer to a buffer to receive the hash.
*/
extern RTIOsapiDllExport void RTIOsapiSHA1State_finish(
struct RTIOsapiSHA1State *self,
RTI_UINT8 *digest);
/**
* @internal
* @brief Calculates the SHA1 hash of a buffer in one call.
*
* Combines start, update, and finish into a single operation.
*
* @attention This SHA1 implementation is not intended for use in any
* security-related features and MUST NOT BE USED for such purposes.
*
* @param[out] digest Pointer to a buffer to receive the hash.
* @param[in] input Pointer to the data buffer to hash.
* @param[in] inputSize Size of the data buffer in bytes.
*/
extern RTIOsapiDllExport void RTIOsapiSHA1_computeSHA1(
RTI_UINT8 *digest,
const char *input,
size_t inputSize);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* osapi_sha1_h */