DEENESPTFRRUARHIKOZHNL

class 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

User GuideAI-GENERATED

Serves as an interface for symmetric encryption and decryption operations in data streams or single calls.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 0261b663ca0d Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Serves as an interface for symmetric encryption and decryption operations in data streams or single calls.

The class ara::crypto::cryp::SymmetricCipherCtx serves as a thread-safe interface for symmetric encryption and decryption operations in AUTOSAR Adaptive [SWS_CRYPT_50044]. After configuring a key via SetKey(), data can be processed either in a single call or stepwise in a streaming cycle of Start(), Update(), and Finish() [SWS_CRYPT_50138], [SWS_CRYPT_50139]. All methods are specified as noexcept and signal errors such as missing initialization or undersized buffers via ara::core::Result [SWS_CRYPT_50140].

Context

The interface ara::crypto::cryp::SymmetricCipherCtx encapsulates symmetric cryptographic transformations, which include both encryption and decryption operations. Within the crypto architecture, the class acts as an execution context for symmetric algorithms and cooperates with key objects and memory buffers. To configure the cryptographic key, the class interacts either directly with volatile keys via SymmetricKey [SWS_CRYPT_50138] or with keys managed persistently or in isolation via KeySlot [SWS_CRYPT_50043]. Plaintexts and ciphertexts to be processed as well as initialization vectors (IV) are passed and received via memory areas of type ReadOnlyMemRegion and ReadWriteMemRegion [SWS_CRYPT_50048], [SWS_CRYPT_50049].

Lifecycle

Lifecycle and ownership of the interface are primarily controlled via the typed smart pointer alias Sptr (std::shared_ptr<SymmetricCipherCtx>) [SWS_CRYPT_50137]. In practice, the provision of a concrete instance is likely to take place via a higher-level crypto factory method (interpretation), as the interface definition itself does not feature creation functions. Question Q-5b5f5ffdf964c91f (open)

After instantiation, the context passes through several operational phases:

  • Uninitialized: Immediately after instantiation, no key is assigned to the context. Any processing call in this phase leads to error CryptoErrc::kUninitializedContext [SWS_CRYPT_50044], [SWS_CRYPT_50047].
  • Initialized / key bound: By calling SetKey() with a SymmetricKey [SWS_CRYPT_50138] or KeySlot [SWS_CRYPT_50043], the context becomes ready for use. From this state, either stateless single-call operations can be executed or a stateful streaming process can be started.
  • Streaming processing: A call to Start() initiates a stepwise transformation [SWS_CRYPT_50044], [SWS_CRYPT_23625]. In this phase, data can be transformed via Update() [SWS_CRYPT_50139] and the position modified via Seek() [SWS_CRYPT_23613]. The streaming state is terminated regularly by Finish() [SWS_CRYPT_50045] or FinishEncrypt() [SWS_CRYPT_23618], or aborted prematurely via Cancel() [SWS_CRYPT_50046]. Afterwards, the context returns to the initialized base state.

