DEENESPTFRRUARHIKOZHNL

类 ara::crypto::cryp::HashFunctionCtx

[SWS_CRYPT_21100] Upstream: RS_CRYPTO_02205

class HashFunctionCtx :           public CryptoContext {...};

Hash function interface.

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Forwarding-Header#include "ara/crypto/crypto_fwd.h"
Scopenamespace ara::crypto::cryp
Basisklasse(n)CryptoContext

用户指南人工智能生成

计算连续数据流或单个内存块的加密哈希值。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: bf2cec48587e 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

计算连续数据流或单个内存块的加密哈希值。

类 ara::crypto::cryp::HashFunctionCtx 提供了用于计算内存块和数据流加密哈希值的接口([SWS_CRYPT_50060])。流式操作要求遵循由通过 Start() 进行初始化、通过 Update() 逐步传递数据、通过 Finish() 完成终结以及随后通过 GetDigest()([SWS_CRYPT_21116])读取所构成的处理周期。所有方法均按线程安全规范说明,保证回滚语义,并通过结果对象确定性地报告序列或缓冲区错误。

上下文

类 ara::crypto::cryp::HashFunctionCtx 在 AUTOSAR Adaptive Platform 的模块 crypto 中定义了用于计算加密哈希值和校验和的接口。作为 CryptoContext 的特化,它提供了用于无状态单次调用以及有状态流式处理方法。生命周期和所有权管理通常通过智能指针类型别名 Sptr([SWS_CRYPT_21101])进行,该别名定义为 std::shared_ptr<HashFunctionCtx>。

主要的交互方包括:

  • 调用应用程序:控制计算的生命周期,并按块或以整条消息形式传递输入数据。
  • 内存区域:输入数据、初始化向量(IV)以及输出和状态缓冲区通过 ReadOnlyMemRegion 和 ReadWriteMemRegion 传输。
  • 密钥对象:通过 CryptoObject::Sptr 可以将加密密钥直接作为数据源纳入哈希计算中([SWS_CRYPT_50057])。
  • Crypto Provider:Interpretation:HashFunctionCtx 的实例通常应通过关联的 Crypto Provider 创建;交换导出的上下文状态必须要求相同的 Crypto Provider 和相同的算法 ID([SWS_CRYPT_50065])。 问题 Q-8365d4bee96bbf67 (未决)

生命周期

HashFunctionCtx 的实例在流式处理期间会经历多个离散状态:

hash_states Bereit Bereit InVerarbeitung InVerarbeitung Bereit->InVerarbeitung Start() / Start(iv) Bereit->InVerarbeitung ImportContextState() InVerarbeitung->Bereit Cancel() / Start() InVerarbeitung->InVerarbeitung Update() / GetIntermediateDigest() Abgeschlossen Abgeschlossen InVerarbeitung->Abgeschlossen Finish() Unterbrochen Unterbrochen InVerarbeitung->Unterbrochen ExportContextState() Abgeschlossen->Bereit Start()

状态图:哈希上下文在初始化、处理和完成时的状态转换。来源:[SWS_CRYPT_50152]、[SWS_CRYPT_50153]、[SWS_CRYPT_21113]、[SWS_CRYPT_50058]、[SWS_CRYPT_21115]、[SWS_CRYPT_50064]、[SWS_CRYPT_50065]

创建后,上下文处于未启动状态。通过调用不带 IV 的 Start()([SWS_CRYPT_50152])或带初始化向量的 Start(iv)([SWS_CRYPT_50153]),上下文切换到活动处理阶段。已经运行的计算将通过再次调用启动而被隐式丢弃。

在处理状态下,通过重复调用带有原始分段数据([SWS_CRYPT_21113])或密钥([SWS_CRYPT_50057])的 Update() 来累积输入数据。通过 GetIntermediateDigest() 可以计算中间结果,而无需完成上下文或中断数据流([SWS_CRYPT_50059])。正在运行的流式过程可随时使用 Cancel() 中止([SWS_CRYPT_50058]),从而使上下文返回到未启动状态。

调用 Finish() 会使上下文转换到“已完成”状态([SWS_CRYPT_21115])。只有在此状态下,才能通过 GetDigest()([SWS_CRYPT_21116])提取生成的哈希值,或者通过 Compare()([SWS_CRYPT_50154])直接针对预期值进行校验。

