DEENESPTFRRUARHIKOZHNL

类 ara::crypto::cryp::AuthCipherCtx

[SWS_CRYPT_20100] Upstream: RS_CRYPTO_02207

class AuthCipherCtx :           public CryptoContext {...};

Authenticated Cipher Context interface.

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

用户指南人工智能生成

提供用于带有完整性保护的经过身份验证的对称加密和解密的接口。
AI 生成 未审核 模型: gemini-3.8-flash-medium · 推理强度: medium · 温度: 不可控 · 提示词: a1dee2a3fcf5 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

提供用于带有完整性保护的经过身份验证的对称加密和解密的接口。

接口 ara::crypto::cryp::AuthCipherCtx 用于在维护机密性和完整性的同时对数据进行身份验证加解密 [SWS_CRYPT_23911]。配置密钥后,处理既可以作为原子单次调用进行,也可以作为由初始化、可选验证数据、有效负载更新和最终化组成的流式序列进行。作为关键安全条件,如果身份验证标签无效,解密将失败,因此解密后的有效负载数据只有在验证成功后才能进行处理 [SWS_CRYPT_50075]。

上下文

接口 ara::crypto::cryp::AuthCipherCtx 定义了 AUTOSAR Adaptive Platform 内用于经过身份验证的密码操作(关联数据的认证加密,AEAD)的标准化应用程序编程接口。它通过在实际对有效负载数据进行加解密的同时始终生成或验证加密身份验证标签,将机密性与完整性保护结合起来。调用方应用程序和密钥对象充当核心交互伙伴:在使用前,上下文要么绑定到 SymmetricKey 的具体实例 [SWS_CRYPT_23911],要么使用持久化或提供的 KeySlot 进行配置 [SWS_CRYPT_50072]。除了分步流式处理之外,该类还支持独立的单次调用,以便在一步中处理完整消息 [SWS_CRYPT_50078]。

生命周期

在应用程序范围中,上下文通过共享指针类型 ara::crypto::cryp::AuthCipherCtx::Sptr 进行管理 [SWS_CRYPT_20101]。(解读:由于 AuthCipherCtx 被指定为纯接口,对象创建通常通过上级提供方工厂进行)。 问题 Q-23125789874cf2f3 (未决)所有成员函数均声明为异常安全(exception safe)和线程安全(thread-safe)[SWS_CRYPT_23911]、[SWS_CRYPT_24715]。功能生命周期经历明确定义的状态:

  • 未初始化:紧接着实例化之后。由于尚未分配密钥,对数据处理的调用将被拒绝 [SWS_CRYPT_50081]。
  • 密钥已配置:通过使用 SymmetricKey [SWS_CRYPT_23911] 或 KeySlot [SWS_CRYPT_50072] 成功调用 SetKey,上下文转换到就绪状态。在此状态下可以直接执行单次操作。
  • 流式处理活动:通过在指定转换方向的情况下调用 Start 进入,可以带有初始化向量 (IV) [SWS_CRYPT_24715] 或不带显式 IV [SWS_CRYPT_50073]。
  • 完成 / 重置:正在进行的流式操作通常通过 Finish [SWS_CRYPT_50075] 或 FinishEncrypt [SWS_CRYPT_50076] 完成,或者通过 Cancel 提前中止 [SWS_CRYPT_50077]。之后上下文再次就绪以进行新的处理序列。
Lebenszyklus Uninitialized Uninitialized KeyConfigured KeyConfigured Uninitialized->KeyConfigured SetKey() KeyConfigured->KeyConfigured ProcessSingleCall() StreamingActive StreamingActive KeyConfigured->StreamingActive Start() StreamingActive->KeyConfigured Finish() / Cancel() StreamingActive->StreamingActive UpdateAuthenticatedData() UpdateConfidentialData()

状态图:上下文从密钥绑定到流式处理直至完成的状态阶段。来源:[SWS_CRYPT_23911]、[SWS_CRYPT_50072]、[SWS_CRYPT_24715]、[SWS_CRYPT_50075]、[SWS_CRYPT_50077]。

使用路径

对于连续数据流处理,该接口需要有序的调用序列:

  1. 配置:通过 SetKey [SWS_CRYPT_23911] 或使用 KeySlot [SWS_CRYPT_50072] 的 SetKey 分配密钥。
  2. 参数查询:可选通过 GetMinimumChunkSize [SWS_CRYPT_50162]、GetMaximumChunkSize [SWS_CRYPT_50082]、GetMinimumInputIvSize [SWS_CRYPT_50163]、GetMaximumInputIvSize [SWS_CRYPT_50164]、GetTagSize [SWS_CRYPT_50161] 以及 GetRequiredOutputBufferSize [SWS_CRYPT_50081] 确定限值与缓冲区大小。
  3. 操作启动:调用 Start,指定方向(加密或解密),并提供 IV [SWS_CRYPT_24715] 或请求上下文拥有的 IV [SWS_CRYPT_50073]。
  4. 关联数据 (AAD):如果额外的明文数据需要纳入完整性计算,则通过 UpdateAuthenticatedData 传入 [SWS_CRYPT_20313]。最大允许的 AAD 大小可通过 GetMaxAssociatedDataSize 查询 [SWS_CRYPT_20103]。重要提示:AAD 块必须强制在实际有效负载数据之前传输。
  5. 有效负载数据处理:通过 UpdateConfidentialData [SWS_CRYPT_50074] 逐步传递数据块。在解密时,明文会在确定其真实性之前返回;应用程序仅允许在成功完成 Finalize 之后使用这些数据。
  6. 完成:通过 Finish [SWS_CRYPT_50075] 或 FinishEncrypt [SWS_CRYPT_50076] 结束操作,由此处理最终块并计算或验证身份验证标签(Tag)。

对于紧凑的负载存在单次调用替代方案:ProcessSingleCall 在不传递 IV 的情况下处理数据 [SWS_CRYPT_50078],ProcessSingleCallWithInputIv 接受外部 IV [SWS_CRYPT_50079],而 EncryptSingleCallWithOutputIv 将由上下文生成的 IV 返回给调用者 [SWS_CRYPT_50080]。

流式已认证加密的流程应用AuthCipherCtxSetKey(key)Result<void>Start(kEncrypt, iv)Result<void>optZusatzdaten vorhandenUpdateAuthenticatedData(aad)Result<void>loopfuer jeden DatenblockUpdateConfidentialData(in, out)Result<size_t>Finish(in, out, tag)Result<size_t>

时序图:流式身份验证加密的调用顺序。来源:[SWS_CRYPT_23911]、[SWS_CRYPT_24715]、[SWS_CRYPT_20313]、[SWS_CRYPT_50074]、[SWS_CRYPT_50075]。

错误场景

