function CalculateHashDigest [SWS_CRYPT_50060] Upstream: RS_CRYPTO_02205
virtual ara::core::Result< std::size_t > CalculateHashDigest (ReadOnly MemRegion data, ReadWriteMemRegion digest, ara::core::Optional< Read OnlyMemRegion > iv) const noexcept=0;
Calculate the hash digest and write the the calculated digest into the provided output buffer.
The CalculateHashDigest method performs a synchronous one-shot calculation of a cryptographic hash value and writes the result into the provided output buffer [SWS_CRYPT_50060]. The input message data to be processed, the destination buffer digest, and optionally an initialization vector iv are passed as parameters. Upon successful execution, the function returns the actual number of written digest bytes via the result object ara::core::Result<std::size_t> [SWS_CRYPT_50060].
Error handling
If the calculation fails, the interface guarantees rollback semantics [SWS_CRYPT_50060]. The following error codes can be contained in the result:
ara::crypto::CryptoErrc::kInvalidInputSize: The size of the passed data or of the initialization vector is not supported [SWS_CRYPT_50060].ara::crypto::CryptoErrc::kUnsupported: Single-call calculation is not supported by the context, or the passing of the initialization vector does not match the configuration of the context (IV required but missing, or IV passed although not supported) [SWS_CRYPT_50060].ara::crypto::CryptoErrc::kInsufficientCapacity: The capacity of the output bufferdigestis not sufficient for the calculated digest [SWS_CRYPT_50060].
Concurrency and Interaction
The function is declared as exception-safe (exception safe) and thread-safe (thread-safe) [SWS_CRYPT_50060]. To avoid errors regarding impermissible input lengths in advance, the maximum buffer size permitted for a single call of the context can be determined via GetMaximumChunkSize [SWS_CRYPT_50062].
This usage note was generated automatically based on the AUTOSAR specification R25-11.
Implementer's Guide to follow (complexity I1)
| Header-Datei | #include "ara/crypto/cryp/hash_function_ctx.h" |
|---|---|
| Scope | class ara::crypto::cryp::HashFunctionCtx |
| Exception-Sicherheit | exception safe |
| Thread-Sicherheit | thread-safe |
Parameter (in)
| Parameter | Beschreibung |
|---|---|
| data | the input message that should be processed |
| iv | an optional initialization vector |
Parameter (out)
| Parameter | Beschreibung |
|---|---|
| digest | an output data buffer that the digest will be written into. |
Rückgabewert
| Typ | Beschreibung |
|---|---|
| ara::core::Result<std::size_t > | A result containing the size in bytes of the digest or an error. |
Fehler
| Fehlercode | Beschreibung |
|---|---|
| ara::crypto::CryptoErrc::kInvalidInputSize | rollback_semantics if the size of provided data or IV is not supported |
| ara::crypto::CryptoErrc::kUnsupported | rollback_semantics if single-call operation is not supported, or if the context requires setting an IV but no IV is provided, or if the context does not support setting an IV but an IV is provided |
| ara::crypto::CryptoErrc::kInsufficientCapacity | rollback_semantics if the output buffer is too small |
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/SWS_CRYPT_50060- Status
- valid/unmigrated
- Version
AUTOSAR/AP/record/SWS_CRYPT_50060@rel:R25-11#29fd4c6d- Content hash
29fd4c6d- Source
- https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50060
Status: valid/unmigrated
Version: rel:R25-11#29fd4c6d
Versionshistorie & Revisions (1 transition)
- Current State
valid/unmigrated- Reason
- mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
- Campaign
2026-08-13-status-backfill- Active Version
AUTOSAR/AP/record/SWS_CRYPT_50060@rel:R25-11#29fd4c6d
Requirement Text as-of this release:
Curation Decisions:
Reachable Artifacts & Dependents:
| Date | Actor | Transition | Reason / Rationale | Campaign |
|---|---|---|---|---|
| 2026-08-13 | tool | none → valid/unmigrated | mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record | 2026-08-13-status-backfill |
gemini-3.8-flash-low· 2026-10-13 · German original