为了中断并在稍后继续计算,可以使用 GetContextStateSize()([SWS_CRYPT_50063])查询所需的缓冲区大小,并通过 ExportContextState()([SWS_CRYPT_50064])保存内部状态。恢复计算通过 ImportContextState()([SWS_CRYPT_50065])进行。所有接口方法均声明为异常安全(exception safe)和线程安全(thread-safe)。

使用路径

该类支持两种处理模式:直接单步计算以及分段流式处理。

单步计算通过 CalculateHashDigest()([SWS_CRYPT_50060])进行。在此过程中,传递输入数据、可选 IV 以及目标内存区域,并在原子操作中计算哈希值。

对于较大数据量或连续数据流,则使用流式路径:

哈希值的流式处理应用HashFunctionCtxStart()Result<void>loop针对每个数据块Update(data)Result<void>Finish()Result<void>GetDigest(digest)Result<std::size_t>

时序图:通过 Start、Update、Finish 和 GetDigest 进行流式计算的典型流程。来源:[SWS_CRYPT_50152]、[SWS_CRYPT_21113]、[SWS_CRYPT_21115]、[SWS_CRYPT_21116]

  1. 容量检查:通过 GetDigestSize()([SWS_CRYPT_50061])查询输出大小,并通过 GetMaximumChunkSize()([SWS_CRYPT_50062])查询最大块大小。
  2. 初始化:通过调用 Start()([SWS_CRYPT_50152])或 Start(iv)([SWS_CRYPT_50153])准备上下文。
  3. 数据传递:通过 Update(data)([SWS_CRYPT_21113])连续传递数据块或通过 Update(key)([SWS_CRYPT_50057])传递密钥。
  4. 终结:通过 Finish()([SWS_CRYPT_21115])结束哈希值累积。
  5. 结果评估:使用 GetDigest()([SWS_CRYPT_21116])读取计算出的哈希值,或通过 Compare()([SWS_CRYPT_50154])与参考值进行原地比较。

错误场景

HashFunctionCtx 的方法通过 ara::core::Result 发出错误信号,并在发生错误时保证回滚语义。典型的错误原因包括:

本指南基于 AUTOSAR Adaptive Platform R25-11 规范。

成员图

类图

Hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); Klicken öffnet die jeweilige Klassenseite.

G nara__crypto__cryp__HashFunctionCtx412 HashFunctionCtx + CalculateHashDigest() + Cancel() + Compare() + ExportContextState() + Finish() + GetContextStateSize() + GetDigest() + GetDigestSize() + GetIntermediateDigest() + GetMaximumChunkSize() + ImportContextState() + Start() + Update() nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__HashFunctionCtx412->nara__crypto__cryp__CryptoContext85

详细视图

请在大纲中选择一个条目。

方法

Calculate the hash digest and write the the calculated digest into the provided output buffer.

virtual ara::core::Result< std::size_t > CalculateHashDigest (ReadOnly MemRegion data, ReadWriteMemRegion digest, ara::core::Optional< Read OnlyMemRegion > iv) const noexcept=0;
Cancel 函数

Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.

virtual ara::core::Result< void > Cancel () noexcept=0;
Compare 函数

Compare the size and content of the calculated digest against an expected value.

virtual ara::core::Result< bool > Compare (ReadOnlyMemRegion expected) const noexcept=0;

Write the current state of this hash context into the provided output buffer contextState. This function can be used to suspend an ongoing hash operation and resume it at a later point in time.

virtual ara::core::Result< void > ExportContextState (ReadWriteMem Region contextState) const noexcept=0;
Finish 函数

Finish the digest calculation.

virtual ara::core::Result< void > Finish () noexcept=0;

Get the buffer size required to store the state of this context using ExportContextState()

virtual ara::core::Result< std::size_t > GetContextStateSize () const noexcept=0;
GetDigest 函数

Write the calculated hash digest into the provided output buffer.

virtual ara::core::Result< std::size_t > GetDigest (ReadWriteMemRegion digest) const noexcept=0;

Get the output digest size.

virtual ara::core::Result< std::size_t > GetDigestSize () const noexcept=0;

Calculate the hash digest with the data provided to the hash context and write the calculated hash digest into the provided output buffer. The hash digest is equal to the hash digest returned when calling Finish() and GetDigest(), however, after calling GetIntermediateDigest(), this context can still be updated with additional data.

virtual ara::core::Result< std::size_t > GetIntermediateDigest (Read WriteMemRegion digest) const noexcept=0;

Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), or CalculateHashDigest() by this context.

virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;