AuthCipherCtx 的方法通过 ara::core::Result 返回结果,并在出错时具有回滚语义。来自 ara::crypto::CryptoErrc 的相关错误码包括:

本指南完全基于 AUTOSAR Adaptive 标准(Release R25-11),并总结了对接口 ara::crypto::cryp::AuthCipherCtx 的要求。

成员图

类图

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

G nara__crypto__cryp__AuthCipherCtx142 AuthCipherCtx + Cancel() + EncryptSingleCallWithOutputIv() + Finish() + FinishEncrypt() + GetMaxAssociatedDataSize() + GetMaximumChunkSize() + GetMaximumInputIvSize() + GetMinimumChunkSize() + GetMinimumInputIvSize() + GetOutputIvSize() + GetRequiredOutputBufferSize() + GetTagSize() + ProcessSingleCall() + ProcessSingleCallWithInputIv() + SetKey() + Start() … 2 weitere nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__AuthCipherCtx142->nara__crypto__cryp__CryptoContext85

详细视图

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

方法

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;

Perform encryption and calculate/verify of the authentication tag in a single-call and return an IV generated by the context.

virtual ara::core::Result< std::size_t > EncryptSingleCallWithOutputIv (ReadOnlyMemRegion dataIn, ReadWriteMemRegion dataOut, ReadWriteMem Region tag, ReadWriteMemRegion ivOut, ara::core::Optional< ReadOnlyMem Region > authenticatedData) noexcept=0;
Finish 函数

Finalize the en-/decryption and calculate/verify the authentication tag without returning an IV.

Finalize the encryption and calculate the authentication tag and return the IV generated by the context.

virtual ara::core::Result< std::size_t > FinishEncrypt (ReadOnlyMem Region in, ReadWriteMemRegion out, ReadWriteMemRegion tag, ReadWrite MemRegion ivOut) noexcept=0;

Get maximum supported size of associated public data.

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

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

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

Get the maximum IV size required to be passed to the context in the functions Start() and ProcessSingleCallWithInputIv() for the given transformDirection.

virtual ara::core::Result< std::size_t > GetMaximumInputIvSize (Crypto Transform transformDirection) const noexcept=0;

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

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

Get the minimum IV size required to be passed to the context in the functions Start() and ProcessSingleCallWithInputIv() for the given transformDirection.

virtual ara::core::Result< std::size_t > GetMinimumInputIvSize (Crypto Transform transformDirection) const noexcept=0;

Get the output IV size that will be returned by the functions FinishEncrypt() (in case no IV has been provided by the application during the call to Start()), and EncryptSingleCallWithOutputIv().

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

Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.

virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (std::size_t inputSize, bool isFinal) const noexcept;
GetTagSize 函数

Get the output tag size.

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

Perform en-/decryption and calculate/verify of the authentication tag in a single-call without setting or returning an IV.

virtual ara::core::Result< std::size_t > ProcessSingleCall (ReadOnly MemRegion dataIn, ReadWriteMemRegion dataOut, ReadWriteMemRegion tag, CryptoTransform transformDirection, ara::core::Optional< ReadOnlyMem Region > authenticatedData) noexcept=0;

Perform en-/decryption and calculate/verify of the authentication tag in a single-call, providing an IV to be used during en-/decryption.

virtual ara::core::Result< std::size_t > ProcessSingleCallWithInputIv (ReadOnlyMemRegion dataIn, ReadWriteMemRegion dataOut, ReadWriteMem Region tag, CryptoTransform transformDirection, ReadOnlyMemRegion iv, ara::core::Optional< ReadOnlyMemRegion > authenticatedData) noexcept=0;
SetKey 函数 2

The interface shall configure the context to use the provided SymmetricKey.

重载 SetKey 2
virtual ara::core::Result< void > SetKey (SymmetricKey::Sptr key) noexcept=0; SWS_CRYPT_23911
virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0; SWS_CRYPT_50072
Start 函数 2

Initialize the context for a new encryption or decryption and set the IV used by the context.

重载 Start 2
virtual ara::core::Result< void > Start (CryptoTransform transform Direction, ReadOnlyMemRegion iv) noexcept=0; SWS_CRYPT_24715
virtual ara::core::Result< void > Start (CryptoTransform transform Direction) noexcept=0; SWS_CRYPT_50073

Update the tag calculation by a new chunk of additional authenticated data.

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

Encrypt or decrypt confidential data. When used for decryption, the plaintext is returned without verifying its authenticity. An application must not use the data before verifying its authenticity using Finish().

