DEENESPTFRRUARHIKOZHNL

类 ara::crypto::cryp::SymmetricCipherCtx

[SWS_CRYPT_50136] Upstream: RS_CRYPTO_02201

class SymmetricCipherCtx :           public CryptoContext {...};

Interface for Symmetric Cipher Operations.

Header-Datei#include "ara/crypto/cryp/symmetric_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 · 温度: 不可控 · 提示词: 0261b663ca0d 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

用作数据流或单次调用中对称加密和解密操作的接口。

类 ara::crypto::cryp::SymmetricCipherCtx 用作 AUTOSAR Adaptive 中对称加密和解密操作的线程安全接口 [SWS_CRYPT_50044]。通过 SetKey() 配置密钥后,数据既可以在单次调用中处理,也可以在由 Start()、Update() 和 Finish() 组成的流式周期中逐步处理 [SWS_CRYPT_50138]、[SWS_CRYPT_50139]。所有方法均规范为 noexcept,并通过 ara::core::Result [SWS_CRYPT_50140] 发出诸如缺少初始化或缓冲区过小等错误信号。

上下文

接口 ara::crypto::cryp::SymmetricCipherCtx 封装对称加密转换,包括加密和解密操作。在加密架构内,该类充当对称算法的执行上下文,并与密钥对象以及存储缓冲区协作。为了配置加密密钥,该类要么直接通过 SymmetricKey [SWS_CRYPT_50138] 与临时密钥交互,要么通过 KeySlot [SWS_CRYPT_50043] 与持久或隔离管理的密钥交互。待处理的明文、密文以及初始化向量 (IV) 通过类型为 ReadOnlyMemRegion 和 ReadWriteMemRegion 的内存区域传递和接收 [SWS_CRYPT_50048]、[SWS_CRYPT_50049]。

生命周期

接口的生命周期和所有权关系主要通过类型化智能指针别名 Sptr (std::shared_ptr<SymmetricCipherCtx>) 控制 [SWS_CRYPT_50137]。在实践中,具体实例的提供推测通过上级加密工厂方法进行(解释),因为接口定义本身未指明创建函数。 问题 Q-5b5f5ffdf964c91f (未决)

实例化后,上下文经历多个运行阶段:

SymmetricCipherCtx 的所有方法均声明为 noexcept,确保异常安全性(“exception safe”),并被规范为支持并发访问的线程安全(“thread-safe”)[SWS_CRYPT_50044]、[SWS_CRYPT_50139]。

SymmetricCipherCtxState Uninitialized Uninitialized Initialized Initialized Uninitialized->Initialized SetKey() Initialized->Initialized ProcessSingleCall...() Streaming Streaming Initialized->Streaming Start() Streaming->Initialized Finish() / FinishEncrypt() / Cancel() Streaming->Streaming Update() / Seek()

状态图:对称密码上下文的生命周期和状态转换。来源:[SWS_CRYPT_50138]、[SWS_CRYPT_50044]、[SWS_CRYPT_50139]、[SWS_CRYPT_50045]、[SWS_CRYPT_50046]

使用路径

在实际数据转换之前,建议确定所需的缓冲区和分块大小。通过 GetMinimumChunkSize() [SWS_CRYPT_50144] 和 GetMaximumChunkSize() [SWS_CRYPT_50050] 可以确定输入块的允许界限。如果需要初始化向量,可通过 GetMinimumInputIvSize() [SWS_CRYPT_50141]、GetMaximumInputIvSize() [SWS_CRYPT_50142] 或 GetOutputIvSize() [SWS_CRYPT_50143] 查询其长度限制。操作所需的最大目标缓冲区大小使用 GetRequiredOutputBufferSize() 计算 [SWS_CRYPT_50140]。

对于逐步流式加密或解密,适用以下标准流程:

  1. 配置密钥:通过 SetKey() [SWS_CRYPT_50138] 将加密密钥绑定到上下文。
  2. 启动转换:调用 Start(),指定转换方向(加密或解密)以及可选 IV [SWS_CRYPT_23625] 或不带 IV [SWS_CRYPT_50044]。
  3. 转换数据块:重复调用 Update() 以逐步传递输入数据并提取输出数据 [SWS_CRYPT_50139]。如有需要,可在数据流内通过 Seek() 进行定位 [SWS_CRYPT_23613]。
  4. 结束:通过 Finish() [SWS_CRYPT_50045] 进行完成,或者如果需要返回由上下文生成的 IV,则通过 FinishEncrypt() 进行完成 [SWS_CRYPT_23618]。

作为该流式模式的替代方案,该接口支持同步单次调用。如果存在全部有效负载,可直接通过 ProcessSingleCall() [SWS_CRYPT_50047]、ProcessSingleCallWithInputIv() [SWS_CRYPT_50048] 执行操作,或者对于上下文拥有的 IV 生成,通过 EncryptSingleCallWithOutputIv() [SWS_CRYPT_50049] 执行操作。

对称数据流加密应用SymmetricCipherCtxSetKey(key)Result<void>Start(kEncrypt, iv)Result<void>loop只要存在数据块Update(in, out)Result<size_t>FinishEncrypt(in, out, ivOut)Result<size_t>

时序图:流式加密的典型调用顺序。来源:[SWS_CRYPT_50138]、[SWS_CRYPT_23625]、[SWS_CRYPT_50139]、[SWS_CRYPT_23618]