Set the current state of this hash context to the state provided by contextState. This function can be used to resume a previously suspended hash operation. The contextState must have been exported from a HashFunctionCtx with the same AlgorithmId provided by the same Crypto Provider as the current context using the function ExportContextState(). The current state of this context (e.g., any ongoing hash calculation) will be replaced by the state provided to this function.

virtual ara::core::Result< void > ImportContextState (ReadOnlyMem Region contextState) noexcept=0;
Start 函数 2

Initialize the context for processing of a hash digest without an IV. Will cancel any ongoing hash calculation.

重载 Start 2
virtual ara::core::Result< void > Start () noexcept=0; SWS_CRYPT_50152
virtual ara::core::Result< void > Start (ReadOnlyMemRegion iv) noexcept=0; SWS_CRYPT_50153
Update 函数 2

Update the digest calculation context by a new part of the message.

重载 Update 2
virtual ara::core::Result< void > Update (ReadOnlyMemRegion data) noexcept=0; SWS_CRYPT_21113
virtual ara::core::Result< void > Update (CryptoObject::Sptr key) noexcept=0; SWS_CRYPT_50057

类型别名

Sptr 类型别名

Smart pointer of the interface.

方法文档

函数 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.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: adb7aefb7feb 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

方法 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"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
datathe input message that should be processed
ivan optional initialization vector

Parameter (out)

ParameterBeschreibung
digestan output data buffer that the digest will be written into.

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the size in bytes of the digest or an error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided data or IV is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_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::kInsufficientCapacityrollback_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
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Cancel [SWS_CRYPT_50058] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< void > Cancel () noexcept=0;

Cancel the ongoing streaming operation that has been initiated by Start() and has not yet been finished.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 5c8d759c011a 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

方法 Cancel() 用于针对性中止正在运行的流操作,该操作此前通过方法 Start() 开始且尚未正常完成 [SWS_CRYPT_50058]。该调用在来自头文件 ara/crypto/cryp/hash_function_ctx.h 的 ara::crypto::cryp::HashFunctionCtx 实例上无参数且同步执行 [SWS_CRYPT_50058]。成功执行后,该操作返回一个空的 ara::core::Result<void> [SWS_CRYPT_50058]。

错误处理

如果在执行期间出现问题,返回的 ara::core::Result 将包含相应的错误值 [SWS_CRYPT_50058]。如果在调用 Cancel() 之前处理未由 Start() 启动,则中止将失败,并返回具有回滚语义的特定错误代码 ara::crypto::CryptoErrc::kProcessingNotStarted [SWS_CRYPT_50058]。

并发性与限制

该接口定义为 thread-safe 和 exception safe,并声明为 noexcept [SWS_CRYPT_50058]。作为重要的功能前置条件,数据处理必须处于活动状态,该状态由先前的 Start() 调用生成 [SWS_CRYPT_50058]。

相互作用

通过 Cancel() 实现的模式在整个加密堆栈的各种流上下文中都是标准化的。上下文 VerifierPublicCtx [SWS_CRYPT_50023]、MessageAuthnCodeCtx [SWS_CRYPT_50027]、SignerPrivateCtx [SWS_CRYPT_50041]、SymmetricCipherCtx [SWS_CRYPT_50046]、DecryptorPrivateCtx [SWS_CRYPT_50069]、AuthCipherCtx [SWS_CRYPT_50077] 和 EncryptorPublicCtx [SWS_CRYPT_50089] 也具有完全一致的语义和错误信号通知。

本使用说明基于 AUTOSAR Adaptive R25-11 规范。

实现者指南即将推出(复杂度 I1)

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result< void >an empty result if the ongoing streaming operation was cancelled successfully, or a result containing an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if data processing was not started by a call of the Start() method

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50058
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50058@rel:R25-11#e67e893e
Content hash
e67e893e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50058
Status: valid/unmigrated Version: rel:R25-11#69ced25c 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_50058@rel:R25-11#69ced25c
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Compare [SWS_CRYPT_50154] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< bool > Compare (ReadOnlyMemRegion expected) const noexcept=0;

Compare the size and content of the calculated digest against an expected value.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 1c3bf0837502 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

类 ara::crypto::cryp::HashFunctionCtx([SWS_CRYPT_50154])的方法 Compare 以同步方式将先前计算的哈希摘要的尺寸和内容与期望的参考值进行比较。目标值通过类型为 ReadOnlyMemRegion 的参数 expected 传递。在成功情况下,该函数返回一个 ara::core::Result<bool>,当且仅当期望的字节序列与计算得出的摘要相同时包含 true。