virtual ara::core::Result< std::size_t > UpdateConfidentialData (Read OnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

类型别名

Sptr 类型别名

Smart pointer of the interface.

方法文档

函数 Cancel [SWS_CRYPT_50077] 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 · 温度: 不可控 · 提示词: 739ac0d710b6 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

接口 ara::crypto::cryp::AuthCipherCtx 的方法 Cancel() 用于中止此前通过 Start() 启动且尚未完成的活动流式操作 [SWS_CRYPT_50077]。该函数通过头文件 ara/crypto/cryp/auth_cipher_ctx.h 提供,同步执行且不带入参 [SWS_CRYPT_50077]。它返回一个在成功情况下为空的 ara::core::Result<void>。

错误处理与边界条件

中止的前提是此前确实已通过 Start() 开始了数据处理。如果未启动流式操作,则调用失败并返回具有回滚语义的错误码 ara::crypto::CryptoErrc::kProcessingNotStarted [SWS_CRYPT_50077]。

并发性

该操作被声明为 noexcept,并且根据规范被归类为既是 thread-safe 又是 exception safe [SWS_CRYPT_50077]。

相互作用

通过 Cancel() 实现的中止模式在模块 crypt 中已标准化。相同的接口语义和相同的错误码 ara::crypto::CryptoErrc::kProcessingNotStarted 已为对应的流式上下文定义:

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

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

Header-Datei#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scopeclass ara::crypto::cryp::AuthCipherCtx
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_50077
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50077@rel:R25-11#818d196a
Content hash
818d196a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50077
Status: valid/unmigrated Version: rel:R25-11#863ca4bd 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_50077@rel:R25-11#863ca4bd
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

函数 EncryptSingleCallWithOutputIv [SWS_CRYPT_50080] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > EncryptSingleCallWithOutputIv (ReadOnlyMemRegion dataIn, ReadWriteMemRegion dataOut, ReadWriteMem Region tag, ReadWriteMemRegion ivOut, ara::core::Optional< ReadOnlyMem Region > authenticatedData) noexcept=0;

Perform encryption and calculate/verify of the authentication tag in a single-call and return an IV generated by the context.

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

接口 ara::crypto::cryp::AuthCipherCtx 的同步方法 EncryptSingleCallWithOutputIv 在单步中执行带认证的加密,并在此过程中自主生成初始化向量 [SWS_CRYPT_50080]。它处理来自 dataIn 的输入数据以及可选的附加数据 authenticatedData,并将密文写入缓冲区 dataOut。生成的初始化向量存放在缓冲区 ivOut 中,而认证 Tag 通过 tag 输出 [SWS_CRYPT_50080]。ivOut 的缓冲区大小可以预先通过方法 GetOutputIvSize 确定 [SWS_CRYPT_50165]。尽管名称中包含 Encrypt,但该方法大概也可以用于解密,因为错误规范中明确列出了针对 transformDirection == kDecrypt 的行为 [SWS_CRYPT_50080]。 问题 Q-66618567b20f99b9 (未决)

对于该调用,适用以下主要前置条件和限制:

  • 上下文此前必须已使用 SetKey 成功初始化;否则将报告 kUninitializedContext [SWS_CRYPT_50080]。
  • 所配置 KeySlot 中的密钥必须兼容并具有相应的权限(例如 kAllowDataEncrypt),否则将返回 kUsageViolation 或 kIncompatibleObject [SWS_CRYPT_50080]。
  • 如果输出缓冲区 dataOut 或 ivOut 不足,调用将失败并返回 kInsufficientCapacity [SWS_CRYPT_50080]。
  • 如果上下文不支持单步处理或要求外部指定 IV,则返回 kUnsupported [SWS_CRYPT_50080]。

该操作被规范定义为 thread-safe 以及异常安全,并在发生错误时保证回滚语义 [SWS_CRYPT_50080]。对于不带 Tag 处理的纯对称加密,在 SymmetricCipherCtx [SWS_CRYPT_50049] 中存在单独的对应项。

本文本由 AI 基于规范生成。

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

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

Parameter (in)

ParameterBeschreibung
dataInan input data buffer containing the plaintext/ciphertext
authenticatedDataoptional additional authenticated data

Parameter (out)

ParameterBeschreibung
dataOutan output data buffer that contains en-/decrypted data
ivOutan output data buffer that the initialization vector (IV) generated by the context will be written to

Parameter (in/out)

ParameterBeschreibung
tagfor decryption: an input data buffer that contains the authentication tag. for encryption: an output data buffer that the authentication tag is written to.

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.

Fehler

FehlercodeBeschreibung
EmptyKeySlotif a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if single shot processing is not supported by the context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context requires setting an IV
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if SetKey has not been successfully called before
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics if a KeySlot has been configured, but is currently busy
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the SymmetricKey deployed or contained in the provided KeySlot at the time of invocation of this interface does not include kAllowDataEncrypt for encryption, or kAllowData Decrypt for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if a KeySlot has been configured, but does not contain a Symmetric Key
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided input buffer or authentication tag is invalid
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the data or IV output buffer is too small
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics if the transformDirection is kDecrypt and the processed data cannot be authenticated

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50080
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50080@rel:R25-11#b08283db
Content hash
b08283db
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50080
Status: valid/unmigrated Version: rel:R25-11#1fa18617 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_50080@rel:R25-11#1fa18617
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_50075] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > Finish (ReadOnlyMemRegion in, ReadWriteMemRegion out, ReadWriteMemRegion tag) noexcept=0;

Finalize the en-/decryption and calculate/verify the authentication tag without returning an IV.

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

用法与语义

方法 Finish 在 ara::crypto::cryp::AuthCipherCtx 内同步完成加密或解密,并计算或验证认证 Tag,而不返回初始化向量(IV)[SWS_CRYPT_50075]。调用者通过缓冲区 in 以及目标缓冲区 out 传递剩余数据。在加密时,通过缓冲区 tag 输出计算出的 Tag,而在解密时,传递待验证的 Tag [SWS_CRYPT_50075]。返回值 ara::core::Result<std::size_t> 说明了实际写入 out 的字节数,该数值可能小于输出缓冲区的容量 [SWS_CRYPT_50075]。

流程与交互

在调用之前,数据处理必须已通过 Start() 启动 [SWS_CRYPT_50075]。如果此前已使用 UpdateConfidentialData 处理了数据块,则在解密时,应用程序仅在通过 Finish 成功完成认证后才能使用生成的明文 [SWS_CRYPT_50074]。通过指定 isFinal = true,可以预先通过 GetRequiredOutputBufferSize 确定 out 所需的最大缓冲区大小 [SWS_CRYPT_50081]。

错误处理与并发

该方法被规范定义为线程安全和异常安全 [SWS_CRYPT_50075]。错误通过 ara::core::Result 以回滚语义报告 [SWS_CRYPT_50075]:

  • ProcessingNotStarted:数据处理此前未通过 Start() 启动 [SWS_CRYPT_50075]。
  • ara::crypto::CryptoErrc::kInsufficientCapacity:输出缓冲区 out 过小 [SWS_CRYPT_50075]。
  • ara::crypto::CryptoErrc::kInvalidInputSize:in 或 tag 的缓冲区大小无效 [SWS_CRYPT_50075]。
  • ara::crypto::CryptoErrc::kAuthTagNotValid:在解密时无法确认数据真实性 [SWS_CRYPT_50075]。
  • ara::crypto::CryptoErrc::kUnsupported:上下文不支持流式处理 [SWS_CRYPT_50075]。

注意:本使用说明基于规范数据自动生成。

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

Parameter (in)

ParameterBeschreibung
inan input data buffer that contains a part of the plaintext/ciphertext

Parameter (out)

ParameterBeschreibung
outan output data buffer that the en-/decrypted data is written to

Parameter (in/out)

ParameterBeschreibung
tagfor decryption: an input data buffer that contains the authentication tag for encryption: an output data buffer that the authentication tag is written to

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out

Fehler

FehlercodeBeschreibung
ProcessingNotStartedif data processing has not been started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer or the authentication tag is invalid
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics if the processed data cannot be authenticated during decryption
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context or

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50075
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50075@rel:R25-11#40b534f1
Content hash
40b534f1
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50075
Status: valid/unmigrated Version: rel:R25-11#61f4f343 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_50075@rel:R25-11#61f4f343
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

函数 FinishEncrypt [SWS_CRYPT_50076] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > FinishEncrypt (ReadOnlyMem Region in, ReadWriteMemRegion out, ReadWriteMemRegion tag, ReadWrite MemRegion ivOut) noexcept=0;

Finalize the encryption and calculate the authentication tag and return the IV generated by the context.

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

使用

方法 FinishEncrypt 在 ara::crypto::cryp::AuthCipherCtx 中同步结束认证加密操作,计算认证标签并通过 ivOut 返回上下文生成的初始化向量[SWS_CRYPT_50076]。该调用被指定为线程安全且异常安全(exception safe)[SWS_CRYPT_50076]。作为结果,该函数返回包含实际写入输出缓冲区 out 的字节数的 ara::core::Result<std::size_t>,其中输出大小允许小于缓冲区容量[SWS_CRYPT_50076]。解释:尽管名称指向加密,但参数 tag 的规范以及错误码 ara::crypto::CryptoErrc::kAuthTagNotValid 表明,该签名在上下文中推测对称地也可用于解密操作。 问题 Q-6b924f12c32e0f33 (未决)