错误场景

类的方法通过 ara::core::Result 发出错误信号,其代码来自错误域 ara::crypto::CryptoErrc。主要错误条件包括:

本指南由 AI 助手根据规范要求创建。

成员图

类图

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

G nara__crypto__cryp__SymmetricCipherCtx167 SymmetricCipherCtx + Cancel() + EncryptSingleCallWithOutputIv() + Finish() + FinishEncrypt() + GetMaximumChunkSize() + GetMaximumInputIvSize() + GetMinimumChunkSize() + GetMinimumInputIvSize() + GetOutputIvSize() + GetRequiredOutputBufferSize() + ProcessSingleCall() + ProcessSingleCallWithInputIv() + Seek() + SetKey() + Start() + Update() nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__SymmetricCipherCtx167->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 in a single-call and return an IV generated by the context.

virtual ara::core::Result< std::size_t > EncryptSingleCallWithOutputIv (ReadOnlyMemRegion in, ReadWriteMemRegion out, ReadWriteMemRegion iv Out) noexcept=0;
Finish 函数

Finalize the encryption/decryption without returning an IV.

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

Finalize the encryption and return the IV generated by the context.

virtual ara::core::Result< std::size_t > FinishEncrypt (ReadOnlyMem Region in, ReadWriteMemRegion out, ReadWriteMemRegion ivOut) 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;

Perform en-/decryption in a single-call without setting or returning an IV.

virtual ara::core::Result< std::size_t > ProcessSingleCall (ReadOnly MemRegion in, ReadWriteMemRegion out, CryptoTransform transform Direction) noexcept=0;

Perform en-/decryption in a single-call, providing an IV to be used during en-/decryption.

virtual ara::core::Result< std::size_t > ProcessSingleCallWithInputIv (ReadOnlyMemRegion in, ReadWriteMemRegion out, CryptoTransform transformDirection, ReadOnlyMemRegion iv) noexcept=0;
Seek 函数

Set the position of the next byte within the data stream.

virtual ara::core::Result< void > Seek (std::int64_t offset, bool from Begin) noexcept=0;
SetKey 函数 2

Configure the context to use the key stored in the provided KeySlot at the time the en-/decryption is started.

重载 SetKey 2
virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0; SWS_CRYPT_50043
virtual ara::core::Result< void > SetKey (SymmetricKey::Sptr key) noexcept=0; SWS_CRYPT_50138
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_23625
virtual ara::core::Result< void > Start (CryptoTransform transform Direction) noexcept=0; SWS_CRYPT_50044
Update 函数

Encrypt or decrypt a data buffer.

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

类型别名

Sptr 类型别名

Smart pointer of the interface.

方法文档

函数 Cancel [SWS_CRYPT_50046] 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 · 温度: 不可控 · 提示词: 0bea3f0e1d0d 来源 未决问题(1)
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

类 ara::crypto::cryp::SymmetricCipherCtx 的同步方法 Cancel() 用于提前中止先前使用 Start() 启动且尚未结束的正在进行的流式操作 [SWS_CRYPT_50046]。该接口在 ara/crypto/cryp/symmetric_cipher_ctx.h 中声明为无参数,并在成功执行时返回空的 ara::core::Result<void> [SWS_CRYPT_50046]。

如果事先未通过调用 Start() 开始数据处理,则该操作将失败,并带有特定错误代码 ara::crypto::CryptoErrc::kProcessingNotStarted 和回滚语义 [SWS_CRYPT_50046]。对于调用上下文,规范保证了线程安全性(thread-safe)以及带有 noexcept 声明的异常安全性(exception safe)[SWS_CRYPT_50046]。解释:基于回滚语义,对象在中止后可能会恢复到就绪的初始状态。 问题 Q-b6deb8db5367acc5 (未决)

该功能模式在 AUTOSAR Adaptive 的所有加密流式上下文中均有一致的定义。相同的签名和错误语义适用于上下文类 VerifierPublicCtx([SWS_CRYPT_50023])、MessageAuthnCodeCtx([SWS_CRYPT_50027])、SignerPrivateCtx([SWS_CRYPT_50041])、HashFunctionCtx([SWS_CRYPT_50058])、DecryptorPrivateCtx([SWS_CRYPT_50069])、AuthCipherCtx([SWS_CRYPT_50077])和 EncryptorPublicCtx([SWS_CRYPT_50089])。

此文本由 AI 策划,并基于 AUTOSAR Adaptive R25-11 规范。

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

Header-Datei#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricCipherCtx
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_50046
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50046@rel:R25-11#6c999104
Content hash
6c999104
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50046
Status: valid/unmigrated Version: rel:R25-11#f0ef0c54 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_50046@rel:R25-11#f0ef0c54
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_50049] Upstream: RS_CRYPTO_02302

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

Perform encryption in a single-call and return an IV generated by the context.

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

使用与缓冲区处理

同步方法 EncryptSingleCallWithOutputIv 在单次调用中执行对称加密,并通过缓冲区 ivOut 返回由上下文生成的初始化向量 [SWS_CRYPT_50049]。输入数据通过 in 传递,而 out 接收加密后的数据 [SWS_CRYPT_50049]。成功执行后,结果 ara::core::Result<std::size_t> 会提供所生成输出数据的实际大小,该大小可能小于 out 的总容量 [SWS_CRYPT_50049]。如果所选算法不需要初始化向量,则不会向 ivOut 中写入任何数据 [SWS_CRYPT_50049]。