调用的前提条件是摘要计算此前已通过方法 Finish() 完成。若非如此,调用将失败并返回具有回滚语义([SWS_CRYPT_50154])的错误 ara::crypto::CryptoErrc::kProcessingNotFinished。解释:expected 的长度不符或内容不相等推测不会导致错误代码,而是在结果对象中产生常规的 false。 问题 Q-fdd0ecaec22f6985 (未决)

在并发方面,该方法被指定为 thread-safe 和 exception safe([SWS_CRYPT_50154])。由于声明为 noexcept,它不会抛出 C++ 异常。

在相关的密码学上下文中采用了相同的校验模式:对于消息验证码,ara::crypto::cryp::MessageAuthnCodeCtx::Compare([SWS_CRYPT_50133])比较计算得出的 MAC 值的尺寸和内容,而 CompareSubspan([SWS_CRYPT_50028])检查最高有效位。这两种方法同样都要求此前已结束计算。

本文由 AI 基于 AUTOSAR 规范 R25-11 生成。

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
expectedthe memory region containing an expected digest value

Rückgabewert

TypBeschreibung
ara::core::Result< bool >true if the expected byte sequence is identical to the calculated digest

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics if the digest calculation was not finished by a call of the Finish() method

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50154
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50154@rel:R25-11#18c59272
Content hash
18c59272
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50154
Status: valid/unmigrated Version: rel:R25-11#d6c1faba 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_50154@rel:R25-11#d6c1faba
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 ExportContextState [SWS_CRYPT_50064] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< void > ExportContextState (ReadWriteMem Region contextState) const noexcept=0;

Write the current state of this hash context into the provided output buffer contextState. This function can be used to suspend an ongoing hash operation and resume it at a later point in time.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 78b3b1c67b6a 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

类 ara::crypto::cryp::HashFunctionCtx 的方法 [SWS_CRYPT_50064] 将哈希上下文的当前状态同步写入类型为 ReadWriteMem Region 的传入输出缓冲区 contextState 中。这允许应用程序中断正在运行的加密哈希操作,并在稍后的时间点恢复。成功执行后,该调用返回一个空的 ara::core::Result<void>。

交互与缓冲区大小确定

为防止内存错误,应预先通过函数 [SWS_CRYPT_50063] 查询强制需要的以字节为单位的缓冲区大小。导出的状态稍后可通过 [SWS_CRYPT_50065] 重新加载到哈希上下文中。此操作的前提条件是目标上下文具有相同的 AlgorithmId,并且由与原始上下文相同的 Crypto Provider 提供。导入时,任何可能存在的计算状态都会被完全覆盖。

错误处理

如果操作失败,将在 ara::core::Result 中返回错误。来自 ara::crypto::CryptoErrc 的以下错误码已被指定:

  • ara::crypto::CryptoErrc::kUnsupported:具体上下文不支持导出或导入状态。
  • ara::crypto::CryptoErrc::kInsufficientCapacity:传入缓冲区 contextState 的容量不足以容纳状态。

针对这两种错误情况均定义了回滚语义,以使对象的状态保持不变。

并发性与执行安全性

该接口被声明为 const 和 noexcept。按照规范,该调用既是线程安全的又是异常安全的。

本使用说明是基于 AUTOSAR 规范自动生成的。

实现者指南即将推出(复杂度 I1)

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (out)

ParameterBeschreibung
contextStatean output data buffer that the state of the context will be written into.

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result on success or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this context does not support im-/exporting the context state
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_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_50064
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50064@rel:R25-11#c3b066e7
Content hash
c3b066e7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50064
Status: valid/unmigrated Version: rel:R25-11#10cf645c 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_50064@rel:R25-11#10cf645c
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Finish [SWS_CRYPT_21115] Upstream: RS_CRYPTO_02302, RS_CRYPTO_02205

virtual ara::core::Result< void > Finish () noexcept=0;

Finish the digest calculation.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 3afea8abb39d 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

同步方法 Finish() 完成 ara::crypto::cryp::HashFunctionCtx 中哈希值的计算 [SWS_CRYPT_21115]。无参数调用返回一个 ara::core::Result<void>,用于指示成功完成或封装错误 [SWS_CRYPT_21115]。该接口声明为 noexcept,并被指定为异常安全(exception safe)和线程安全(thread-safe)[SWS_CRYPT_21115]。

错误处理与并发