交互与缓冲区大小确定

数据处理必须预先强制通过 Start() 启动,否则函数将报告错误 ProcessingNotStarted[SWS_CRYPT_50076]。关于缓冲区尺寸规划,应注意与以下上下文函数的交互:

错误处理与边界条件

发生错误时,所有反馈均具有定义的回滚语义[SWS_CRYPT_50076]。如果输入数据或认证标签的缓冲区大小无效,则返回 ara::crypto::CryptoErrc::kInvalidInputSize[SWS_CRYPT_50076]。此外,如果不受流式处理支持、未使用 IV 或在启动时已由应用程序指定了 IV,则函数返回 ara::crypto::CryptoErrc::kUnsupported[SWS_CRYPT_50076]。

此使用说明由 AI 创建,并且仅基于规范数据。

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

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

Parameter (in)

ParameterBeschreibung
inan input data buffer that contains a part of the plaintext/ciphertext

Parameter (out)

ParameterBeschreibung
outan output data buffer that the en-/decrypted data is written to
ivOutan output data buffer that contains the IV

Parameter (in/out)

ParameterBeschreibung
tagfor decryption: an input data buffer that contains the authentication tag for encryption: an output data buffer that the authentication tag is written to

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out

Fehler

FehlercodeBeschreibung
ProcessingNotStartedif data processing has not been started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer or the authentication tag is invalid
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics if the processed data cannot be authenticated during decryption
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context or if this context does not use an IV or if the IV has been provided by the application in the Start() function

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50076
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50076@rel:R25-11#9165700c
Content hash
9165700c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50076
Status: valid/unmigrated Version: rel:R25-11#7ffd5c95 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_50076@rel:R25-11#7ffd5c95
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

函数 GetMaxAssociatedDataSize [SWS_CRYPT_20103] Upstream: RS_CRYPTO_02309

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

Get maximum supported size of associated public data.

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >maximal supported size of associated public data in bytes

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this interface is not supported

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

Record
AUTOSAR/AP/record/SWS_CRYPT_20103
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20103@rel:R25-11#9fcea2b7
Content hash
9fcea2b7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20103
Status: valid/unmigrated Version: rel:R25-11#7d3e4b66 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_20103@rel:R25-11#7d3e4b66
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#91aa2c602026-09-30
  • R20-11rel:R20-11#91749f732026-10-14
  • R21-11rel:R21-11#c88a3b9a2026-10-14
  • R22-11rel:R22-11#e871a6a52026-10-14
  • R23-11rel:R23-11#84dddf6c2026-10-14
  • R24-11rel:R24-11#c2f0c3512026-10-14
  • R25-11rel:R25-11#7d3e4b662026-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

函数 GetMaximumChunkSize [SWS_CRYPT_50082] 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(), FinishEncrypt() or ProcessSingleCall() by this context.

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >the maximum buffer size in bytes

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this interface is not supported

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50082
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50082@rel:R25-11#e26055cc
Content hash
e26055cc
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50082
Status: valid/unmigrated Version: rel:R25-11#f8e55f72 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_50082@rel:R25-11#f8e55f72
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

函数 GetMaximumInputIvSize [SWS_CRYPT_50164] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< std::size_t > GetMaximumInputIvSize (Crypto Transform transformDirection) const noexcept=0;

Get the maximum IV size required to be passed to the context in the functions Start() and ProcessSingleCallWithInputIv() for the given transformDirection.

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

Parameter (in)

ParameterBeschreibung
transformDirectionthe transformation direction, i.e., encryption or decryption

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >size of IV in bytes

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this interface is not supported

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50164
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50164@rel:R25-11#9254440c
Content hash
9254440c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50164
Status: valid/unmigrated Version: rel:R25-11#1567e5b7 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_50164@rel:R25-11#1567e5b7
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

函数 GetMinimumChunkSize [SWS_CRYPT_50162] Upstream: RS_CRYPTO_02309

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

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

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >the minimum buffer size in bytes

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this interface is not supported

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50162
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50162@rel:R25-11#a05d3658
Content hash
a05d3658
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50162
Status: valid/unmigrated Version: rel:R25-11#aa502d0a 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_50162@rel:R25-11#aa502d0a
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

函数 GetMinimumInputIvSize [SWS_CRYPT_50163] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< std::size_t > GetMinimumInputIvSize (Crypto Transform transformDirection) const noexcept=0;

Get the minimum IV size required to be passed to the context in the functions Start() and ProcessSingleCallWithInputIv() for the given transformDirection.

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

Parameter (in)

ParameterBeschreibung
transformDirectionthe transformation direction, i.e., encryption or decryption

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >size of IV in bytes

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this interface is not supported

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50163
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50163@rel:R25-11#606fc0fa
Content hash
606fc0fa
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50163
Status: valid/unmigrated Version: rel:R25-11#452ee080 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_50163@rel:R25-11#452ee080
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

函数 GetOutputIvSize [SWS_CRYPT_50165] Upstream: RS_CRYPTO_02309

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

Get the output IV size that will be returned by the functions FinishEncrypt() (in case no IV has been provided by the application during the call to Start()), and EncryptSingleCallWithOutputIv().

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >size of IV in bytes

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this interface is not supported

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50165
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50165@rel:R25-11#4d089d83
Content hash
4d089d83
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50165
Status: valid/unmigrated Version: rel:R25-11#b902740e 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_50165@rel:R25-11#b902740e
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

函数 GetRequiredOutputBufferSize [SWS_CRYPT_50081] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > GetRequiredOutputBufferSize (std::size_t inputSize, bool isFinal) const noexcept;

Calculate the maximum required size of the output buffer depending on the input size in the current state of the context.

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

Parameter (in)

ParameterBeschreibung
inputSizesize of input data
isFinalif true, calculate maximum required output buffer size for Finish(), FinishEncrypt() and ProcessSingleCall() otherwise for Update()

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the required capacity of the output buffer (in bytes) or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if the context was not initialized by deploying a key and setting the transformation direction
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this interface is not supported

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50081
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50081@rel:R25-11#c51ad912
Content hash
c51ad912
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50081
Status: valid/unmigrated Version: rel:R25-11#6a6a83e1 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_50081@rel:R25-11#6a6a83e1
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

函数 GetTagSize [SWS_CRYPT_50161] Upstream: RS_CRYPTO_02309

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