交互与前置条件

在调用之前,必须通过合适的密钥对上下文进行初始化 [SWS_CRYPT_50049]。为了确保缓冲区 ivOut 具有足够的容量,可以预先通过 GetOutputIvSize() 确定所需的 IV 长度 [SWS_CRYPT_50143]。如果还需要附带 Tag 计算的认证,ara::crypto::cryp::AuthCipherCtx 提供了对应的功能 [SWS_CRYPT_50080]。

错误处理与并发

该接口被规范定义为线程安全以及异常安全(“exception safe”),并在发生错误时应用回滚语义 [SWS_CRYPT_50049]。Interpretation: 这种回滚语义应当能确保在发生错误时上下文的状态保持完好,且缓冲区中不会留下任何作为有效数据的未完成数据。 问题 Q-841087731518d866 (未决)相关的错误包括:

  • UninitializedContext:尚未为上下文分配密钥 [SWS_CRYPT_50049]。
  • ara::crypto::CryptoErrc::kInsufficientCapacity:out 或 ivOut 的容量不足 [SWS_CRYPT_50049]。
  • ara::crypto::CryptoErrc::kUnsupported:不支持单次调用加密,或者算法强制要求指定输入 IV [SWS_CRYPT_50049]。
  • ara::crypto::CryptoErrc::kUsageViolation 或 ara::crypto::CryptoErrc::kIncompatibleObject:密钥类型与转换不匹配,或者密钥用法不允许数据加密 [SWS_CRYPT_50049]。

本使用说明由人工智能基于 AUTOSAR Adaptive 规范生成。

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

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

Parameter (in)

ParameterBeschreibung
inan input data buffer containing the ciphertext or plaintext

Parameter (out)

ParameterBeschreibung
outan output data buffer that the encrypted or decrypted data is written to
ivOutan output data buffer that the initialization vector (IV) generated by the context will be written to. If the algorithm does not use an IV, no data will be written into the buffer.

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
UninitializedContextif the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if single-call encryption is not supported, or if the algorithm requires providing an input IV
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the data or IV output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the provided input data contains invalid data
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowData Encryption for encryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation or the transformation direction (encrypt)

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50049
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50049@rel:R25-11#6089d148
Content hash
6089d148
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50049
Status: valid/unmigrated Version: rel:R25-11#f2ba22b4 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_50049@rel:R25-11#f2ba22b4
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_50045] Upstream: RS_CRYPTO_02302

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

Finalize the encryption/decryption without returning an IV.

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

使用

同步方法 Finish 结束 ara::crypto::cryp::SymmetricCipherCtx 内的对称加密或解密,而不返回初始化向量 ([SWS_CRYPT_50045])。它处理来自输入缓冲区 in (ReadOnlyMemRegion) 的最后一个数据段,并将生成的数据写入输出缓冲区 out (ReadWriteMemRegion) ([SWS_CRYPT_50045])。为此所需的缓冲区大小可预先通过 GetRequiredOutputBufferSize() 查询 ([SWS_CRYPT_50045])。类型为 ara::core::Result<std::size_t> 的返回值在成功时提供写入的精确字节数,该字节数可以小于 out 的总容量 ([SWS_CRYPT_50045])。

错误处理

发生错误时,该方法返回带有特定错误代码的 ara::core::Result ([SWS_CRYPT_50045]):

  • ProcessingNotStarted:数据处理此前未通过 Start() 启动 ([SWS_CRYPT_50045])。
  • ara::crypto::CryptoErrc::kInsufficientCapacity:输出缓冲区 out 过小 ([SWS_CRYPT_50045])。
  • ara::crypto::CryptoErrc::kInvalidInputSize:无法处理输入数据的大小 ([SWS_CRYPT_50045])。
  • ara::crypto::CryptoErrc::kInvalidArgument:传入的输入数据无效 ([SWS_CRYPT_50045])。
  • ara::crypto::CryptoErrc::kUnsupported:当前上下文不支持流式处理 ([SWS_CRYPT_50045])。

如果发生 CryptoErrc 错误之一,回滚语义生效 ([SWS_CRYPT_50045])。

并发性与交互

该操作被定义为 thread-safe 和 exception safe ([SWS_CRYPT_50045])。在调用之前,变换必须已通过 Start() 启动 ([SWS_CRYPT_50045])。针对单次调用 Finish() 的最大允许输入大小可通过 GetMaximumChunkSize() 确定 ([SWS_CRYPT_50050])。在完成后,变换运行应已结束,对于后续操作,推测可能需要再次调用 Start()。 问题 Q-c4ffc8028e8f522b (未决)

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

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

Parameter (in)

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

Parameter (out)

ParameterBeschreibung
outan output data buffer that contains encrypted or decrypted data. The required size of this buffer can be queried using GetRequired OutputBufferSize()

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 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 cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the provided input data contains invalid data
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_50045
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50045@rel:R25-11#8861de5c
Content hash
8861de5c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50045
Status: valid/unmigrated Version: rel:R25-11#b9951f15 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_50045@rel:R25-11#b9951f15
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_23618] Upstream: RS_CRYPTO_02302

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

Finalize the encryption and return the IV generated by the context.

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