如果在调用前未成功启动哈希计算,该方法将失败并返回错误 ara::crypto::CryptoErrc::kInvalidUsageOrder [SWS_CRYPT_21115]。针对此错误情况定义了回滚语义,因此调用方在完成处理之前必须确保上下文已正确启动 [SWS_CRYPT_21115]。

相互作用

成功调用 Finish() 后,计算出的哈希摘要通常通过 GetDigest() 传输到提供的缓冲区中 [SWS_CRYPT_21116],[SWS_CRYPT_50059]。GetIntermediateDigest() 用于区分:该函数提供与 Finish() 和 GetDigest() 序列相同的哈希值,但之后允许传递更多数据 [SWS_CRYPT_50059]。Interpretation:调用 Finish() 后,计算可能已最终完成,且上下文不再接受额外数据。 问题 Q-f4daf29364f45fd5 (未决)上下文中处理步骤的允许缓冲区大小可通过 GetMaximumChunkSize() 查询 [SWS_CRYPT_50062]。

此使用说明基于 AUTOSAR 规范 R25-11 自动生成。

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kInvalidUsageOrderrollback_semantics the hash calculation has not been started successfully.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_21115
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_21115@rel:R25-11#281d05f3
Content hash
281d05f3
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21115
Status: valid/unmigrated Version: rel:R25-11#03ec3455 Versionshistorie & Revisions (1 transition, 7 revision)
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_21115@rel:R25-11#03ec3455
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#5c49c1122026-09-30
  • R20-11rel:R20-11#23a4ded62026-10-14
  • R21-11rel:R21-11#33ec9dc92026-10-14
  • R22-11rel:R22-11#13315a192026-10-14
  • R23-11rel:R23-11#6b14e99d2026-10-14
  • R24-11rel:R24-11#de528ef72026-10-14
  • R25-11rel:R25-11#03ec34552026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 GetContextStateSize [SWS_CRYPT_50063] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< std::size_t > GetContextStateSize () const noexcept=0;

Get the buffer size required to store the state of this context using ExportContextState()

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing required context state buffer size in bytes or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this context does not support im-/exporting the context state

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50063
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50063@rel:R25-11#a2092a88
Content hash
a2092a88
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50063
Status: valid/unmigrated Version: rel:R25-11#c5c390c7 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_50063@rel:R25-11#c5c390c7
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 GetDigest [SWS_CRYPT_21116] Upstream: RS_CRYPTO_02205

virtual ara::core::Result< std::size_t > GetDigest (ReadWriteMemRegion digest) const noexcept=0;

Write the calculated hash digest into the provided output buffer.

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (out)

ParameterBeschreibung
digestan output data buffer that the hash digest will be written into

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the size in bytes of the hash digest or an error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics if the hash calculation was not finished by a call of the Finish() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_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_21116
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_21116@rel:R25-11#df86686e
Content hash
df86686e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21116
Status: valid/unmigrated Version: rel:R25-11#5176bc54 Versionshistorie & Revisions (1 transition, 7 revision)
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_21116@rel:R25-11#5176bc54
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#d36ab7962026-09-30
  • R20-11rel:R20-11#6044ba662026-10-14
  • R21-11rel:R21-11#c195cbba2026-10-14
  • R22-11rel:R22-11#32e02a4e2026-10-14
  • R23-11rel:R23-11#7888ecb32026-10-14
  • R24-11rel:R24-11#96e2c5772026-10-14
  • R25-11rel:R25-11#5176bc542026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 GetDigestSize [SWS_CRYPT_50061] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< std::size_t > GetDigestSize () const noexcept=0;

Get the output digest size.

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the size of the output from this digest-function in bytes or an error

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50061
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50061@rel:R25-11#9fe2b4bb
Content hash
9fe2b4bb
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50061
Status: valid/unmigrated Version: rel:R25-11#739a55c8 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_50061@rel:R25-11#739a55c8
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 GetIntermediateDigest [SWS_CRYPT_50059] Upstream: RS_CRYPTO_02205

virtual ara::core::Result< std::size_t > GetIntermediateDigest (Read WriteMemRegion digest) const noexcept=0;

Calculate the hash digest with the data provided to the hash context and write the calculated hash digest into the provided output buffer. The hash digest is equal to the hash digest returned when calling Finish() and GetDigest(), however, after calling GetIntermediateDigest(), this context can still be updated with additional data.

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (out)