Get the output tag size.

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >size of the authentication tag in bytes

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this interface is not supported

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50161
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50161@rel:R25-11#124343b7
Content hash
124343b7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50161
Status: valid/unmigrated Version: rel:R25-11#f81af579 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_50161@rel:R25-11#f81af579
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

函数 ProcessSingleCall [SWS_CRYPT_50078] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > ProcessSingleCall (ReadOnly MemRegion dataIn, ReadWriteMemRegion dataOut, ReadWriteMemRegion tag, CryptoTransform transformDirection, ara::core::Optional< ReadOnlyMem Region > authenticatedData) noexcept=0;

Perform en-/decryption and calculate/verify of the authentication tag in a single-call without setting or returning an IV.

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

来自 ara::crypto::cryp::AuthCipherCtx 的同步且定义为线程安全的方法 ProcessSingleCall 在不使用初始化向量(IV)的单一操作中执行有效负载数据的加解密以及认证 Tag 的同时计算或校验 [SWS_CRYPT_50078]。可通过可选缓冲区 authenticatedData 提供附加认证数据 [SWS_CRYPT_50078]。缓冲区 tag 在解密时用作用于校验的输入,在加密时用作用于存储生成的认证 Tag 的输出 [SWS_CRYPT_50078]。处理成功时,ara::core::Result<std::size_t> 返回写入 dataOut 中的实际字节数,该字节数可能小于目标缓冲区的容量 [SWS_CRYPT_50078]。

在调用之前,必须已通过成功调用 SetKey 初始化加密上下文;否则函数将失败并返回 ara::crypto::CryptoErrc::kUninitializedContext [SWS_CRYPT_50078]。此外,所使用的密钥必须针对请求的转换方向获得授权(kAllowDataEncrypt 或 kAllowDataDecrypt),否则将报告 ara::crypto::CryptoErrc::kUsageViolation [SWS_CRYPT_50078]。如果单步处理不受支持或上下文需要 IV,函数将返回 ara::crypto::CryptoErrc::kUnsupported [SWS_CRYPT_50078]。如果在解密时认证失败,则会触发 ara::crypto::CryptoErrc::kAuthTagNotValid [SWS_CRYPT_50078]。所分配密钥槽上的错误通过 EmptyKeySlot、ara::crypto::CryptoErrc::kBusyResource 或 ara::crypto::CryptoErrc::kIncompatibleObject 指示 [SWS_CRYPT_50078]。

对于缓冲区管理,可预先通过置位标志 isFinal = true 的 GetRequiredOutputBufferSize 计算 dataOut 所需的最大输出大小 [SWS_CRYPT_50081];输出缓冲区过小会导致 ara::crypto::CryptoErrc::kInsufficientCapacity [SWS_CRYPT_50078]。此外,dataIn 的大小必须符合 GetMinimumChunkSize [SWS_CRYPT_50162] 和 GetMaximumChunkSize [SWS_CRYPT_50082] 的限制,以避免 ara::crypto::CryptoErrc::kInvalidInputSize [SWS_CRYPT_50078]。

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

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

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

Parameter (in)

ParameterBeschreibung
dataInan input data buffer containing the plaintext/ciphertext
transformDirectionthe transformation direction, i.e., encryption or decryption
authenticatedDataoptional additional authenticated data

Parameter (out)

ParameterBeschreibung
dataOutan output data buffer that contains en-/decrypted data

Parameter (in/out)

ParameterBeschreibung
tagfor decryption: an input data buffer that contains the authentication tag. for encryption: an output data buffer that the authentication tag is written to.

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.

Fehler

FehlercodeBeschreibung
EmptyKeySlotif a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if single shot processing is not supported by the context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context requires setting or returning an IV
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if SetKey has not been successfully called before
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics if a KeySlot has been configured, but is currently busy
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the SymmetricKey deployed or contained in the provided KeySlot at the time of invocation of this interface does not include kAllowDataEncrypt for encryption, or kAllowData Decrypt for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if a KeySlot has been configured, but does not contain a Symmetric Key
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided input buffer or authentication tag is invalid
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics if the transformDirection is kDecrypt and the processed data cannot be authenticated

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50078
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50078@rel:R25-11#405342bf
Content hash
405342bf
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50078
Status: valid/unmigrated Version: rel:R25-11#e0ad5fae 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_50078@rel:R25-11#e0ad5fae
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

函数 ProcessSingleCallWithInputIv [SWS_CRYPT_50079] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > ProcessSingleCallWithInputIv (ReadOnlyMemRegion dataIn, ReadWriteMemRegion dataOut, ReadWriteMem Region tag, CryptoTransform transformDirection, ReadOnlyMemRegion iv, ara::core::Optional< ReadOnlyMemRegion > authenticatedData) noexcept=0;

Perform en-/decryption and calculate/verify of the authentication tag in a single-call, providing an IV to be used during en-/decryption.

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

类 ara::crypto::cryp::AuthCipherCtx 的方法 [SWS_CRYPT_50079] 执行同步单步处理(Single-Call),用于对数据进行加密或解密,同时计算或验证认证 Tag。

调用时,通过 dataIn 指定输入数据,并通过 transformDirection 指定方向。初始化向量通过 iv 传递,可选的认证数据可以通过 authenticatedData 提供 [SWS_CRYPT_50079]。缓冲区 tag 在加密情况下用作计算出的 Tag 的输出,在解密情况下用作验证的输入 [SWS_CRYPT_50079]。在成功时,返回值 ara::core::Result<std::size_t> 提供写入 dataOut 的字节数,该数值可能小于缓冲区容量 [SWS_CRYPT_50079]。

在发生错误时,所有错误代码均具有回滚语义 [SWS_CRYPT_50079]:

  • ara::crypto::CryptoErrc::kUninitializedContext:事先未通过 SetKey 配置密钥 [SWS_CRYPT_50079]。
  • ara::crypto::CryptoErrc::kUsageViolation:密钥不具备所需的权限 kAllowDataEncrypt 或 kAllowDataDecrypt [SWS_CRYPT_50079]。
  • ara::crypto::CryptoErrc::kEmptyKeySlot、ara::crypto::CryptoErrc::kBusyResource 或 ara::crypto::CryptoErrc::kIncompatibleObject:配置的 KeySlot 为空、被占用或不包含兼容的 SymmetricKey [SWS_CRYPT_50079]。
  • ara::crypto::CryptoErrc::kInvalidInputSize 或 ara::crypto::CryptoErrc::kInsufficientCapacity:输入、Tag 或 IV 的缓冲区大小无效,或者 dataOut 提供的容量不足 [SWS_CRYPT_50079]。
  • ara::crypto::CryptoErrc::kAuthTagNotValid:在解密时认证失败 [SWS_CRYPT_50079]。
  • ara::crypto::CryptoErrc::kUnsupported:上下文不支持单次处理(Single-Shot),或者上下文要求设置或输出 IV [SWS_CRYPT_50079]。