方法 FinishEncrypt 结束加密操作并返回由上下文生成的初始化向量(IV)[SWS_CRYPT_23618]。它处理最终输入数据缓冲区 in,并将结果数据写入输出缓冲区 out,以及将 IV 写入 ivOut。作为返回值,它提供一个包含已写入输出数据实际大小的 ara::core::Result<std::size_t>,该大小可能小于 out 的容量 [SWS_CRYPT_23618]。

为了无误执行,必须预先协调缓冲区维度与上下文状态:

若数据处理事先未由 Start() 引发,该方法将报告 CryptoErrc::kProcessingNotStarted [SWS_CRYPT_23618]。若输入缓冲区包含无效数据,则返回 CryptoErrc::kInvalidArgument [SWS_CRYPT_23618]。若不支持流处理、上下文未使用 IV 或已在 Start() 中传递了 IV,则会发生错误 CryptoErrc::kUnsupported [SWS_CRYPT_23618]。所有错误均具有回滚语义 [SWS_CRYPT_23618]。根据规范,该调用是线程安全且异常安全的(noexcept)[SWS_CRYPT_23618]。

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

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

Header-Datei#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricCipherCtx
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 contains encrypted or decrypted data
ivOutan output data buffer that contains the IV

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 cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the provided input data contains invalid data
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_23618
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_23618@rel:R25-11#86d818ac
Content hash
86d818ac
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_23618
Status: valid/unmigrated Version: rel:R25-11#dcc35b13 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_23618@rel:R25-11#dcc35b13
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#c50d30f82026-09-30
  • R19-11rel:R19-11#c41ea37b2026-10-14
  • R20-11rel:R20-11#06f18fb12026-10-14
  • R21-11rel:R21-11#3725bc5a2026-10-14
  • R22-11rel:R22-11#724878ec2026-10-14
  • R23-11rel:R23-11#8e98bdf02026-10-14
  • R24-11rel:R24-11#1d9181d92026-10-14
  • R25-11rel:R25-11#dcc35b132026-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_50050] 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/symmetric_cipher_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricCipherCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

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

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_50050
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50050@rel:R25-11#a63b1ff7
Content hash
a63b1ff7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50050
Status: valid/unmigrated Version: rel:R25-11#439b3c69 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_50050@rel:R25-11#439b3c69
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_50142] 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/symmetric_cipher_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricCipherCtx
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
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_50142
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50142@rel:R25-11#6d491f76
Content hash
6d491f76
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50142
Status: valid/unmigrated Version: rel:R25-11#2fd32b15 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_50142@rel:R25-11#2fd32b15
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_50144] 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/symmetric_cipher_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricCipherCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

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

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_50144
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50144@rel:R25-11#8c4d23ad
Content hash
8c4d23ad
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50144
Status: valid/unmigrated Version: rel:R25-11#8dfc91ab 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_50144@rel:R25-11#8dfc91ab
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_50141] 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/symmetric_cipher_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricCipherCtx
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
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_50141
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50141@rel:R25-11#6220eb6b
Content hash
6220eb6b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50141
Status: valid/unmigrated Version: rel:R25-11#a69e1387 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_50141@rel:R25-11#a69e1387
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_50143] 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/symmetric_cipher_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricCipherCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Rückgabewert

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

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_50143
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50143@rel:R25-11#8af15142
Content hash
8af15142
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50143
Status: valid/unmigrated Version: rel:R25-11#11f7dfe6 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_50143@rel:R25-11#11f7dfe6
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_50140] 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/symmetric_cipher_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricCipherCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
inputSizesize of input data
isFinalif true, calculate maximum required output buffer size for Finish(), FinishEncrypt(), ProcessSingleCallWithInputIv(), and Encrypt SingleCallWithOutputIv(), 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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50140
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50140@rel:R25-11#a5d353a2
Content hash
a5d353a2
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50140
Status: valid/unmigrated Version: rel:R25-11#3cd4a32f 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_50140@rel:R25-11#3cd4a32f
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_50047] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > ProcessSingleCall (ReadOnly MemRegion in, ReadWriteMemRegion out, CryptoTransform transform Direction) noexcept=0;

Perform en-/decryption in a single-call without setting or returning an IV.

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

方法 ProcessSingleCall 在单个同步调用中执行不带初始化向量 (IV) 的加密或解密 ([SWS_CRYPT_50047])。数据缓冲区 in (ReadOnlyMemRegion) 和变换方向 transformDirection (CryptoTransform) 用作输入参数,而结果则写入缓冲区 out (ReadWriteMemRegion)。成功执行时,该函数返回一个 ara::core::Result<std::size_t>,其中包含写入的字节数;该值可以小于输出缓冲区的总容量。

关于并发性与安全性,该方法被指定为 thread-safe 和 exception safe ([SWS_CRYPT_50047])。in 可处理的输入大小受上下文所定义的限制约束,这些限制可通过 [SWS_CRYPT_50144] (GetMinimumChunkSize) 和 [SWS_CRYPT_50050] (GetMaximumChunkSize) 查询。