ParameterBeschreibung
digestan output data buffer that the hash digest will be written into

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the size in bytes of the hash digest or an error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kInvalidUsageOrderrollback_semantics the hash calculation has not been started successfully.
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this context does not support getting an intemediate digest

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50059
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50059@rel:R25-11#46bae9e0
Content hash
46bae9e0
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50059
Status: valid/unmigrated Version: rel:R25-11#9bc73898 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_50059@rel:R25-11#9bc73898
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 GetMaximumChunkSize [SWS_CRYPT_50062] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< std::size_t > GetMaximumChunkSize () const noexcept=0;

Get the maximum input buffer size supported for processing in single calls to Update(), Finish(), or CalculateHashDigest() by this context.

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the maximum buffer size in bytes or an error

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50062
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50062@rel:R25-11#0ad611f4
Content hash
0ad611f4
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50062
Status: valid/unmigrated Version: rel:R25-11#17fdd281 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_50062@rel:R25-11#17fdd281
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 ImportContextState [SWS_CRYPT_50065] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< void > ImportContextState (ReadOnlyMem Region contextState) noexcept=0;

Set the current state of this hash context to the state provided by contextState. This function can be used to resume a previously suspended hash operation. The contextState must have been exported from a HashFunctionCtx with the same AlgorithmId provided by the same Crypto Provider as the current context using the function ExportContextState(). The current state of this context (e.g., any ongoing hash calculation) will be replaced by the state provided to this function.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 16a68c3d97e9 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

类 ara::crypto::cryp::HashFunctionCtx(定义于 ara/crypto/cryp/hash_function_ctx.h 中)的方法 ImportContextState 用于从传入的缓冲区中恢复哈希上下文的内部状态,从而继续此前中断的哈希操作 [SWS_CRYPT_50065]。当前上下文任何正在运行的计算状态都将被导入的状态完全替换 [SWS_CRYPT_50065]。

调用与前置条件

同步调用通过签名 ImportContextState(ReadOnlyMem Region contextState) noexcept 进行,并返回一个 ara::core::Result<void> [SWS_CRYPT_50065]。参数 contextState 必须满足以下强制性先决条件:

  • 数据缓冲区此前必须已使用方法 ExportContextState() 从 HashFunctionCtx 的实例中导出 [SWS_CRYPT_50065]。
  • 源上下文必须具有相同的 AlgorithmId,并且必须由与目标上下文相同的 Crypto Provider 提供 [SWS_CRYPT_50065]。

错误处理与并发

在发生错误时,将返回具有回滚语义的错误代码,以便在失败时上下文的现有状态保持不变 [SWS_CRYPT_50065]:

  • ara::crypto::CryptoErrc::kInvalidArgument:实参 contextState 包含无效数据 [SWS_CRYPT_50065]。
  • ara::crypto::CryptoErrc::kUnsupported:特定上下文不支持上下文状态的导出和导入 [SWS_CRYPT_50065]。

该操作被规范定义为 thread-safe 和 exception safe [SWS_CRYPT_50065]。

本使用说明基于 AUTOSAR Adaptive Release R25-11 规范。

实现者指南即将推出(复杂度 I1)

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
contextStatea data buffer that contains a previously exported state of the context

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result on success or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this context does not support im-/exporting the context state
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the contextState argument contains invalid data

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50065
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50065@rel:R25-11#6cf48ee3
Content hash
6cf48ee3
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50065
Status: valid/unmigrated Version: rel:R25-11#7db4f4c5 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_50065@rel:R25-11#7db4f4c5
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Start [SWS_CRYPT_50152] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< void > Start () noexcept=0;

Initialize the context for processing of a hash digest without an IV. Will cancel any ongoing hash calculation.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 6588b8251bb2 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

接口 ara::crypto::cryp::HashFunctionCtx 的方法 Start() 初始化用于在没有初始向量(IV)的情况下逐步计算哈希值的上下文 [SWS_CRYPT_50152]。再次调用会中止可能已在进行的哈希计算,并为新的计算建立上下文 [SWS_CRYPT_50152]。

该函数是同步的,不接收任何参数,并返回一个 ara::core::Result<void> [SWS_CRYPT_50152]。如果在初始化时发生错误,则回滚语义生效,并带有以下特定错误代码 [SWS_CRYPT_50152]:

  • ara::crypto::CryptoErrc::kUnsupported:所使用的哈希函数强制要求初始向量 [SWS_CRYPT_50152]。
  • ara::crypto::CryptoErrc::kBusyResource:该操作强制所需的内部资源被占用 [SWS_CRYPT_50152]。