该操作被定义为 thread-safe 和 exception safe [SWS_CRYPT_50079]。iv 的允许长度可以通过 GetMinimumInputIvSize [SWS_CRYPT_50163] 和 GetMaximumInputIvSize [SWS_CRYPT_50164] 动态查询。与 SymmetricCipherCtx [SWS_CRYPT_50048] 中的纯块密码相比,该接口在单次调用中将加密转换和完整性检查结合在一起。

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

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

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

Parameter (in)

ParameterBeschreibung
dataInan input data buffer containing the plaintext/ciphertext
transformDirectionthe transformation direction, i.e., encryption or decryption
ivan Initialization Vector (IV) or "nonce" value
authenticatedDataoptional additional authenticated data

Parameter (out)

ParameterBeschreibung
dataOutan output data buffer that contains en-/decrypted data

Parameter (in/out)

ParameterBeschreibung
tagfor decryption: an input data buffer that contains the authentication tag. for encryption: an output data buffer that the authentication tag is written to.

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if single shot processing is not supported by the context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context requires setting or returning an IV
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if SetKey has not been successfully called before
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics if a KeySlot has been configured, but is currently busy
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the SymmetricKey deployed or contained in the provided KeySlot at the time of invocation of this interface does not include kAllowDataEncrypt for encryption, or kAllowData Decrypt for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if a KeySlot has been configured, but does not contain a Symmetric Key
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided input buffer, authentication tag, or IV is invalid
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the data or IV output buffer is too small
ara::crypto::CryptoErrc::kAuthTagNotValidrollback_semantics if the transformDirection is kDecrypt and the processed data cannot be authenticated

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50079
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50079@rel:R25-11#f39ba0fc
Content hash
f39ba0fc
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50079
Status: valid/unmigrated Version: rel:R25-11#971c6b5c 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_50079@rel:R25-11#971c6b5c
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

函数 SetKey [SWS_CRYPT_23911] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

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

The interface shall configure the context to use the provided SymmetricKey.

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

方法 SetKey 配置 ara::crypto::cryp::AuthCipherCtx 的实例以使用所传递的对称密钥 [SWS_CRYPT_23911]。作为参数传递一个共享指针 key(类型为 SymmetricKey::Sptr),该指针用于经过身份验证的加密或解密 [SWS_CRYPT_23911]。该调用同步进行,声明为 noexcept,并返回一个 ara::core::Result<void> [SWS_CRYPT_23911]。

在出错时,结果将以回滚语义重置并提供特定错误代码 [SWS_CRYPT_23911]:

  • ara::crypto::CryptoErrc::kUnsupported:如果上下文仅支持通过 KeySlot 进行配置 [SWS_CRYPT_23911]。
  • ara::crypto::CryptoErrc::kIncompatibleObject:如果传递的密钥类型与当前上下文不兼容 [SWS_CRYPT_23911]。
  • ara::crypto::CryptoErrc::kUsageViolation:如果密钥允许的使用标志不包含用于加密的 kAllowDataEncrypt 或用于解密的 kAllowDataDecrypt [SWS_CRYPT_23911]。

根据规范,该接口被归类为线程安全(thread-safe)和异常安全(exception safe)[SWS_CRYPT_23911]。在与模块上下文交互时,很可能应在通过 Start 初始化新转换之前设置密钥 [SWS_CRYPT_24715]。 问题 Q-11f7daa370f5d438 (未决)

本使用说明基于 AUTOSAR 有效负载自动生成。

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

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

Parameter (in)

ParameterBeschreibung
keysymmetric key object used for authenticated en-/decryption

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context only supports setting a KeySlot
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the provided SymmetricKey is incompatible with this AuthCipher Ctx
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the provided SymmetricKey does not include kAllowDataEncrypt for encryption, or kAllowDataDecrypt for decryption, respectively

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

Record
AUTOSAR/AP/record/SWS_CRYPT_23911
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_23911@rel:R25-11#3b567ae6
Content hash
3b567ae6
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_23911
Status: valid/unmigrated Version: rel:R25-11#205c09dd 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_23911@rel:R25-11#205c09dd
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#7fa81c372026-09-30
  • R19-11rel:R19-11#fcb0604e2026-10-14
  • R20-11rel:R20-11#43c209ac2026-10-14
  • R21-11rel:R21-11#9babec8c2026-10-14
  • R22-11rel:R22-11#a5a2e9812026-10-14
  • R23-11rel:R23-11#1982ebed2026-10-14
  • R24-11rel:R24-11#3524b4832026-10-14
  • R25-11rel:R25-11#205c09dd2026-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

函数 SetKey [SWS_CRYPT_50072] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0;

The interface shall configure the context to use the key stored in the provided KeySlot when the authenticated encrypt or decrypt operation is executed.

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

接口 ara::crypto::cryp::AuthCipherCtx 中的函数 SetKey 配置加密操作的上下文,以便在执行认证加密或解密时,立即使用存储在所提供密钥槽中的对称密钥[SWS_CRYPT_50072]。

用法:同步调用通过 ara/crypto/cryp/auth_cipher_ctx.h 中的接口进行。封装了对称密钥的 KeySlot::Sptr 实例作为参数 keySlot 传递[SWS_CRYPT_50072]。该函数返回 ara::core::Result<void>,用于确认成功或包含错误码[SWS_CRYPT_50072]。

错误处理:如果上下文的具体实现仅支持通过 SymmetricKey 对象进行直接配置,而不提供通过 KeySlot 的设置,则调用失败。在这种情况下,将返回具有回滚语义的错误 ara::crypto::CryptoErrc::kUnsupported[SWS_CRYPT_50072]。

并发与限制:该函数被指定为 thread-safe 和 exception safe[SWS_CRYPT_50072]。它可以并发调用,并确保在异常情况下不会留下不一致的状态。

交互作用:作为功能替代,可以使用带有直接 SymmetricKey::Sptr 的重载 SetKey[SWS_CRYPT_23911]。成功进行密钥绑定后,通过 Start 使用操作方向以及初始化向量对上下文进行初始化[SWS_CRYPT_24715]。此外,在 MessageAuthnCodeCtx [SWS_CRYPT_50026] 和 SymmetricKeyWrapperCtx [SWS_CRYPT_50034] 中也存在带有 KeySlot::Sptr 的类似签名。

此文本由 AI 创建,并基于 AUTOSAR R25-11 规范。

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

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

Parameter (in)

ParameterBeschreibung
keySlota keyslot containing a symmetric key

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context only supports setting a SymmetricKey

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50072
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50072@rel:R25-11#56d928f5
Content hash
56d928f5
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50072
Status: valid/unmigrated Version: rel:R25-11#3dd5795a 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_50072@rel:R25-11#3dd5795a
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_24715] Upstream: RS_CRYPTO_02302

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