所有错误情况均遵循回滚语义 ([SWS_CRYPT_50047]):

  • ara::crypto::CryptoErrc::kUninitializedContext:上下文事先未通过分配密钥进行初始化。
  • ara::crypto::CryptoErrc::kUnsupported:不支持单次调用(Single-Call)处理,或者变换需要设置或读取 IV。
  • ara::crypto::CryptoErrc::kInsufficientCapacity:输出缓冲区 out 容量不足。
  • ara::crypto::CryptoErrc::kInvalidInputSize:上下文无法处理输入大小。
  • ara::crypto::CryptoErrc::kUsageViolation:密钥用途未涵盖所请求的操作(kAllowDataEncryption 或 kAllowDataDecryption)。
  • ara::crypto::CryptoErrc::kIncompatibleObject、kEmptyKeySlot、kInvalidArgument 或 kBusyResource:密钥不兼容、密钥槽为空、输入数据无效或所需资源被占用。

在与其他接口的协作中,该调用需要一个完整配置的上下文;对于带有额外 Tag 处理的认证加密,在 AuthCipherCtx 中提供了替代接口 [SWS_CRYPT_50078]。

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

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

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

Parameter (in)

ParameterBeschreibung
inan input data buffer containing the ciphertext or plaintext
transformDirectionthe transformation direction, i.e., encryption or decryption

Parameter (out)

ParameterBeschreibung
outan output data buffer that the encrypted or decrypted data 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::kUninitializedContextrollback_semantics if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if single-call en-/decryption is not supported, or if the context requires setting or returning an IV in the passed transformDirection
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the provided input data contains invalid data
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowData Encryption for encryption, or kAllowDataDecryption for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation or the transformation direction

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50047
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50047@rel:R25-11#74251b7f
Content hash
74251b7f
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50047
Status: valid/unmigrated Version: rel:R25-11#c5198454 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_50047@rel:R25-11#c5198454
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_50048] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< std::size_t > ProcessSingleCallWithInputIv (ReadOnlyMemRegion in, ReadWriteMemRegion out, CryptoTransform transformDirection, ReadOnlyMemRegion iv) noexcept=0;

Perform en-/decryption in a single-call, providing an IV to be used during en-/decryption.

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

ara::crypto::cryp::SymmetricCipherCtx 上的方法 ProcessSingleCallWithInputIv 在单个同步调用(Single-Call)中执行数据的对称加密或解密 [SWS_CRYPT_50048]。在此过程中,用于变换的初始化向量通过输入缓冲区 iv 显式传递。

使用与交互

通过 transformDirection 控制是对来自 in 的数据进行加密还是解密。结果将写入缓冲区 out。返回的 ara::core::Result<std::size_t> 包含写入的实际字节数,该数量可能小于 out 的总容量 [SWS_CRYPT_50048]。

为了确定缓冲区的大小,提供了辅助函数:

  • out 所需的缓冲区大小可预先通过带有参数 isFinal = true 的 GetRequiredOutputBufferSize 计算得出 [SWS_CRYPT_50140]。
  • 对于所选的变换方向,iv 的允许长度可以通过 GetMinimumInputIvSize [SWS_CRYPT_50141] 以及 GetMaximumInputIvSize [SWS_CRYPT_50142] 确定。
  • 如果还需要生成或验证认证 Tag,则应改用 ara::crypto::cryp::AuthCipherCtx::ProcessSingleCallWithInputIv [SWS_CRYPT_50079]。

错误处理与并发

该操作被定义为 thread-safe 和 exception safe [SWS_CRYPT_50048]。所有错误均具有回滚语义:

  • CryptoErrc::kUninitializedContext 或 CryptoErrc::kEmptyKeySlot:未向上下文分配密钥,或 KeySlot 为空 [SWS_CRYPT_50048]。
  • CryptoErrc::kUsageViolation:密钥不允许所选的方向(缺少 kAllowDataEncryption 或 kAllowDataDecryption)[SWS_CRYPT_50048]。
  • CryptoErrc::kIncompatibleObject:密钥类型与变换不兼容 [SWS_CRYPT_50048]。
  • CryptoErrc::kInsufficientCapacity:输出缓冲区 out 过小 [SWS_CRYPT_50048]。
  • CryptoErrc::kInvalidInputSize 或 CryptoErrc::kInvalidArgument:in 的缓冲区大小或内容无效 [SWS_CRYPT_50048]。
  • CryptoErrc::kUnsupported:不支持单次调用(Single-Call)处理或输入 IV [SWS_CRYPT_50048]。
  • CryptoErrc::kBusyResource:所需资源被占用 [SWS_CRYPT_50048]。

本文字由人工智能生成,用于支持该规范元素的使用。

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

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

Parameter (in)

ParameterBeschreibung
inan input data buffer containing the ciphertext or plaintext
transformDirectionthe transformation direction, i.e., encryption or decryption
ivan input data buffer containing the initialization vector (IV) to be used by the context

Parameter (out)

ParameterBeschreibung
outan output data buffer that the encrypted or decrypted data 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::kUninitializedContextrollback_semantics if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if single-call en-/decryption is not supported, or if single-call processing with an input IV is not supported
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the data output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the provided input data contains invalid data
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowData Encryption for encryption, or kAllowDataDecryption for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation or the transformation direction

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50048
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50048@rel:R25-11#2ee56f90
Content hash
2ee56f90
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50048
Status: valid/unmigrated Version: rel:R25-11#06bfc8c8 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_50048@rel:R25-11#06bfc8c8
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

函数 Seek [SWS_CRYPT_23613] Upstream: RS_CRYPTO_02304

