函数 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.
方法 CalculateHashDigest 执行加密哈希值的同步单次(One-Shot)计算,并将结果写入提供的输出缓冲区 [SWS_CRYPT_50060]。待处理的输入消息 data、目标缓冲区 digest 以及可选的初始化向量 iv 作为参数传递。成功执行后,函数通过结果对象 ara::core::Result<std::size_t> 返回写入的实际摘要字节数[SWS_CRYPT_50060]。
错误处理
如果计算失败,接口保证回滚语义[SWS_CRYPT_50060]。结果中可能包含以下错误码:
ara::crypto::CryptoErrc::kInvalidInputSize:不支持传入数据或初始化向量的大小[SWS_CRYPT_50060]。ara::crypto::CryptoErrc::kUnsupported:上下文不支持单次调用计算,或者传入的初始化向量与上下文的配置不匹配(需要 IV 但缺失,或者传入了 IV 尽管不支持)[SWS_CRYPT_50060]。ara::crypto::CryptoErrc::kInsufficientCapacity:输出缓冲区digest的容量不足以容纳计算出的摘要[SWS_CRYPT_50060]。
并发性与交互
该函数被声明为异常安全(exception safe)和线程安全(thread-safe)[SWS_CRYPT_50060]。为预先避免与无效输入长度相关的错误,可通过 GetMaximumChunkSize 查询上下文允许用于单次调用的最大缓冲区大小[SWS_CRYPT_50062]。
本使用说明基于 AUTOSAR 规范 R25-11 自动生成。
实现者指南即将推出(复杂度 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#3cca0f1b- Content hash
3cca0f1b- 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 · 德文原文