Initialize the context for a new encryption or decryption and set the IV used by the context.

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

方法 Start 初始化上下文 ara::crypto::cryp::AuthCipherCtx 以进行新的加密或解密,并设置要使用的初始化向量(IV)或 Nonce 值 [SWS_CRYPT_24715]。通过参数 transformDirection 确定转换方向,而 iv 则以 ReadOnlyMemRegion 形式传递向量 [SWS_CRYPT_24715]。允许的 IV 大小可通过 GetMinimumInputIvSize() 以及 GetMaximumInputIvSize() 确定;长度有偏差时,该函数会报告错误 ara::crypto::CryptoErrc::kInvalidInputSize [SWS_CRYPT_24715]。

在调用之前必须已成功执行 SetKey,否则将返回 ara::crypto::CryptoErrc::kUninitializedContext [SWS_CRYPT_24715]。已配置的 KeySlot 既不能为空(EmptyKeySlot)也不能被占用(ara::crypto::CryptoErrc::kBusyResource)[SWS_CRYPT_24715]。此外,存储的密钥必须是匹配的 SymmetricKey(否则为 ara::crypto::CryptoErrc::kIncompatibleObject),并具有所需方向的权限(kAllowDataEncrypt 或 kAllowDataDecrypt,否则为 ara::crypto::CryptoErrc::kUsageViolation)[SWS_CRYPT_24715]。若缺少对流处理的支持或在所选方向设置 IV 的支持,则调用失败并返回 ara::crypto::CryptoErrc::kUnsupported [SWS_CRYPT_24715]。所有错误均具有回滚语义 [SWS_CRYPT_24715]。

该操作被声明为 thread-safe 以及 exception-safe(noexcept)[SWS_CRYPT_24715]。在密码学流程的交互中,成功初始化之后通常很可能接着通过 UpdateAuthenticatedData 传递额外的经过身份验证的数据 [SWS_CRYPT_20313]。 问题 Q-e023e27f1cd24507 (未决)

本使用说明基于 AUTOSAR 发行版本 R25-11 自动生成。

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

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

Parameter (in)

ParameterBeschreibung
transformDirectionthe transformation direction, i.e., encryption or decryption
ivan Initialization Vector (IV) or "nonce" value. The allowed size of the IV can be queried using the functions GetMinimumInputIvSize() and GetMaximumInputIvSize().

Rückgabewert

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

Fehler

FehlercodeBeschreibung
EmptyKeySlotif a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context does not support setting an IV in the given transform Direction
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if SetKey has not been successfully called before
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics if the configured KeySlot is currently busy
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the SymmetricKey deployed or contained in the provided KeySlot at the time of invocation of this interface does not include kAllowDataEncrypt for encryption, or kAllowData Decrypt for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if a KeySlot has been configured, but does not contain a Symmetric Key
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided IV is not supported

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

Record
AUTOSAR/AP/record/SWS_CRYPT_24715
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_24715@rel:R25-11#828cf788
Content hash
828cf788
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_24715
Status: valid/unmigrated Version: rel:R25-11#dacbb482 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_24715@rel:R25-11#dacbb482
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#85d3f6962026-09-30
  • R19-11rel:R19-11#ea0e49642026-10-14
  • R20-11rel:R20-11#e9fc84162026-10-14
  • R21-11rel:R21-11#a59d78ec2026-10-14
  • R22-11rel:R22-11#dca7e5782026-10-14
  • R23-11rel:R23-11#640bb79c2026-10-14
  • R24-11rel:R24-11#f389a1072026-10-14
  • R25-11rel:R25-11#dacbb4822026-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

函数 Start [SWS_CRYPT_50073] Upstream: RS_CRYPTO_02302

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

Initialize the context for a new encryption or decryption. An IV is either not required for this context in this transformation direction, or set by the context itself.

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

使用

类 ara::crypto::cryp::AuthCipherCtx 的纯虚方法 Start 同步初始化上下文以进行即将进行的加密或解密[SWS_CRYPT_50073]。通过参数 transformDirection 指定是将上下文准备用于加密还是解密。仅当加密上下文在所选转换方向上不需要 IV 或自行确定 IV 时,才允许使用这种没有初始化向量(IV)的重载[SWS_CRYPT_50073]。在成功情况下返回值为一个空的 ara::core::Result<void>,或者返回相应的错误码。

错误处理与前置条件

在调用之前,必须已通过 SetKey 为上下文成功配置了密钥;否则函数失败并返回 ara::crypto::CryptoErrc::kUninitializedContext[SWS_CRYPT_50073]。此外,在错误情况下还会出现以下返回值:

  • 如果上下文不支持流式处理,或者上下文在所选转换方向上强制要求显式指定 IV,则返回 ara::crypto::CryptoErrc::kUnsupported[SWS_CRYPT_50073]。
  • 如果在调用时配置的 KeySlot 中的允许密钥用途不包含用于加密所需的权限 kAllowDataEncrypt 或用于解密所需的权限 kAllowDataDecrypt,则返回 ara::crypto::CryptoErrc::kUsageViolation[SWS_CRYPT_50073]。
  • 如果配置的 KeySlot 当前为空或被阻塞,则分别返回 EmptyKeySlot 或 ara::crypto::CryptoErrc::kBusyResource[SWS_CRYPT_50073]。
  • 如果配置的 KeySlot 不包含 SymmetricKey,或者该密钥类型不受上下文支持,则返回 ara::crypto::CryptoErrc::kIncompatibleObject[SWS_CRYPT_50073]。

如果发生错误,指定的回滚语义(rollback_semantics)生效[SWS_CRYPT_50073]。

并发性与交互

该函数声明为 noexcept=0,确保异常安全性,并采用线程安全设计[SWS_CRYPT_50073]。如果算法需要外部提供初始化向量,则应使用重载 Start(CryptoTransform, ReadOnlyMemRegion)[SWS_CRYPT_24715]。成功初始化后,附加认证数据可通过 UpdateAuthenticatedData 计入认证标签的计算中[SWS_CRYPT_20313]。

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

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

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

Parameter (in)

ParameterBeschreibung
transformDirectionthe transformation direction, i.e., encryption or decryption

Rückgabewert

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

Fehler

FehlercodeBeschreibung
EmptyKeySlotif a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context requires setting an IV in the given transformDirection
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if SetKey has not been successfully called before
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics if a KeySlot has been configured, but is currently busy
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the SymmetricKey deployed or contained in the provided KeySlot at the time of invocation of this interface does not include kAllowDataEncrypt for encryption, or kAllowData Decrypt for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if a KeySlot has been configured, but does not contain a Symmetric Key
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if a KeySlot has been configured, but the SymmetricKey contained is not supported by this context

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50073
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50073@rel:R25-11#5b5ae942
Content hash
5b5ae942
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50073
Status: valid/unmigrated Version: rel:R25-11#24eaa91a 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_50073@rel:R25-11#24eaa91a
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