virtual ara::core::Result< void > Seek (std::int64_t offset, bool from Begin) noexcept=0;

Set the position of the next byte within the data stream.

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

接口 ara::crypto::cryp::SymmetricCipherCtx 的方法 Seek 设置数据流中下一个待处理字节的位置 [SWS_CRYPT_23613]。鉴于缺少诸如 Future 等异步返回类型,该调用可能同步进行。 问题 Q-fccf732722263f60 (未决)

使用

定位通过两个参数控制 [SWS_CRYPT_23613]:

  • offset:数据流中的字节偏移量,相对于流起点或当前位置 [SWS_CRYPT_23613]。
  • fromBegin:定位的参考点;true 指定从流起始处的偏移,false 相对于当前位置 [SWS_CRYPT_23613]。

该函数声明为 noexcept 并返回一个 ara::core::Result<void>,用于指示成功完成或包含所发生的错误对象 [SWS_CRYPT_23613]。

并发性与限制

根据规范,Seek 被归类为异常安全(exception safe)和线程安全(thread-safe)[SWS_CRYPT_23613]。执行的前提条件是,之前已通过调用 Start() 启动了数据处理 [SWS_CRYPT_23613]。

错误处理

所有错误情况均受已定义的回滚语义(rollback_semantics)约束,以使内部状态在发生错误时保持一致 [SWS_CRYPT_23613]:

  • ara::crypto::CryptoErrc::kUnsupported:当前加密上下文不支持 Seek 操作 [SWS_CRYPT_23613]。
  • ara::crypto::CryptoErrc::kProcessingNotStarted:数据处理事先未通过 Start() 启动 [SWS_CRYPT_23613]。
  • ara::crypto::CryptoErrc::kOutOfBounds:生成的偏移量对于数据流过小或过大 [SWS_CRYPT_23613]。
  • ara::crypto::CryptoErrc::kInvalidArgument:尽管上下文要求块对齐,但生成的偏移量未与块边界对齐 [SWS_CRYPT_23613]。

本文本由人工智能生成。

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

Parameter (in)

ParameterBeschreibung
offsetthe offset value in bytes, relative to begin or current position in the data stream
fromBeginthe starting point for positioning within the stream: from begin (if true) or from current position (if false)

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the seek operation is not supported by this context
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if the data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kOutOfBoundsrollback_semantics if the resulting offset value is too large or too small
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the resulting offset is not block aligned but the context requires block alignment

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

Record
AUTOSAR/AP/record/SWS_CRYPT_23613
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_23613@rel:R25-11#4cd618c6
Content hash
4cd618c6
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_23613
Status: valid/unmigrated Version: rel:R25-11#383a800f 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_23613@rel:R25-11#383a800f
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#6a4153822026-09-30
  • R19-11rel:R19-11#9c63158a2026-10-14
  • R20-11rel:R20-11#36a48d2b2026-10-14
  • R21-11rel:R21-11#f3b5692c2026-10-14
  • R22-11rel:R22-11#a11f983a2026-10-14
  • R23-11rel:R23-11#10ff1b922026-10-14
  • R24-11rel:R24-11#23dbf8e42026-10-14
  • R25-11rel:R25-11#383a800f2026-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_50043] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

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

Configure the context to use the key stored in the provided KeySlot at the time the en-/decryption is started.

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

纯虚方法 SetKey 对 ara::crypto::cryp::SymmetricCipherCtx 的实例进行配置,使其在未来的加密操作中使用来自传入 KeySlot 的密钥 [SWS_CRYPT_50043]。

用法与调用上下文

该调用为同步调用,并接收包含 SymmetricKey 的 KeySlot::Sptr 作为参数 keySlot [SWS_CRYPT_50043]。返回值是一个 ara::core::Result<void>,用于指示成功或在失败时传递错误代码 [SWS_CRYPT_50043]。该配置使得槽中存储的密钥直到实际加密或解密启动时才会被调用 [SWS_CRYPT_50043]。

错误处理

在发生错误时不会抛出异常(该方法被指定为 noexcept 且 exception safe),而是返回具有回滚语义的错误代码 [SWS_CRYPT_50043]:

  • ara::crypto::CryptoErrc::kIncompatibleObject:传入的 KeySlot 与加密上下文不兼容 [SWS_CRYPT_50043]。
  • ara::crypto::CryptoErrc::kUnsupported:上下文实现仅支持设置直接密钥(例如 SymmetricKey),不支持通过 KeySlot 进行分配 [SWS_CRYPT_50043]。

并发性与交互

该方法被标明为 thread-safe [SWS_CRYPT_50043]。解释:密钥材料的实际读取大概仅在启动加密或解密时发生,因此该槽在变换开始前必须保持一致。 问题 Q-799125800ab0f93c (未决)通过 KeySlot::Sptr 而不是直接密钥对象配置上下文的设计,符合相关加密上下文的统一模式,包括 KeyDerivationFunctionCtx [SWS_CRYPT_50010]、MessageAuthnCodeCtx [SWS_CRYPT_50026]、SymmetricKeyWrapperCtx [SWS_CRYPT_50034] 以及 VerifierPublicCtx [SWS_CRYPT_50018]。

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

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

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

Parameter (in)