All methods of SymmetricCipherCtx are declared as noexcept, ensure exception safety (\"exception safe\"), and are specified as thread-safe for concurrent access [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()

State diagram: Lifecycle and state transitions of the symmetric cipher context. Sources: [SWS_CRYPT_50138], [SWS_CRYPT_50044], [SWS_CRYPT_50139], [SWS_CRYPT_50045], [SWS_CRYPT_50046]

Usage Path

Determining the required buffer and chunk sizes is recommended before the actual data transformation. Via GetMinimumChunkSize() [SWS_CRYPT_50144] and GetMaximumChunkSize() [SWS_CRYPT_50050], the permitted limits for input blocks can be determined. If initialization vectors are required, their length limits can be queried using GetMinimumInputIvSize() [SWS_CRYPT_50141], GetMaximumInputIvSize() [SWS_CRYPT_50142], or GetOutputIvSize() [SWS_CRYPT_50143]. The maximum required destination buffer size for an operation is calculated using GetRequiredOutputBufferSize() [SWS_CRYPT_50140].

For stepwise stream encryption or decryption, the following standard procedure applies:

  1. Configure key: Binding the cryptographic key to the context via SetKey() [SWS_CRYPT_50138].
  2. Start transformation: Calling Start() specifying the transformation direction (encryption or decryption) and optional IV [SWS_CRYPT_23625] or without IV [SWS_CRYPT_50044].
  3. Transform data blocks: Repeated calling of Update() for the stepwise passing of input data and retrieval of output data [SWS_CRYPT_50139]. If needed, navigation within the data stream is possible via Seek() [SWS_CRYPT_23613].
  4. Completion: Finalization via Finish() [SWS_CRYPT_50045] or via FinishEncrypt() if the IV generated by the context is to be returned [SWS_CRYPT_23618].

As an alternative to this streaming pattern, the interface supports synchronous single calls. If the entire payload is available, the operation can be executed directly via ProcessSingleCall() [SWS_CRYPT_50047], ProcessSingleCallWithInputIv() [SWS_CRYPT_50048], or for context-owned IV generation via EncryptSingleCallWithOutputIv() [SWS_CRYPT_50049].

Symmetric stream encryptionApplicationSymmetricCipherCtxSetKey(key)Result<void>Start(kEncrypt, iv)Result<void>loopAs long as blocks are presentUpdate(in, out)Result<size_t>FinishEncrypt(in, out, ivOut)Result<size_t>

Sequence diagram: Typical call sequence of a streaming encryption. Sources: [SWS_CRYPT_50138], [SWS_CRYPT_23625], [SWS_CRYPT_50139], [SWS_CRYPT_23618]

Error Scenarios

Methods of the class signal errors via ara::core::Result with codes of error domain ara::crypto::CryptoErrc. Essential error conditions include:

  • CryptoErrc::kUninitializedContext: Occurs when processing calls such as Start() [SWS_CRYPT_50044], single-call routines [SWS_CRYPT_50047], or GetRequiredOutputBufferSize() [SWS_CRYPT_50140] are called before a key has been configured via SetKey().
  • CryptoErrc::kProcessingNotStarted: Is triggered when streaming functions such as Update() [SWS_CRYPT_50139], Finish() [SWS_CRYPT_50045], FinishEncrypt() [SWS_CRYPT_23618], Seek() [SWS_CRYPT_23613], or Cancel() [SWS_CRYPT_50046] are executed without a prior successful call to Start().
  • CryptoErrc::kInsufficientCapacity: The provided destination buffer for data or IVs is smaller than the minimum required capacity [SWS_CRYPT_50139], [SWS_CRYPT_50049].
  • CryptoErrc::kUsageViolation and CryptoErrc::kIncompatibleObject: The passed key type is inappropriate for the transformation, or the usage rules defined in the key prohibit the operation (e.g., absence of kAllowDataEncryption or kAllowDataDecryption) [SWS_CRYPT_50044], [SWS_CRYPT_50047].
  • CryptoErrc::kEmptyKeySlot and CryptoErrc::kBusyResource: Indicates that a configured KeySlot does not contain a key at runtime or a resource required for the crypto operation is blocked [SWS_CRYPT_50048], [SWS_CRYPT_50049].
  • CryptoErrc::kUnsupported: Is returned when an operating mode (such as stream processing, single-call, or Seek()) is not supported by the selected context or algorithm [SWS_CRYPT_23613], [SWS_CRYPT_50047].

This guide was prepared by an AI assistant based on the specification requirements.

Member map

Class diagram

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

Detail view

Select an entry in the outline.

Methods

Cancel function

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 function

Finalize the encryption/decryption without returning an IV.

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

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 function

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 function 2

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

Overloads 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 function 2

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

Overloads 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 function

Encrypt or decrypt a data buffer.

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

Type aliases

Sptr type alias

Smart pointer of the interface.

Method documentation

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 0bea3f0e1d0d Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The synchronous method Cancel() of class ara::crypto::cryp::SymmetricCipherCtx serves to prematurely abort an ongoing streaming operation that was previously initiated with Start() and has not yet finished [SWS_CRYPT_50046]. The interface is declared without parameters in ara/crypto/cryp/symmetric_cipher_ctx.h and returns an empty ara::core::Result<void> upon successful execution [SWS_CRYPT_50046].

If data processing was not started beforehand by calling Start(), the operation fails with the specific error code ara::crypto::CryptoErrc::kProcessingNotStarted and rollback semantics [SWS_CRYPT_50046]. For the call context, the specification guarantees thread safety (thread-safe) as well as exception safety (exception safe) with a noexcept declaration [SWS_CRYPT_50046]. Interpretation: Due to the rollback semantics, the object will likely return to a ready initial state after an abort. Question Q-b6deb8db5367acc5 (open)

This functional pattern is consistently defined across all cryptographic streaming contexts in AUTOSAR Adaptive. Identical signatures and error semantics apply to the context classes VerifierPublicCtx ([SWS_CRYPT_50023]), MessageAuthnCodeCtx ([SWS_CRYPT_50027]), SignerPrivateCtx ([SWS_CRYPT_50041]), HashFunctionCtx ([SWS_CRYPT_50058]), DecryptorPrivateCtx ([SWS_CRYPT_50069]), AuthCipherCtx ([SWS_CRYPT_50077]), and EncryptorPublicCtx ([SWS_CRYPT_50089]).

This text was curated by an AI and is based on the AUTOSAR Adaptive R25-11 specification.

Implementer's Guide to follow (complexity 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#f0ef0c54
Content hash
f0ef0c54
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 9c4059afbb11 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Buffer Handling

The synchronous method EncryptSingleCallWithOutputIv performs symmetric encryption in a single call and returns the initialization vector generated by the context via the buffer ivOut [SWS_CRYPT_50049]. The input data are passed via in, while out accommodates the encrypted data [SWS_CRYPT_50049]. Upon successful execution, the result ara::core::Result<std::size_t> provides the actual size of the generated output data, which may be smaller than the total capacity of out [SWS_CRYPT_50049]. If the selected algorithm does not require an initialization vector, no data are written to ivOut [SWS_CRYPT_50049].

Interaction and Preconditions

Prior to the call, the context must be initialized via a suitable key [SWS_CRYPT_50049]. To ensure sufficient capacity of the buffer ivOut, the required IV length can be determined in advance via GetOutputIvSize() [SWS_CRYPT_50143]. If authentication with tag calculation is additionally required, ara::crypto::cryp::AuthCipherCtx provides the corresponding counterpart [SWS_CRYPT_50080].

Error Handling and Concurrency

The interface is specified as thread-safe and exception safe (“exception safe”) and applies rollback semantics in case of errors [SWS_CRYPT_50049]. Interpretation: These rollback semantics are presumably intended to ensure that, in the event of errors, the context state remains intact and no incomplete data remain valid in the buffer. Question Q-841087731518d866 (open) Relevant errors include:

  • UninitializedContext: No key has yet been assigned to the context [SWS_CRYPT_50049].
  • ara::crypto::CryptoErrc::kInsufficientCapacity: The capacity of out or ivOut is insufficient [SWS_CRYPT_50049].
  • ara::crypto::CryptoErrc::kUnsupported: Single-call encryption is not supported or the algorithm enforces the specification of an input IV [SWS_CRYPT_50049].
  • ara::crypto::CryptoErrc::kUsageViolation or ara::crypto::CryptoErrc::kIncompatibleObject: The key type does not match the transformation or the key usage does not permit data encryption [SWS_CRYPT_50049].

This usage note was generated by an AI based on the AUTOSAR Adaptive specifications.

Implementer's Guide to follow (complexity 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#f2ba22b4
Content hash
f2ba22b4
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 041cbaba2731 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The synchronous method Finish finalizes a symmetric encryption or decryption within ara::crypto::cryp::SymmetricCipherCtx without returning an initialization vector ([SWS_CRYPT_50045]). It processes the last data section from the input buffer in (ReadOnlyMemRegion) and writes the resulting data into the output buffer out (ReadWriteMemRegion) ([SWS_CRYPT_50045]). The buffer size required for this can be queried in advance via GetRequiredOutputBufferSize() ([SWS_CRYPT_50045]). In case of success, the return value of type ara::core::Result<std::size_t> provides the exact number of written bytes, which may be smaller than the total capacity of out ([SWS_CRYPT_50045]).

Error handling

In case of an error, the method returns a ara::core::Result with specific error codes ([SWS_CRYPT_50045]):

  • ProcessingNotStarted: Data processing was not previously initiated by Start() ([SWS_CRYPT_50045]).
  • ara::crypto::CryptoErrc::kInsufficientCapacity: The output buffer out is too small ([SWS_CRYPT_50045]).
  • ara::crypto::CryptoErrc::kInvalidInputSize: The size of the input data cannot be processed ([SWS_CRYPT_50045]).
  • ara::crypto::CryptoErrc::kInvalidArgument: The passed input data are invalid ([SWS_CRYPT_50045]).
  • ara::crypto::CryptoErrc::kUnsupported: Stream processing is not supported by the current context ([SWS_CRYPT_50045]).

If one of the CryptoErrc errors occurs, rollback semantics take effect ([SWS_CRYPT_50045]).

Concurrency and Interaction

The operation is defined as thread-safe and exception safe ([SWS_CRYPT_50045]). Before the call, the transformation must strictly have been started by Start() ([SWS_CRYPT_50045]). The maximum permitted input size for individual calls of Finish() can be determined via GetMaximumChunkSize() ([SWS_CRYPT_50050]). After completion, the transformation run is presumably terminated, and a new call to Start() will likely be required for further operations. Question Q-c4ffc8028e8f522b (open)

This text was generated by an AI based on the AUTOSAR specification 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#b9951f15
Content hash
b9951f15
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: c0e4f2ad1bdc Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The FinishEncrypt method completes an encryption operation and returns the initialization vector (IV) generated by the context [SWS_CRYPT_23618]. It processes the final input data buffer in and writes the resulting data to the output buffer out as well as the IV to ivOut. As a return value, it provides a ara::core::Result<std::size_t> with the actual size of the written output data, which can be smaller than the capacity of out [SWS_CRYPT_23618].

For error-free execution, buffer dimensions and context state must be coordinated in advance:

If data processing was not previously initiated by Start(), the method reports CryptoErrc::kProcessingNotStarted [SWS_CRYPT_23618]. If the input buffer contains invalid data, CryptoErrc::kInvalidArgument follows [SWS_CRYPT_23618]. Error CryptoErrc::kUnsupported occurs if stream processing is not supported, the context does not use an IV, or an IV was already passed in Start() [SWS_CRYPT_23618]. All errors have rollback semantics [SWS_CRYPT_23618]. According to the specification, the call is thread-safe and exception safe (noexcept) [SWS_CRYPT_23618].

This usage note was generated automatically based on the AUTOSAR payload.

Implementer's Guide to follow (complexity 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#c50d30f8
Content hash
c50d30f8
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

function 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#439b3c69
Content hash
439b3c69
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

function 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#2fd32b15
Content hash
2fd32b15
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

function 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#8dfc91ab
Content hash
8dfc91ab
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

function 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#a69e1387
Content hash
a69e1387
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

function 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#11f7dfe6
Content hash
11f7dfe6
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

function 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#3cd4a32f
Content hash
3cd4a32f
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 4a1fdc95f521 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The ProcessSingleCall method performs encryption or decryption in a single synchronous call without an initialization vector (IV) ([SWS_CRYPT_50047]). The data buffer in (ReadOnlyMemRegion) and the transformation direction transformDirection (CryptoTransform) serve as input parameters, while the result is written into the buffer out (ReadWriteMemRegion). Upon successful execution, the function returns a ara::core::Result<std::size_t> containing the number of written bytes; this value may be smaller than the total capacity of the output buffer.

Regarding concurrency and safety, the method is specified as thread-safe and exception safe ([SWS_CRYPT_50047]). The processable input size of in is subject to the limits defined by the context, which can be queried via [SWS_CRYPT_50144] (GetMinimumChunkSize) and [SWS_CRYPT_50050] (GetMaximumChunkSize).

All error cases follow rollback semantics ([SWS_CRYPT_50047]):

  • ara::crypto::CryptoErrc::kUninitializedContext: The context was not initialized beforehand by assigning a key.
  • ara::crypto::CryptoErrc::kUnsupported: Single-call processing is not supported, or the transformation requires setting or reading an IV.
  • ara::crypto::CryptoErrc::kInsufficientCapacity: The output buffer out does not offer sufficient capacity.
  • ara::crypto::CryptoErrc::kInvalidInputSize: The input size cannot be processed by the context.
  • ara::crypto::CryptoErrc::kUsageViolation: The key usage does not cover the requested operation (kAllowDataEncryption or kAllowDataDecryption).
  • ara::crypto::CryptoErrc::kIncompatibleObject, kEmptyKeySlot, kInvalidArgument, or kBusyResource: Key is incompatible, key slot is empty, input data are invalid, or required resources are busy.

In interaction with other interfaces, the call requires a fully configured context; for authenticating ciphers with additional tag processing, the alternative interface [SWS_CRYPT_50078] is available in AuthCipherCtx.

This usage note was automatically generated based on the AUTOSAR specification.

Implementer's Guide to follow (complexity 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#c5198454
Content hash
c5198454
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f491c775eb62 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The ProcessSingleCallWithInputIv method on ara::crypto::cryp::SymmetricCipherCtx performs symmetric encryption or decryption of data in a single synchronous call (single-call) [SWS_CRYPT_50048]. In doing so, the initialization vector used for the transformation is explicitly passed via the input buffer iv.

Usage and Interaction

transformDirection controls whether the data from in are encrypted or decrypted. The result is written into the buffer out. The returned ara::core::Result<std::size_t> contains the actual number of written bytes, which may be less than the total capacity of out [SWS_CRYPT_50048].

Helper functions are available for dimensioning the buffers:

  • The required buffer size for out can be calculated in advance via GetRequiredOutputBufferSize with the parameter isFinal = true [SWS_CRYPT_50140].
  • The permitted length for iv can be determined for the selected transformation direction via GetMinimumInputIvSize [SWS_CRYPT_50141] as well as GetMaximumInputIvSize [SWS_CRYPT_50142].
  • If the generation or verification of an authentication tag is additionally required, ara::crypto::cryp::AuthCipherCtx::ProcessSingleCallWithInputIv must be used instead [SWS_CRYPT_50079].

Error Handling and Concurrency

The operation is defined as thread-safe and exception safe [SWS_CRYPT_50048]. All errors have rollback semantics:

  • CryptoErrc::kUninitializedContext or CryptoErrc::kEmptyKeySlot: No key was assigned to the context or the KeySlot is empty [SWS_CRYPT_50048].
  • CryptoErrc::kUsageViolation: The key does not permit the selected direction (kAllowDataEncryption or kAllowDataDecryption is missing) [SWS_CRYPT_50048].
  • CryptoErrc::kIncompatibleObject: The key type is incompatible with the transformation [SWS_CRYPT_50048].
  • CryptoErrc::kInsufficientCapacity: The output buffer out is too small [SWS_CRYPT_50048].
  • CryptoErrc::kInvalidInputSize or CryptoErrc::kInvalidArgument: Buffer size or content of in is invalid [SWS_CRYPT_50048].
  • CryptoErrc::kUnsupported: Single-call processing or input IVs are not supported [SWS_CRYPT_50048].
  • CryptoErrc::kBusyResource: A required resource is busy [SWS_CRYPT_50048].

This text was created by an AI and serves to support the use of the specification element.

Implementer's Guide to follow (complexity 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#06bfc8c8
Content hash
06bfc8c8
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 2287fbd40f75 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The method Seek of the interface ara::crypto::cryp::SymmetricCipherCtx sets the position of the next byte to be processed within a data stream [SWS_CRYPT_23613]. The call is likely to be synchronous due to the absence of asynchronous return types such as futures. Question Q-fccf732722263f60 (open)

use

Positioning is controlled via two parameters [SWS_CRYPT_23613]:

  • offset: Byte offset in the data stream, relative either to the beginning of the stream or the current position [SWS_CRYPT_23613].
  • fromBegin: Reference point of the positioning; true addresses the offset from the beginning of the stream, false relative to the current position [SWS_CRYPT_23613].

The function is declared as noexcept and returns a ara::core::Result<void>, which signals successful completion or contains an occurred error object [SWS_CRYPT_23613].

Concurrency and Limitations

According to the specification, Seek is classified as exception safe (exception safe) and thread-safe (thread-safe) [SWS_CRYPT_23613]. A prerequisite for execution is that data processing was previously initiated by calling Start() [SWS_CRYPT_23613].

Error handling

All error cases are subject to a defined rollback semantics (rollback_semantics), so that the internal state remains consistent upon errors [SWS_CRYPT_23613]:

  • ara::crypto::CryptoErrc::kUnsupported: The seek operation is not supported by the current cryptographic context [SWS_CRYPT_23613].
  • ara::crypto::CryptoErrc::kProcessingNotStarted: Data processing was not started in advance via Start() [SWS_CRYPT_23613].
  • ara::crypto::CryptoErrc::kOutOfBounds: The resulting offset is too small or too large for the data stream [SWS_CRYPT_23613].
  • ara::crypto::CryptoErrc::kInvalidArgument: The resulting offset is not aligned to a block boundary, although the context requires block alignment [SWS_CRYPT_23613].

This text was created by an AI.

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#6a415382
Content hash
6a415382
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 72406ca015ea Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The pure virtual method SetKey configures the instance of ara::crypto::cryp::SymmetricCipherCtx so that it uses the key from the passed KeySlot for future cryptographic operations [SWS_CRYPT_50043].

Usage and Call Context

The call is synchronous and accepts a KeySlot::Sptr containing a SymmetricKey as parameter keySlot [SWS_CRYPT_50043]. The return value is a ara::core::Result<void> that indicates success or, in case of an error, conveys an error code [SWS_CRYPT_50043]. The configuration causes the key stored in the slot not to be consulted until the actual encryption or decryption is started [SWS_CRYPT_50043].

Error handling

In case of an error, no exception is thrown (the method is specified as noexcept and exception safe); instead, an error code with rollback semantics is returned [SWS_CRYPT_50043]:

  • ara::crypto::CryptoErrc::kIncompatibleObject: The passed KeySlot is incompatible with the cipher context [SWS_CRYPT_50043].
  • ara::crypto::CryptoErrc::kUnsupported: The context implementation exclusively supports setting a direct key (such as SymmetricKey) and not assignment via a KeySlot [SWS_CRYPT_50043].

Concurrency and Interaction

The method is designated as thread-safe [SWS_CRYPT_50043]. Interpretation: The actual reading of the key material is presumably performed only when starting encryption or decryption, meaning that the slot must remain consistent until the transformation starts. Question Q-799125800ab0f93c (open) The concept of configuring contexts via KeySlot::Sptr instead of direct key objects aligns with the unified pattern of related crypto contexts, including KeyDerivationFunctionCtx [SWS_CRYPT_50010], MessageAuthnCodeCtx [SWS_CRYPT_50026], SymmetricKeyWrapperCtx [SWS_CRYPT_50034], and VerifierPublicCtx [SWS_CRYPT_50018].

This text was generated by an AI based on the AUTOSAR Adaptive R25-11 specification.

Implementer's Guide to follow (complexity 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#e7e7c9ab
Content hash
e7e7c9ab
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 7e5086bb8751 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The method SetKey serves to configure an instance of ara::crypto::cryp::SymmetricCipherCtx to use a passed symmetric key [SWS_CRYPT_50138]. As an input parameter, the function accepts the key to be used as a smart pointer key of type SymmetricKey::Sptr. The call is synchronous and returns an ara::core::Result<void>, which is empty upon successful assignment or provides an error code in case of error [SWS_CRYPT_50138]. The declaration is included via header ara/crypto/cryp/symmetric_cipher_ctx.h.

Error handling

Error handling guarantees rollback semantics, so that the context remains in its previous state upon failure of the assignment [SWS_CRYPT_50138]. Two specific errors are defined:

  • ara::crypto::CryptoErrc::kUnsupported: Occurs when the context exclusively supports assigning a key via a KeySlot [SWS_CRYPT_50138].
  • ara::crypto::CryptoErrc::kIncompatibleObject: Returned when the passed key object is not compatible with the context [SWS_CRYPT_50138].

Concurrency and Interaction

The virtual function is defined as noexcept, is considered exception-safe, and is implemented thread-safe according to the specification [SWS_CRYPT_50138]. Similar interfaces for assigning SymmetricKey::Sptr can be found in related crypto contexts such as AuthCipherCtx [SWS_CRYPT_23911] as well as SymmetricKeyWrapperCtx [SWS_CRYPT_24018]. Furthermore, context classes that alternatively accept KeySlot::Sptr illustrate the interaction with key containers [SWS_CRYPT_50034].

This usage note was generated automatically based on AUTOSAR specification R25-11.

Implementer's Guide to follow (complexity 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#aa2f4130
Content hash
aa2f4130
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 33beff56357b Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The method Start initializes the context ara::crypto::cryp::SymmetricCipherCtx for a new synchronous encryption or decryption operation and sets the associated initialization vector (IV) or nonce value [SWS_CRYPT_23625]. The transformation direction is specified via the parameter transformDirection, while iv provides the initialization vector as ReadOnlyMemRegion [SWS_CRYPT_23625]. The permitted size of the buffer can be queried in advance via the methods GetMinimumInputIvSize() and GetMaximumInputIvSize() [SWS_CRYPT_23625]. The call returns a ara::core::Result<void>, is declared as noexcept, and is considered exception safe [SWS_CRYPT_23625].

Error handling

In the event of an error, an error code with rollback semantics is returned [SWS_CRYPT_23625]:

  • ara::crypto::CryptoErrc::kUninitializedContext: The context was not previously initialized by assigning a key [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kInvalidInputSize: The passed IV size is not supported [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kUnsupported: Setting an IV in the specified transformation direction or stream processing is not supported by the context [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kEmptyKeySlot: A configured KeySlot is currently empty [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kUsageViolation: The permitted key usage does not include kAllowDataEncryption for encryption or kAllowDataDecryption for decryption [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kIncompatibleObject: The key type is incompatible with the transformation or transformation direction [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kBusyResource: A required resource is busy [SWS_CRYPT_23625].

Concurrency and Interaction

The function is specified as thread-safe [SWS_CRYPT_23625]. In the course of stream processing, Start acts as an initiating step, which is followed, for example, by positioning operations via Seek [SWS_CRYPT_23613] or finalization via FinishEncrypt [SWS_CRYPT_23618].

This text was generated by an AI system based on AUTOSAR specification R25-11.

Implementer's Guide to follow (complexity 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#a536a6ca
Content hash
a536a6ca
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 09affb4844e4 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The Start method initializes an instance of ara::crypto::cryp::SymmetricCipherCtx synchronously for upcoming encryption or decryption ([SWS_CRYPT_50044]). It is used when no initialization vector (IV) is required for the transformation direction specified via the parameter transformDirection or when the context generates it itself ([SWS_CRYPT_50044]). If, however, the context requires an explicit IV in the selected direction, the overload with IV parameter must be called ([SWS_CRYPT_23625]).

Error Handling and Concurrency

The operation is specified as thread-safe and exception-safe ([SWS_CRYPT_50044]). In case of an error, the function returns a ara::core::Result<void> with rollback semantics ([SWS_CRYPT_50044]). Relevant causes of error are:

  • ara::crypto::CryptoErrc::kUninitializedContext: No key was assigned to the context in advance ([SWS_CRYPT_50044]).
  • ara::crypto::CryptoErrc::kUnsupported: Stream processing is not supported or the operation mandatory requires setting an IV in this direction ([SWS_CRYPT_50044]).
  • ara::crypto::CryptoErrc::kUsageViolation: The key does not possess the required permission kAllowDataEncryption or kAllowDataDecryption ([SWS_CRYPT_50044]).
  • ara::crypto::CryptoErrc::kIncompatibleObject or ara::crypto::CryptoErrc::kEmptyKeySlot: The key type does not match the transformation or the configured key slot is empty ([SWS_CRYPT_50044]).
  • ara::crypto::CryptoErrc::kBusyResource: A required resource is currently occupied ([SWS_CRYPT_50044]).

Interaction

After successful initialization, the data stream can be positioned via Seek if required ([SWS_CRYPT_23613]). If the IV was determined by the context itself, it is passed to the caller via FinishEncrypt at the end of encryption ([SWS_CRYPT_23618]).

This usage note was automatically created based on AUTOSAR specification R25-11.

Implementer's Guide to follow (complexity 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#842f896d
Content hash
842f896d
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

function 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-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 5cb4a9bba31d Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The synchronous method Update() serves in ara::crypto::cryp::SymmetricCipherCtx for step-by-step encryption or decryption of partial data streams [SWS_CRYPT_50139]. It processes an input buffer in (type ReadOnlyMemRegion) containing plaintext or ciphertext and writes the transformed data into the output buffer out (type ReadWriteMemRegion) [SWS_CRYPT_50139]. In case of success, the return value ara::core::Result<std::size_t> provides the exact number of bytes actually written to out, which may be less than the total capacity of the destination buffer [SWS_CRYPT_50139].

Defined preconditions and buffer rules apply to the call:

  • Execution order: Data processing must mandatorily have been initiated beforehand using the method Start(); otherwise, the call fails with ara::crypto::CryptoErrc::kProcessingNotStarted [SWS_CRYPT_50139].
  • Buffer sizing: The maximum input size permitted per single call can be determined via GetMaximumChunkSize() [SWS_CRYPT_50050]; the method acknowledges invalid buffer sizes with ara::crypto::CryptoErrc::kInvalidInputSize [SWS_CRYPT_50139]. The required output buffer can be queried via GetRequiredOutputBufferSize() [SWS_CRYPT_50139]; a buffer that is too small leads to ara::crypto::CryptoErrc::kInsufficientCapacity [SWS_CRYPT_50139].
  • Streaming support: If the concrete context does not support continuous stream processing, the call fails with ara::crypto::CryptoErrc::kUnsupported [SWS_CRYPT_50139].

The interface is specified as thread-safe as well as exception safe and guarantees rollback semantics for every error [SWS_CRYPT_50139]. In the processing cycle, it interacts with GetMaximumChunkSize() as well as concluding operations such as Finish() or FinishEncrypt() [SWS_CRYPT_50050].

This usage note was generated automatically based on the AUTOSAR specification 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#50161066
Content hash
50161066
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

Type alias documentation

type alias 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#61315479
Content hash
61315479
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