函数 UpdateAuthenticatedData [SWS_CRYPT_20313] Upstream: RS_CRYPTO_02302

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

Update the tag calculation by a new chunk of additional authenticated data.

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

接口 ara::crypto::cryp::AuthCipherCtx 的方法 UpdateAuthenticatedData 用于通过额外的附加认证数据(Additional Authenticated Data)片段逐步更新认证标记的计算 [SWS_CRYPT_20313]。通过参数 authenticatedData,相应的缓冲区作为 ReadOnlyMemRegion 传递 [SWS_CRYPT_20313]。

关于调用上下文和并发性,该操作被定义为 thread-safe 以及 exception safe [SWS_CRYPT_20313]。对于调用,严格的顺序条件适用:

  • 转换必须事先通过方法 Start() 启动,否则将报告 ara::crypto::CryptoErrc::kProcessingNotStarted [SWS_CRYPT_20313]。
  • 如果 UpdateConfidentialData 已经执行,则不得再调用该函数;若不遵守,将返回错误 ara::crypto::CryptoErrc::kInvalidUsageOrder [SWS_CRYPT_20313]。

该函数返回一个 ara::core::Result<void> 作为返回值,在成功时为空,或者封装发生的错误代码 [SWS_CRYPT_20313]。所有错误均具有回滚语义 [SWS_CRYPT_20313]:

  • ara::crypto::CryptoErrc::kInvalidInputSize:传入的输入缓冲区大小无效 [SWS_CRYPT_20313]。
  • ara::crypto::CryptoErrc::kUnsupported:当前上下文不支持流处理 [SWS_CRYPT_20313]。

此文本由 AI 生成,仅供参考。具有约束力的是 AUTOSAR 规范。

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

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

Parameter (in)

ParameterBeschreibung
authenticatedDataa part of the additional authenticated data

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if the processing was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidUsageOrderrollback_semantics if UpdateConfidentialData has already been called
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context

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

Record
AUTOSAR/AP/record/SWS_CRYPT_20313
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20313@rel:R25-11#72de70b8
Content hash
72de70b8
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20313
Status: valid/unmigrated Version: rel:R25-11#fcb70f91 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_20313@rel:R25-11#fcb70f91
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#e6b736912026-09-30
  • R19-11rel:R19-11#f75b41ea2026-10-14
  • R20-11rel:R20-11#4c46c8f42026-10-14
  • R21-11rel:R21-11#50979c0c2026-10-14
  • R22-11rel:R22-11#f4a00d3a2026-10-14
  • R23-11rel:R23-11#a528f60f2026-10-14
  • R24-11rel:R24-11#7dfc69482026-10-14
  • R25-11rel:R25-11#fcb70f912026-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

函数 UpdateConfidentialData [SWS_CRYPT_50074] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > UpdateConfidentialData (Read OnlyMemRegion in, ReadWriteMemRegion out) noexcept=0;

Encrypt or decrypt confidential data. When used for decryption, the plaintext is returned without verifying its authenticity. An application must not use the data before verifying its authenticity using Finish().

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

类 ara::crypto::cryp::AuthCipherCtx 的方法 UpdateConfidentialData 用于在已认证加密上下文中逐步加密或解密机密有效负载数据 [SWS_CRYPT_50074]。向其传入包含明文或密文一部分的输入缓冲区 in(类型 ReadOnlyMemRegion)以及输出缓冲区 out(类型 ReadWriteMemRegion)[SWS_CRYPT_50074]。作为同步返回值,该函数提供一个 ara::core::Result<std::size_t>,其在成功时包含实际写入的字节数;该字节数可能小于 out 的容量 [SWS_CRYPT_50074]。

关于流程和并发性,适用以下条件:

  • 执行顺序与完整性:在处理之前,必须已通过 Start() 发起该过程 [SWS_CRYPT_50074]。如果该方法用于解密,则在没有事先进行真实性校验的情况下输出明文;应用程序绝不能在通过 Finish() 进行最终验证之前使用这些数据 [SWS_CRYPT_50074]。附加认证数据可并行通过 UpdateAuthenticatedData 计入 Tag 计算 [SWS_CRYPT_20313]。
  • 线程安全与异常安全:该操作被声明为线程安全及异常安全,并且不引发异常(noexcept)[SWS_CRYPT_50074]。

如果处理失败,则适用回滚语义并在 ara::core::Result 中返回相应错误码 [SWS_CRYPT_50074]:

  • ara::crypto::CryptoErrc::kProcessingNotStarted:处理尚未通过 Start() 发起 [SWS_CRYPT_50074]。
  • ara::crypto::CryptoErrc::kInsufficientCapacity:输出缓冲区 out 分配的尺寸过小 [SWS_CRYPT_50074]。
  • ara::crypto::CryptoErrc::kInvalidInputSize:缓冲区 in 的大小无效 [SWS_CRYPT_50074]。
  • ara::crypto::CryptoErrc::kUnsupported:上下文不支持流式处理 [SWS_CRYPT_50074]。

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

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

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

Parameter (in)

ParameterBeschreibung
inan input data buffer containing a part of the ciphertext or plaintext

Parameter (out)

ParameterBeschreibung
outan output data buffer that the encrypted or decrypted data is written too

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >a result containing the size of the output data or an error. The output data may be smaller than the size of the output buffer out.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer is invalid
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50074
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50074@rel:R25-11#0452f000
Content hash
0452f000
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50074
Status: valid/unmigrated Version: rel:R25-11#342cdc85 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_50074@rel:R25-11#342cdc85
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_20101] Upstream: RS_CRYPTO_02207

using Sptr = std::shared_ptr<AuthCipherCtx>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/auth_cipher_ctx.h"
Scopeclass ara::crypto::cryp::AuthCipherCtx
SymbolSptr

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

Record
AUTOSAR/AP/record/SWS_CRYPT_20101
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20101@rel:R25-11#5c636f34
Content hash
5c636f34
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20101
Status: valid/unmigrated Version: rel:R25-11#56d76308 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_20101@rel:R25-11#56d76308
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#6cded4ce2026-09-30
  • R19-11rel:R19-11#d499b7852026-10-14
  • R20-11rel:R20-11#38ae99fd2026-10-14
  • R21-11rel:R21-11#15df77a52026-10-14
  • R22-11rel:R22-11#22ad2b2d2026-10-14
  • R23-11rel:R23-11#d20afa502026-10-14
  • R24-11rel:R24-11#d20afa502026-10-14
  • R25-11rel:R25-11#56d763082026-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