关于并发性,该方法被指定为 thread-safe 以及 exception safe,并声明为 noexcept [SWS_CRYPT_50152]。成功初始化后,消息部分可以通过上下文的方法 Update() 按序输入 [SWS_CRYPT_21113]。由于该调用会中止正在进行的计算,因此在实践中该函数可能还可用作重新启动前的重置机制。 问题 Q-9c369489a6c6e8cb (未决)

本使用说明是根据 R25-11 的 AUTOSAR 规范自动生成的。

实现者指南即将推出(复杂度 I1)

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics the used hash function expects an IV
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50152
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50152@rel:R25-11#208a7fdd
Content hash
208a7fdd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50152
Status: valid/unmigrated Version: rel:R25-11#b2ed1e78 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_50152@rel:R25-11#b2ed1e78
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Start [SWS_CRYPT_50153] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< void > Start (ReadOnlyMemRegion iv) noexcept=0;

Initialize the context for processing of a hash digest with an IV. Will cancel any ongoing hash calculation.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 3e6743c0173b 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

接口 ara::crypto::cryp::HashFunctionCtx 的函数 Start 初始化用于使用初始向量(IV)计算哈希摘要的上下文 [SWS_CRYPT_50153]。作为参数,初始向量 iv 通过 ReadOnlyMemRegion 传入 [SWS_CRYPT_50153]。同步调用返回一个 ara::core::Result<void>,在成功的情况下不包含任何返回值 [SWS_CRYPT_50153]。此外,调用会中止该上下文上可能已在进行的哈希计算 [SWS_CRYPT_50153]。

错误处理

如果在初始化时发生错误,则返回相应的错误代码,同时为所有错误情况保证回滚语义 [SWS_CRYPT_50153]:

  • ara::crypto::CryptoErrc::kInvalidInputSize:提供的初始向量大小不受支持 [SWS_CRYPT_50153]。
  • ara::crypto::CryptoErrc::kUnsupported:底层的哈希函数不使用初始向量 [SWS_CRYPT_50153]。
  • ara::crypto::CryptoErrc::kBusyResource:初始化所需的资源被占用 [SWS_CRYPT_50153]。

并发性与交互

该接口被声明为 noexcept,并被指定为线程安全(thread-safe)和异常安全(exception safe)[SWS_CRYPT_50153]。在典型流程中,该调用构成了后续通过方法 Update 逐步处理输入消息的前提条件 [SWS_CRYPT_21113]。

本使用说明基于 AUTOSAR 规范 R25-11 自动创建。

实现者指南即将推出(复杂度 I1)

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
ivthe used Initialization Vector (IV)

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics the size of provided IV is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics the used hash function does not use an IV
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50153
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50153@rel:R25-11#9c2fea79
Content hash
9c2fea79
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50153
Status: valid/unmigrated Version: rel:R25-11#8543358e 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_50153@rel:R25-11#8543358e
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Update [SWS_CRYPT_21113] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< void > Update (ReadOnlyMemRegion data) noexcept=0;

Update the digest calculation context by a new part of the message.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: fe6681ce0628 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步方法 Update 在 [SWS_CRYPT_21113] 中用于增量更新正在运行的哈希计算上下文(ara::crypto::cryp::HashFunctionCtx)。通过参数 data(ReadOnlyMemRegion)传递待处理输入消息的一部分。该函数返回一个 ara::core::Result<void>,在成功时为空,或封装相应的错误代码。

在错误行为方面,该方法在两种特定错误状态下提供回滚语义:

  • ara::crypto::CryptoErrc::kProcessingNotStarted:计算先前未通过调用方法 Start() 初始化 [SWS_CRYPT_21113]。
  • ara::crypto::CryptoErrc::kInvalidInputSize:传入数据的大小不受上下文支持 [SWS_CRYPT_21113]。

对于调用上下文,明确的顺序和大小条件适用:在传递数据之前,必须已初始化哈希过程 [SWS_CRYPT_21113]。为避免 kInvalidInputSize,单个 Update 调用的最大允许块大小可以事先通过 GetMaximumChunkSize 确定 [SWS_CRYPT_50062]。根据规范,该函数被声明为异常安全(exception safe)和线程安全(thread-safe)[SWS_CRYPT_21113]。

在与其他接口的交互中,在 HashFunctionCtx 内部存在通过 Update(CryptoObject::Sptr) 传递密钥对象的重载 [SWS_CRYPT_50057]。在馈送所有数据块之后,校验和的最终化大概应通过 Finish() 执行 [SWS_CRYPT_50062]。 问题 Q-dcac20f353ca55f4 (未决)