ParameterBeschreibung
keySlota keyslot containing a SymmetricKey.

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the provided keyslot is incompatible with this context
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_50043
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50043@rel:R25-11#80e48159
Content hash
80e48159
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50043
Status: valid/unmigrated Version: rel:R25-11#e7e7c9ab 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_50043@rel:R25-11#e7e7c9ab
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_50138] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

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

Configure the context to use the provided symmetric key.

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

使用

方法 SetKey 用于配置 ara::crypto::cryp::SymmetricCipherCtx 的实例以使用传入的对称密钥 [SWS_CRYPT_50138]。作为输入参数,该函数接收类型为 SymmetricKey::Sptr 的智能指针 key 作为要使用的密钥。调用同步进行并返回一个 ara::core::Result<void>,该返回值在分配成功时为空,或在错误情况下提供错误代码 [SWS_CRYPT_50138]。声明通过头文件 ara/crypto/cryp/symmetric_cipher_ctx.h 包含。

错误处理

错误处理保证了回滚语义,因此在分配失败时,上下文保持在其先前的状态 [SWS_CRYPT_50138]。定义了两个特定错误:

  • ara::crypto::CryptoErrc::kUnsupported:当上下文仅支持通过 KeySlot 分配密钥时发生 [SWS_CRYPT_50138]。
  • ara::crypto::CryptoErrc::kIncompatibleObject:当传入的密钥对象与上下文不兼容时返回 [SWS_CRYPT_50138]。

并发性与交互

虚函数定义为 noexcept,被视为 Exception-safe,并且按照规范要求执行为 thread-safe [SWS_CRYPT_50138]。用于分配 SymmetricKey::Sptr 的类似接口也存在于相关的加密上下文中,例如 AuthCipherCtx [SWS_CRYPT_23911] 以及 SymmetricKeyWrapperCtx [SWS_CRYPT_24018]。与密钥容器的交互还通过备选接受 KeySlot::Sptr 的上下文类得到说明 [SWS_CRYPT_50034]。

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

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

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

Parameter (in)

ParameterBeschreibung
keythe SymmetricKey to be used.

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 key object is incompatible with this context

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50138
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50138@rel:R25-11#853bec03
Content hash
853bec03
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50138
Status: valid/unmigrated Version: rel:R25-11#aa2f4130 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_50138@rel:R25-11#aa2f4130
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_23625] 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 · 温度: 不可控 · 提示词: 33beff56357b 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

方法 Start 为新的同步加密或解密操作初始化上下文 ara::crypto::cryp::SymmetricCipherCtx,并设置关联的初始化向量(IV)或 Nonce 值 [SWS_CRYPT_23625]。通过参数 transformDirection 确定转换方向,而 iv 将初始化向量作为 ReadOnlyMemRegion 提供 [SWS_CRYPT_23625]。缓冲区的允许大小可事先通过方法 GetMinimumInputIvSize() 和 GetMaximumInputIvSize() 查询 [SWS_CRYPT_23625]。该调用返回一个 ara::core::Result<void>,声明为 noexcept,且被视为异常安全(exception safe)[SWS_CRYPT_23625]。

错误处理

在发生错误时,将返回具有回滚语义的错误代码 [SWS_CRYPT_23625]:

  • ara::crypto::CryptoErrc::kUninitializedContext:上下文此前未通过分配密钥进行初始化 [SWS_CRYPT_23625]。
  • ara::crypto::CryptoErrc::kInvalidInputSize:不支持传入的 IV 大小 [SWS_CRYPT_23625]。
  • ara::crypto::CryptoErrc::kUnsupported:上下文不支持在指定转换方向上设置 IV 或不支持流处理 [SWS_CRYPT_23625]。
  • ara::crypto::CryptoErrc::kEmptyKeySlot:配置的 KeySlot 当前为空 [SWS_CRYPT_23625]。
  • ara::crypto::CryptoErrc::kUsageViolation:允许的密钥用途不包含用于加密的 kAllowDataEncryption 或用于解密的 kAllowDataDecryption [SWS_CRYPT_23625]。
  • ara::crypto::CryptoErrc::kIncompatibleObject:密钥类型与转换或转换方向不兼容 [SWS_CRYPT_23625]。
  • ara::crypto::CryptoErrc::kBusyResource:所需资源被占用 [SWS_CRYPT_23625]。

并发性与交互

该函数被指定为线程安全(thread-safe)[SWS_CRYPT_23625]。在流处理流程中,Start 作为初始化步骤,后续可执行例如通过 Seek [SWS_CRYPT_23613] 进行定位操作或通过 FinishEncrypt [SWS_CRYPT_23618] 进行最终化。

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

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

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

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
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided IV is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context does not support setting an IV in the given transform Direction or if stream processing is not supported by the context
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowData Encryption for encryption, or kAllowDataDecryption for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation or the transformation direction

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

Record
AUTOSAR/AP/record/SWS_CRYPT_23625
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_23625@rel:R25-11#7d5cd11a
Content hash
7d5cd11a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_23625
Status: valid/unmigrated Version: rel:R25-11#608e87fd 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_23625@rel:R25-11#608e87fd
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#a536a6ca2026-09-30
  • R20-11rel:R20-11#6996665a2026-10-14
  • R21-11rel:R21-11#c2b5cf1e2026-10-14
  • R22-11rel:R22-11#25b4dab42026-10-14
  • R23-11rel:R23-11#e01d837d2026-10-14
  • R24-11rel:R24-11#26e85c6c2026-10-14
  • R25-11rel:R25-11#608e87fd2026-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_50044] 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 · 温度: 不可控 · 提示词: 09affb4844e4 来源
译自德文指南gemini-3.8-flash-low · 2026-10-13 · 德文原文

使用

方法 Start 同步初始化 ara::crypto::cryp::SymmetricCipherCtx 的实例以进行即将执行的加密或解密([SWS_CRYPT_50044])。当通过参数 transformDirection 指定的转换方向不需要初始化向量(IV)或上下文自身生成 IV 时([SWS_CRYPT_50044]),使用该方法。反之,如果上下文在所选方向上需要显式 IV,则必须调用带有 IV 参数的重载([SWS_CRYPT_23625])。

错误处理与并发

该操作被指定为线程安全且异常安全([SWS_CRYPT_50044])。发生错误时,函数返回具有回滚语义的 ara::core::Result<void>([SWS_CRYPT_50044])。相关的错误原因包括:

  • ara::crypto::CryptoErrc::kUninitializedContext:事先未向上下文分配密钥([SWS_CRYPT_50044])。
  • ara::crypto::CryptoErrc::kUnsupported:不支持流式处理,或者该操作在此方向上强制要求设置 IV([SWS_CRYPT_50044])。
  • ara::crypto::CryptoErrc::kUsageViolation:密钥不具备所需的权限 kAllowDataEncryption 或 kAllowDataDecryption([SWS_CRYPT_50044])。
  • ara::crypto::CryptoErrc::kIncompatibleObject 或 ara::crypto::CryptoErrc::kEmptyKeySlot:密钥类型与转换不匹配,或者配置的密钥槽为空([SWS_CRYPT_50044])。
  • ara::crypto::CryptoErrc::kBusyResource:所需资源当前被占用([SWS_CRYPT_50044])。

相互作用

初始化成功后,可根据需要在数据流中通过 Seek 进行定位([SWS_CRYPT_23613])。如果 IV 由上下文自身确定,则在加密结束时通过 FinishEncrypt 传递给调用方([SWS_CRYPT_23618])。

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

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

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

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
ara::crypto::CryptoErrc::kUninitializedContextrollback_semantics if the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context requires setting an IV in the given transformDirection or if stream processing is not supported by the context
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy
ara::crypto::CryptoErrc::kEmptyKeySlotrollback_semantics if a KeySlot was configured that is currently is empty
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowData Encryption for encryption, or kAllowDataDecryption for decryption, respectively
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation or the transformation direction

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50044
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50044@rel:R25-11#cdcf3c8b
Content hash
cdcf3c8b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50044
Status: valid/unmigrated Version: rel:R25-11#842f896d 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_50044@rel:R25-11#842f896d
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_50139] Upstream: RS_CRYPTO_02302

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

Encrypt or decrypt a data buffer.

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

同步方法 Update() 在 ara::crypto::cryp::SymmetricCipherCtx 中用于逐步加密或解密部分数据流 [SWS_CRYPT_50139]。它处理包含明文或密文的输入缓冲区 in(类型 ReadOnlyMemRegion),并将变换后的数据写入输出缓冲区 out(类型 ReadWriteMemRegion)[SWS_CRYPT_50139]。返回值 ara::core::Result<std::size_t> 在成功情况下提供实际写入 out 的确切字节数,该字节数可能小于目标缓冲区的总容量 [SWS_CRYPT_50139]。

调用适用已确定的前提条件和缓冲区规则:

  • 执行顺序:数据处理之前必须已使用方法 Start() 启动;否则调用失败并报告 ara::crypto::CryptoErrc::kProcessingNotStarted [SWS_CRYPT_50139]。
  • 缓冲区尺寸设定:每次单次调用允许的最大输入大小可通过 GetMaximumChunkSize() 确定 [SWS_CRYPT_50050];方法对于无效的缓冲区大小以 ara::crypto::CryptoErrc::kInvalidInputSize 确认 [SWS_CRYPT_50139]。所需的输出缓冲区可通过 GetRequiredOutputBufferSize() 查询 [SWS_CRYPT_50139];缓冲区过小会导致 ara::crypto::CryptoErrc::kInsufficientCapacity [SWS_CRYPT_50139]。
  • 流式支持:若具体上下文不支持连续流处理,则调用失败并报告 ara::crypto::CryptoErrc::kUnsupported [SWS_CRYPT_50139]。

该接口被指定为 thread-safe 以及 exception safe,并在发生任何错误时保证回滚语义 [SWS_CRYPT_50139]。在处理周期中,它与 GetMaximumChunkSize() 以及 Finish() 或 FinishEncrypt() 等收尾操作协同工作 [SWS_CRYPT_50050]。

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

Header-Datei#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricCipherCtx
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 will be written into. The required size of this buffer can be queried using GetRequiredOutputBufferSize()

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_50139
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50139@rel:R25-11#6dcfd7e1
Content hash
6dcfd7e1
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50139
Status: valid/unmigrated Version: rel:R25-11#50161066 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_50139@rel:R25-11#50161066
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_50137] Upstream: RS_CRYPTO_02201

using Sptr = std::shared_ptr<SymmetricCipherCtx>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/symmetric_cipher_ctx.h"
Scopeclass ara::crypto::cryp::SymmetricCipherCtx
SymbolSptr

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

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