本使用说明基于规范自动生成。

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
dataa part of the input message that should be processed

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if the digest calculation was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided data is not supported

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_21113
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_21113@rel:R25-11#54f9d92a
Content hash
54f9d92a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21113
Status: valid/unmigrated Version: rel:R25-11#1061ad76 Versionshistorie & Revisions (1 transition, 7 revision)
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_21113@rel:R25-11#1061ad76
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#a256303e2026-09-30
  • R20-11rel:R20-11#c42a6b602026-10-14
  • R21-11rel:R21-11#8395b3922026-10-14
  • R22-11rel:R22-11#c133132e2026-10-14
  • R23-11rel:R23-11#68132f692026-10-14
  • R24-11rel:R24-11#0809f9622026-10-14
  • R25-11rel:R25-11#1061ad762026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

函数 Update [SWS_CRYPT_50057] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< void > Update (CryptoObject::Sptr key) noexcept=0;

Update the digest calculation context by a new part of the message.

AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: 87fb2c080f4a 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

同步方法 Update 在 [SWS_CRYPT_50057] 中用于将 ara::crypto::cryp::HashFunctionCtx 中的哈希值计算上下文以密钥对象形式逐步扩展新的消息段。作为参数,传递一个指向密钥对象的智能指针(CryptoObject::Sptr key)。该调用返回一个 ara::core::Result<void>,其在成功处理时为空,或在发生错误时封装相应的错误代码 [SWS_CRYPT_50057]。

作为顺序条件,计算此前必须已通过调用 Start() 初始化;否则将报告错误 ProcessingNotStarted [SWS_CRYPT_50057]。其他特定错误情况包括(均具有回滚语义)[SWS_CRYPT_50057]:

  • ara::crypto::CryptoErrc::kUnsupported,如果哈希上下文通常不支持对密钥进行哈希计算,
  • ara::crypto::CryptoErrc::kIncompatibleObject,如果传入的密钥对象与该上下文不兼容,
  • ara::crypto::CryptoErrc::kUsageViolation,如果密钥的允许用法不包含 kAllowHash Calculation,
  • ara::crypto::CryptoErrc::kInvalidInputSize,如果传入密钥的数据大小不受支持。

该方法被声明为 thread-safe 以及 exception safe(noexcept)[SWS_CRYPT_50057]。在与该模块的其他接口交互时,单个 Update 调用的最大允许缓冲区大小可以通过 GetMaximumChunkSize() 确定 [SWS_CRYPT_50062]。对于不带密钥对象的常规消息部分,在 HashFunctionCtx 中并行存在重载版本 Update(ReadOnlyMemRegion data) [SWS_CRYPT_21113]。

本使用说明是基于规范自动生成的。

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe ara::crypto::CryptoErrc::k rollback_semantics

Parameter (in)

ParameterBeschreibung
keya part of the input message that should be processed

Rückgabewert

TypBeschreibung
ara::core::Result< void >An empty result or an error

Fehler

FehlercodeBeschreibung
ProcessingNotStartedif the digest calculation was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided data is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this context does not support hashing of keys
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the provided key is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowHash Calculation

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_50057
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50057@rel:R25-11#a131a91a
Content hash
a131a91a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50057
Status: valid/unmigrated Version: rel:R25-11#6d3cf021 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_50057@rel:R25-11#6d3cf021
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

类型别名文档

类型别名 Sptr [SWS_CRYPT_21101] Upstream: RS_CRYPTO_02205

using Sptr = std::shared_ptr<HashFunctionCtx>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
SymbolSptr

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/SWS_CRYPT_21101
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_21101@rel:R25-11#60bd45ba
Content hash
60bd45ba
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21101
Status: valid/unmigrated Version: rel:R25-11#6b0a2315 Versionshistorie & Revisions (1 transition, 8 revision)
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_21101@rel:R25-11#6b0a2315
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#806f0f392026-09-30
  • R19-11rel:R19-11#d559cb4a2026-10-14
  • R20-11rel:R20-11#6ba26a492026-10-14
  • R21-11rel:R21-11#6ba26a492026-10-14
  • R22-11rel:R22-11#49c7b6f72026-10-14
  • R23-11rel:R23-11#cfd4adfd2026-10-14
  • R24-11rel:R24-11#cfd4adfd2026-10-14
  • R25-11rel:R25-11#6b0a23152026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill