DEENESPTFRRUARHIKOZHNL

class ara::crypto::cryp::AuthCipherCtx

[SWS_CRYPT_20100] Upstream: RS_CRYPTO_02207

class AuthCipherCtx :           public CryptoContext {...};

Authenticated Cipher Context interface.

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

User GuideAI-GENERATED

Provides an interface for authenticated symmetric encryption and decryption with integrity protection.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: a1dee2a3fcf5 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Provides an interface for authenticated symmetric encryption and decryption with integrity protection.

The interface ara::crypto::cryp::AuthCipherCtx serves for authenticated encryption and decryption of data while preserving confidentiality and integrity [SWS_CRYPT_23911]. After configuring the key, processing takes place either as an atomic single call or as a streamed sequence of initialization, optional authentication data, payload updates, and finalization. As a critical security precondition, decryption fails if the authentication tag is invalid, meaning decrypted payload data may only be processed after successful validation [SWS_CRYPT_50075].

Context

The interface ara::crypto::cryp::AuthCipherCtx defines the standardized application programming interface for authenticated cipher operations (Authenticated Encryption with Associated Data, AEAD) within the AUTOSAR Adaptive Platform. It combines confidentiality with integrity protection by always generating or validating a cryptographic authentication tag in addition to the actual encryption or decryption of payload data. Calling applications and key objects act as central interaction partners: Prior to use, a context is either bound to a concrete instance of SymmetricKey [SWS_CRYPT_23911] or configured with a persisted or provided KeySlot [SWS_CRYPT_50072]. In addition to step-by-step streaming processing, the class also supports self-contained single calls for processing complete messages in one step [SWS_CRYPT_50078].

Lifecycle

In the application domain, contexts are managed via the shared pointer type ara::crypto::cryp::AuthCipherCtx::Sptr [SWS_CRYPT_20101]. (Interpretation: Object creation typically occurs via a higher-level provider factory, as AuthCipherCtx is specified as a pure interface). Question Q-23125789874cf2f3 (open) All member functions are declared as exception-safe (exception safe) and thread-safe (thread-safe) [SWS_CRYPT_23911], [SWS_CRYPT_24715]. The functional lifecycle passes through clearly defined states:

  • Uninitialized: Immediately after instantiation. Calls for data processing are rejected, as no key has been assigned yet [SWS_CRYPT_50081].
  • Key configured: Through a successful call to SetKey with a SymmetricKey [SWS_CRYPT_23911] or a KeySlot [SWS_CRYPT_50072], the context transitions to the ready state. From this state, single-shot operations can be executed directly.
  • Streaming active: Entered by calling Start with specification of the transformation direction with initialization vector (IV) [SWS_CRYPT_24715] or without explicit IV [SWS_CRYPT_50073].
  • Completion / reset: An ongoing streaming operation is completed regularly by Finish [SWS_CRYPT_50075] or FinishEncrypt [SWS_CRYPT_50076], or aborted prematurely via Cancel [SWS_CRYPT_50077]. Afterward, the context is ready for new processing sequences again.
Lebenszyklus Uninitialized Uninitialized KeyConfigured KeyConfigured Uninitialized->KeyConfigured SetKey() KeyConfigured->KeyConfigured ProcessSingleCall() StreamingActive StreamingActive KeyConfigured->StreamingActive Start() StreamingActive->KeyConfigured Finish() / Cancel() StreamingActive->StreamingActive UpdateAuthenticatedData() UpdateConfidentialData()

State diagram: State phases of the context from key binding through streaming processing to completion. Sources: [SWS_CRYPT_23911], [SWS_CRYPT_50072], [SWS_CRYPT_24715], [SWS_CRYPT_50075], [SWS_CRYPT_50077].

Usage Path

For continuous data stream processing, the interface requires an ordered sequence of calls:

  1. Configuration: Assignment of the key via SetKey [SWS_CRYPT_23911] or SetKey with KeySlot [SWS_CRYPT_50072].
  2. Parameter query: Optional retrieval of limits and buffer sizes via GetMinimumChunkSize [SWS_CRYPT_50162], GetMaximumChunkSize [SWS_CRYPT_50082], GetMinimumInputIvSize [SWS_CRYPT_50163], GetMaximumInputIvSize [SWS_CRYPT_50164], GetTagSize [SWS_CRYPT_50161], and GetRequiredOutputBufferSize [SWS_CRYPT_50081].
  3. Operation start: Calling Start specifying the direction (encryption or decryption) and providing the IV [SWS_CRYPT_24715] or requesting a context-owned IV [SWS_CRYPT_50073].
  4. Associated data (AAD): If additional plaintext data is to be included in the integrity calculation, it is passed via UpdateAuthenticatedData [SWS_CRYPT_20313]. The maximum allowed AAD size can be queried via GetMaxAssociatedDataSize [SWS_CRYPT_20103]. Important: AAD blocks must strictly be transmitted before the actual payload.
  5. Payload processing: Stepwise passing of data blocks via UpdateConfidentialData [SWS_CRYPT_50074]. During decryption, the plaintext is returned before its authenticity is established; the application must only use this data after successful finalization.
  6. Finalization: Terminating the operation using Finish [SWS_CRYPT_50075] or FinishEncrypt [SWS_CRYPT_50076], whereby the final block is processed and the authentication tag is calculated or verified.

Single-call alternatives exist for compact payloads: ProcessSingleCall processes data without passing an IV [SWS_CRYPT_50078], ProcessSingleCallWithInputIv accepts an external IV [SWS_CRYPT_50079], and EncryptSingleCallWithOutputIv returns an IV generated by the context to the caller [SWS_CRYPT_50080].

Sequence of a streamed authenticated encryptionApplicationAuthCipherCtxSetKey(key)Result<void>Start(kEncrypt, iv)Result<void>optZusatzdaten vorhandenUpdateAuthenticatedData(aad)Result<void>loopfuer jeden DatenblockUpdateConfidentialData(in, out)Result<size_t>Finish(in, out, tag)Result<size_t>

Sequence diagram: Call sequence of a streamed authenticated encryption. Sources: [SWS_CRYPT_23911], [SWS_CRYPT_24715], [SWS_CRYPT_20313], [SWS_CRYPT_50074], [SWS_CRYPT_50075].

Error Scenarios

Methods of AuthCipherCtx return results via ara::core::Result and have rollback semantics in case of error. Relevant error codes from ara::crypto::CryptoErrc are:

This guide is based exclusively on the AUTOSAR Adaptive standard (Release R25-11) and summarizes the requirements for the interface ara::crypto::cryp::AuthCipherCtx.

Member map

Class diagram

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

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

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 and calculate/verify of the authentication tag in a single-call and return an IV generated by the context.

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

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

FinishEncrypt function

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

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

Get maximum supported size of associated public data.

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

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

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

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

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

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

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

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

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

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

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

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

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

Get the output tag size.

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

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

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

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

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

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

Overloads SetKey 2
virtual ara::core::Result< void > SetKey (SymmetricKey::Sptr key) noexcept=0; SWS_CRYPT_23911
virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0; SWS_CRYPT_50072
Start 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_24715
virtual ara::core::Result< void > Start (CryptoTransform transform Direction) noexcept=0; SWS_CRYPT_50073

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

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

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

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

Type aliases

Sptr type alias

Smart pointer of the interface.

Method documentation

function Cancel [SWS_CRYPT_50077] Upstream: RS_CRYPTO_02302

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 739ac0d710b6 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The method Cancel() of interface ara::crypto::cryp::AuthCipherCtx aborts an active streaming operation that was previously initiated via Start() and has not yet been completed [SWS_CRYPT_50077]. The function is provided via the header ara/crypto/cryp/auth_cipher_ctx.h and operates synchronously without parameters [SWS_CRYPT_50077]. It returns a ara::core::Result<void> that is empty in case of success.

Error Handling and Boundary Conditions

An abort requires that data processing was actually started beforehand by Start(). If the streaming operation was not started, the call fails and returns the error code ara::crypto::CryptoErrc::kProcessingNotStarted with rollback semantics [SWS_CRYPT_50077].

Concurrency

The operation is declared as noexcept and, according to the specification, classified as both thread-safe and exception safe [SWS_CRYPT_50077].

Interaction

The abort pattern realized by Cancel() is standardized in module crypt. An identical interface semantics and the same error code ara::crypto::CryptoErrc::kProcessingNotStarted are defined for corresponding streaming contexts:

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

Implementer's Guide to follow (complexity I1)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50077
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50077@rel:R25-11#863ca4bd
Content hash
863ca4bd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50077
Status: valid/unmigrated Version: rel:R25-11#863ca4bd Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50077@rel:R25-11#863ca4bd
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function EncryptSingleCallWithOutputIv [SWS_CRYPT_50080] Upstream: RS_CRYPTO_02302

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 6385ebfbc16d Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The synchronous method EncryptSingleCallWithOutputIv of interface ara::crypto::cryp::AuthCipherCtx performs authenticated ciphering in a single step and thereby generates an initialization vector independently [SWS_CRYPT_50080]. It processes input data from dataIn as well as optional additional data authenticatedData and writes the ciphertext into the buffer dataOut. The generated initialization vector is stored in the buffer ivOut, while the authentication tag is output via tag [SWS_CRYPT_50080]. The buffer size for ivOut can be determined in advance via the method GetOutputIvSize [SWS_CRYPT_50165]. Despite the name component Encrypt, the method can presumably also be used for decryption, since the error specification explicitly lists the behavior for transformDirection == kDecrypt [SWS_CRYPT_50080]. Question Q-66618567b20f99b9 (open)

Essential preconditions and restrictions apply to the call:

  • The context must have been successfully initialized with SetKey beforehand; otherwise, kUninitializedContext is reported [SWS_CRYPT_50080].
  • The key in the configured Key-Slot must be compatible and have the appropriate permission (e.g., kAllowDataEncrypt), as otherwise kUsageViolation or kIncompatibleObject is returned [SWS_CRYPT_50080].
  • If the output buffers dataOut or ivOut are insufficient, the call fails with kInsufficientCapacity [SWS_CRYPT_50080].
  • If the context does not support single-step processing or requires an external IV specification, kUnsupported is returned [SWS_CRYPT_50080].

The operation is specified as thread-safe as well as exception-safe and guarantees rollback semantics in case of error [SWS_CRYPT_50080]. For pure symmetric cipher operations without tag processing, a separate counterpart exists in SymmetricCipherCtx [SWS_CRYPT_50049].

This text was generated by an AI based on the specification.

Implementer's Guide to follow (complexity I2)

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

Parameter (in)

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

Parameter (out)

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

Parameter (in/out)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50080
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50080@rel:R25-11#1fa18617
Content hash
1fa18617
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50080
Status: valid/unmigrated Version: rel:R25-11#1fa18617 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50080@rel:R25-11#1fa18617
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function Finish [SWS_CRYPT_50075] Upstream: RS_CRYPTO_02302

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 8b946dd1de69 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Semantics

The method Finish synchronously completes encryption or decryption within a ara::crypto::cryp::AuthCipherCtx and calculates or verifies the authentication tag without returning an initialization vector (IV) [SWS_CRYPT_50075]. The caller passes the remaining data via the buffer in as well as the destination buffer out. In the case of encryption, the calculated tag is output via the buffer tag, whereas in the case of decryption, the tag to be verified is passed [SWS_CRYPT_50075]. The return value ara::core::Result<std::size_t> specifies the number of bytes actually written to out, which may be smaller than the capacity of the output buffer [SWS_CRYPT_50075].

Sequence and Interaction

Prior to the call, data processing must mandatorily have been initiated by Start() [SWS_CRYPT_50075]. If data blocks were previously processed using UpdateConfidentialData, an application may use the resulting plaintext during decryption only after successful authentication by Finish [SWS_CRYPT_50074]. The maximum required buffer size for out can be determined in advance via GetRequiredOutputBufferSize by specifying isFinal = true [SWS_CRYPT_50081].

Error Handling and Concurrency

The method is specified as thread-safe and exception-safe [SWS_CRYPT_50075]. Errors are reported via ara::core::Result with rollback semantics [SWS_CRYPT_50075]:

  • ProcessingNotStarted: Data processing was not previously started with Start() [SWS_CRYPT_50075].
  • ara::crypto::CryptoErrc::kInsufficientCapacity: The output buffer out is too small [SWS_CRYPT_50075].
  • ara::crypto::CryptoErrc::kInvalidInputSize: The buffer size of in or tag is invalid [SWS_CRYPT_50075].
  • ara::crypto::CryptoErrc::kAuthTagNotValid: Data authenticity cannot be confirmed during decryption [SWS_CRYPT_50075].
  • ara::crypto::CryptoErrc::kUnsupported: Streaming processing is not supported by the context [SWS_CRYPT_50075].

Note: This usage note was generated automatically based on the specification data.

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

Parameter (in)

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

Parameter (out)

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

Parameter (in/out)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50075
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50075@rel:R25-11#61f4f343
Content hash
61f4f343
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50075
Status: valid/unmigrated Version: rel:R25-11#61f4f343 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50075@rel:R25-11#61f4f343
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function FinishEncrypt [SWS_CRYPT_50076] Upstream: RS_CRYPTO_02302

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: fd75aa19665e Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The method FinishEncrypt synchronously completes an authenticated encryption operation in ara::crypto::cryp::AuthCipherCtx, calculates the authentication tag, and returns the initialization vector generated by the context via ivOut [SWS_CRYPT_50076]. The call is specified as thread-safe and exception-safe (exception safe) [SWS_CRYPT_50076]. As its result, the function returns an ara::core::Result<std::size_t> with the number of bytes actually written to the output buffer out, where the output size may be smaller than the buffer capacity [SWS_CRYPT_50076]. Interpretation: Although the name indicates encryption, the specification of parameter tag and the error code ara::crypto::CryptoErrc::kAuthTagNotValid indicate that the signature in the context should presumably also be used symmetrically for decryption operations. Question Q-6b924f12c32e0f33 (open)

Interaction and Buffer Dimensioning

Data processing must strictly have been initiated in advance with Start(); otherwise the function reports the error ProcessingNotStarted [SWS_CRYPT_50076]. For buffer dimensioning, the interaction with the following context functions must be observed:

  • The maximum required capacity for out can be calculated in advance via [SWS_CRYPT_50081] using parameter isFinal = true in order to avoid error ara::crypto::CryptoErrc::kInsufficientCapacity [SWS_CRYPT_50076].
  • The minimum and maximum buffer size for the input data in is determined by [SWS_CRYPT_50162] and [SWS_CRYPT_50082].
  • The buffer size required to accommodate the generated initialization vector in ivOut can be queried via [SWS_CRYPT_50165].

Error Handling and Boundary Conditions

In case of error, all responses have defined rollback semantics [SWS_CRYPT_50076]. For invalid buffer sizes for input data or the authentication tag, ara::crypto::CryptoErrc::kInvalidInputSize is returned [SWS_CRYPT_50076]. In addition, the function returns ara::crypto::CryptoErrc::kUnsupported if stream processing is not supported, no IV is used, or the IV was already specified by the application at the start [SWS_CRYPT_50076].

This usage note was created by an AI and is based exclusively on the specification data.

Implementer's Guide to follow (complexity I2)

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

Parameter (in)

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

Parameter (out)

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

Parameter (in/out)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50076
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50076@rel:R25-11#7ffd5c95
Content hash
7ffd5c95
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50076
Status: valid/unmigrated Version: rel:R25-11#7ffd5c95 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50076@rel:R25-11#7ffd5c95
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function GetMaxAssociatedDataSize [SWS_CRYPT_20103] Upstream: RS_CRYPTO_02309

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

Get maximum supported size of associated public data.

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_20103
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20103@rel:R25-11#91aa2c60
Content hash
91aa2c60
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20103
Status: valid/unmigrated Version: rel:R25-11#7d3e4b66 Versionshistorie & Revisions (1 transition, 7 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_20103@rel:R25-11#7d3e4b66
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#91aa2c602026-09-30
  • R20-11rel:R20-11#91749f732026-10-14
  • R21-11rel:R21-11#c88a3b9a2026-10-14
  • R22-11rel:R22-11#e871a6a52026-10-14
  • R23-11rel:R23-11#84dddf6c2026-10-14
  • R24-11rel:R24-11#c2f0c3512026-10-14
  • R25-11rel:R25-11#7d3e4b662026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function GetMaximumChunkSize [SWS_CRYPT_50082] Upstream: RS_CRYPTO_02309

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

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

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50082
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50082@rel:R25-11#f8e55f72
Content hash
f8e55f72
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50082
Status: valid/unmigrated Version: rel:R25-11#f8e55f72 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50082@rel:R25-11#f8e55f72
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function GetMaximumInputIvSize [SWS_CRYPT_50164] Upstream: RS_CRYPTO_02309

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

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

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

Parameter (in)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50164
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50164@rel:R25-11#1567e5b7
Content hash
1567e5b7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50164
Status: valid/unmigrated Version: rel:R25-11#1567e5b7 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50164@rel:R25-11#1567e5b7
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function GetMinimumChunkSize [SWS_CRYPT_50162] Upstream: RS_CRYPTO_02309

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

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

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50162
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50162@rel:R25-11#aa502d0a
Content hash
aa502d0a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50162
Status: valid/unmigrated Version: rel:R25-11#aa502d0a Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50162@rel:R25-11#aa502d0a
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function GetMinimumInputIvSize [SWS_CRYPT_50163] Upstream: RS_CRYPTO_02309

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

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

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

Parameter (in)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50163
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50163@rel:R25-11#452ee080
Content hash
452ee080
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50163
Status: valid/unmigrated Version: rel:R25-11#452ee080 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50163@rel:R25-11#452ee080
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function GetOutputIvSize [SWS_CRYPT_50165] Upstream: RS_CRYPTO_02309

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

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

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50165
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50165@rel:R25-11#b902740e
Content hash
b902740e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50165
Status: valid/unmigrated Version: rel:R25-11#b902740e Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50165@rel:R25-11#b902740e
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function GetRequiredOutputBufferSize [SWS_CRYPT_50081] Upstream: RS_CRYPTO_02302

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

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

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

Parameter (in)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50081
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50081@rel:R25-11#6a6a83e1
Content hash
6a6a83e1
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50081
Status: valid/unmigrated Version: rel:R25-11#6a6a83e1 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50081@rel:R25-11#6a6a83e1
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function GetTagSize [SWS_CRYPT_50161] Upstream: RS_CRYPTO_02309

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

Get the output tag size.

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50161
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50161@rel:R25-11#f81af579
Content hash
f81af579
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50161
Status: valid/unmigrated Version: rel:R25-11#f81af579 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50161@rel:R25-11#f81af579
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function ProcessSingleCall [SWS_CRYPT_50078] Upstream: RS_CRYPTO_02302

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: a5183289221a Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The synchronous method ProcessSingleCall of ara::crypto::cryp::AuthCipherCtx, which is defined as thread-safe, performs the encryption or decryption of payload data and the simultaneous calculation or verification of the authentication tag in a single operation without an initialization vector (IV) [SWS_CRYPT_50078]. Additional authenticated data can be provided via the optional buffer authenticatedData [SWS_CRYPT_50078]. The buffer tag serves as input for verification during decryption and as output for storing the generated authentication tag during encryption [SWS_CRYPT_50078]. Upon successful processing, ara::core::Result<std::size_t> returns the actual number of bytes written to dataOut, which may be smaller than the capacity of the target buffer [SWS_CRYPT_50078].

Before the call, the cryptographic context must have been initialized via a successful call to SetKey; otherwise, the function fails with ara::crypto::CryptoErrc::kUninitializedContext [SWS_CRYPT_50078]. In addition, the used key must be enabled for the requested transformation direction (kAllowDataEncrypt or kAllowDataDecrypt), as otherwise ara::crypto::CryptoErrc::kUsageViolation is reported [SWS_CRYPT_50078]. If single-step processing is not supported or the context requires an IV, the function returns ara::crypto::CryptoErrc::kUnsupported [SWS_CRYPT_50078]. If authentication fails during decryption, ara::crypto::CryptoErrc::kAuthTagNotValid is triggered [SWS_CRYPT_50078]. Errors on the associated key slot are signaled via EmptyKeySlot, ara::crypto::CryptoErrc::kBusyResource, or ara::crypto::CryptoErrc::kIncompatibleObject [SWS_CRYPT_50078].

For buffer management, the maximum required output size for dataOut can be calculated in advance via GetRequiredOutputBufferSize with the flag isFinal = true set [SWS_CRYPT_50081]; an output buffer that is too small leads to ara::crypto::CryptoErrc::kInsufficientCapacity [SWS_CRYPT_50078]. In addition, the size of dataIn must conform to the limits of GetMinimumChunkSize [SWS_CRYPT_50162] and GetMaximumChunkSize [SWS_CRYPT_50082] in order to avoid ara::crypto::CryptoErrc::kInvalidInputSize [SWS_CRYPT_50078].

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

Implementer's Guide to follow (complexity I2)

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

Parameter (in)

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

Parameter (out)

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

Parameter (in/out)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50078
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50078@rel:R25-11#e0ad5fae
Content hash
e0ad5fae
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50078
Status: valid/unmigrated Version: rel:R25-11#e0ad5fae Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50078@rel:R25-11#e0ad5fae
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function ProcessSingleCallWithInputIv [SWS_CRYPT_50079] Upstream: RS_CRYPTO_02302

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 36312c01407d Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The method [SWS_CRYPT_50079] of class ara::crypto::cryp::AuthCipherCtx performs synchronous single-step processing (single-call) for encrypting or decrypting data while simultaneously calculating or verifying the authentication tag.

Upon the call, the input data is specified via dataIn and the direction via transformDirection. The initialization vector is passed via iv, and optional authentication data can be provided via authenticatedData [SWS_CRYPT_50079]. The buffer tag serves as output for the calculated tag in the case of encryption, and as input for verification in the case of decryption [SWS_CRYPT_50079]. On success, the return value ara::core::Result<std::size_t> provides the number of bytes written to dataOut, which may be smaller than the buffer capacity [SWS_CRYPT_50079].

In case of error, all error codes have rollback semantics [SWS_CRYPT_50079]:

  • ara::crypto::CryptoErrc::kUninitializedContext: No key was configured beforehand via SetKey [SWS_CRYPT_50079].
  • ara::crypto::CryptoErrc::kUsageViolation: The key does not possess the required right kAllowDataEncrypt or kAllowDataDecrypt [SWS_CRYPT_50079].
  • ara::crypto::CryptoErrc::kEmptyKeySlot, ara::crypto::CryptoErrc::kBusyResource, or ara::crypto::CryptoErrc::kIncompatibleObject: A configured KeySlot is empty, occupied, or does not contain a compatible SymmetricKey [SWS_CRYPT_50079].
  • ara::crypto::CryptoErrc::kInvalidInputSize or ara::crypto::CryptoErrc::kInsufficientCapacity: The buffers for input, tag, or IV are dimensioned invalidly, or dataOut provides insufficient capacity [SWS_CRYPT_50079].
  • ara::crypto::CryptoErrc::kAuthTagNotValid: During decryption, authentication fails [SWS_CRYPT_50079].
  • ara::crypto::CryptoErrc::kUnsupported: Single-shot processing is not supported by the context, or the context requires setting or outputting an IV [SWS_CRYPT_50079].

The operation is defined as thread-safe and exception safe [SWS_CRYPT_50079]. The permissible lengths for iv can be queried dynamically via GetMinimumInputIvSize [SWS_CRYPT_50163] and GetMaximumInputIvSize [SWS_CRYPT_50164]. Compared to the pure block cipher in SymmetricCipherCtx [SWS_CRYPT_50048], this interface combines cryptographic transformation and integrity verification in a single call.

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

Implementer's Guide to follow (complexity I2)

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

Parameter (in)

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

Parameter (out)

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

Parameter (in/out)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50079
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50079@rel:R25-11#971c6b5c
Content hash
971c6b5c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50079
Status: valid/unmigrated Version: rel:R25-11#971c6b5c Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50079@rel:R25-11#971c6b5c
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function SetKey [SWS_CRYPT_23911] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: c987f167a8b5 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The SetKey method configures the instance of ara::crypto::cryp::AuthCipherCtx to use a passed symmetric key [SWS_CRYPT_23911]. A shared pointer key (of type SymmetricKey::Sptr) used for authenticated encryption or decryption is passed as a parameter [SWS_CRYPT_23911]. The call is synchronous, declared as noexcept, and returns a ara::core::Result<void> [SWS_CRYPT_23911].

In case of an error, the result is reset with rollback semantics and delivers specific error codes [SWS_CRYPT_23911]:

  • ara::crypto::CryptoErrc::kUnsupported: if the context exclusively supports configuration via a KeySlot [SWS_CRYPT_23911].
  • ara::crypto::CryptoErrc::kIncompatibleObject: if the passed key type is not compatible with the current context [SWS_CRYPT_23911].
  • ara::crypto::CryptoErrc::kUsageViolation: if the permitted usage flags of the key do not contain kAllowDataEncrypt for encryption or kAllowDataDecrypt for decryption [SWS_CRYPT_23911].

According to the specification, the interface is classified as thread-safe (thread-safe) and exception safe (exception safe) [SWS_CRYPT_23911]. In interaction with the module context, the key is likely set via Start [SWS_CRYPT_24715] before initializing a new transformation. Question Q-11f7daa370f5d438 (open)

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

Implementer's Guide to follow (complexity I2)

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

Parameter (in)

ParameterBeschreibung
keysymmetric key object used for authenticated en-/decryption

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_23911
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_23911@rel:R25-11#7fa81c37
Content hash
7fa81c37
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_23911
Status: valid/unmigrated Version: rel:R25-11#205c09dd Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_23911@rel:R25-11#205c09dd
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#7fa81c372026-09-30
  • R19-11rel:R19-11#fcb0604e2026-10-14
  • R20-11rel:R20-11#43c209ac2026-10-14
  • R21-11rel:R21-11#9babec8c2026-10-14
  • R22-11rel:R22-11#a5a2e9812026-10-14
  • R23-11rel:R23-11#1982ebed2026-10-14
  • R24-11rel:R24-11#3524b4832026-10-14
  • R25-11rel:R25-11#205c09dd2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function SetKey [SWS_CRYPT_50072] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 44d0d6c36fa2 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function SetKey in interface ara::crypto::cryp::AuthCipherCtx configures the context for cryptographic operations so that the symmetric key stored in a provided key slot is used as soon as the authenticated encryption or decryption is executed [SWS_CRYPT_50072].

Usage: The synchronous call is made via the interface from ara/crypto/cryp/auth_cipher_ctx.h. An instance of KeySlot::Sptr that encapsulates a symmetric key is passed as parameter keySlot [SWS_CRYPT_50072]. The function returns an ara::core::Result<void> that confirms success or contains an error code [SWS_CRYPT_50072].

Error handling: If the concrete implementation of the context only supports direct configuration via an SymmetricKey object and does not offer setting via KeySlot, the call fails. In this case, error ara::crypto::CryptoErrc::kUnsupported is returned with rollback semantics [SWS_CRYPT_50072].

Concurrency and constraints: The function is specified as thread-safe and exception safe [SWS_CRYPT_50072]. It can be called concurrently and ensures that no inconsistent state remains in exception situations.

Interaction: The overload SetKey with a direct SymmetricKey::Sptr is available as a functional alternative [SWS_CRYPT_23911]. After key binding has occurred, the context is initialized with the operation direction and the initialization vector via Start [SWS_CRYPT_24715]. Analogous signatures with KeySlot::Sptr also exist in MessageAuthnCodeCtx [SWS_CRYPT_50026] and SymmetricKeyWrapperCtx [SWS_CRYPT_50034].

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

Implementer's Guide to follow (complexity I2)

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

Parameter (in)

ParameterBeschreibung
keySlota keyslot containing a symmetric key

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50072
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50072@rel:R25-11#3dd5795a
Content hash
3dd5795a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50072
Status: valid/unmigrated Version: rel:R25-11#3dd5795a Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50072@rel:R25-11#3dd5795a
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function Start [SWS_CRYPT_24715] Upstream: RS_CRYPTO_02302

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: da3f0fb3ff33 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The Start method initializes context ara::crypto::cryp::AuthCipherCtx for a new encryption or decryption and sets the initialization vector (IV) or nonce value to be used [SWS_CRYPT_24715]. The transformation direction is specified via parameter transformDirection, while iv passes the vector as ReadOnlyMemRegion [SWS_CRYPT_24715]. The permitted IV size can be determined via GetMinimumInputIvSize() and GetMaximumInputIvSize(); if the length differs, the function reports the error ara::crypto::CryptoErrc::kInvalidInputSize [SWS_CRYPT_24715].

Prior to the call, SetKey must have been executed successfully; otherwise, ara::crypto::CryptoErrc::kUninitializedContext is returned [SWS_CRYPT_24715]. A configured KeySlot must neither be empty (EmptyKeySlot) nor busy (ara::crypto::CryptoErrc::kBusyResource) [SWS_CRYPT_24715]. Furthermore, the stored key must be a suitable SymmetricKey (otherwise ara::crypto::CryptoErrc::kIncompatibleObject) and authorized for the desired direction (kAllowDataEncrypt or kAllowDataDecrypt, otherwise ara::crypto::CryptoErrc::kUsageViolation) [SWS_CRYPT_24715]. If support for stream processing or setting an IV in the selected direction is missing, the call fails with ara::crypto::CryptoErrc::kUnsupported [SWS_CRYPT_24715]. All errors exhibit rollback semantics [SWS_CRYPT_24715].

The operation is declared as thread-safe and exception-safe (noexcept) [SWS_CRYPT_24715]. In the interaction of cryptographic flows, passing additional authenticated data via UpdateAuthenticatedData would typically follow after successful initialization [SWS_CRYPT_20313]. Question Q-e023e27f1cd24507 (open)

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

Implementer's Guide to follow (complexity I1)

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

Parameter (in)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_24715
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_24715@rel:R25-11#85d3f696
Content hash
85d3f696
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_24715
Status: valid/unmigrated Version: rel:R25-11#dacbb482 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_24715@rel:R25-11#dacbb482
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#85d3f6962026-09-30
  • R19-11rel:R19-11#ea0e49642026-10-14
  • R20-11rel:R20-11#e9fc84162026-10-14
  • R21-11rel:R21-11#a59d78ec2026-10-14
  • R22-11rel:R22-11#dca7e5782026-10-14
  • R23-11rel:R23-11#640bb79c2026-10-14
  • R24-11rel:R24-11#f389a1072026-10-14
  • R25-11rel:R25-11#dacbb4822026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function Start [SWS_CRYPT_50073] Upstream: RS_CRYPTO_02302

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f698e30e2198 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The pure virtual method Start of class ara::crypto::cryp::AuthCipherCtx synchronously initializes the context for an upcoming encryption or decryption [SWS_CRYPT_50073]. The parameter transformDirection indicates whether the context is prepared for encryption or decryption. This overload without an initialization vector (IV) may only be used if the cryptographic context does not require an IV in the selected transformation direction or determines it itself [SWS_CRYPT_50073]. The return value is an empty ara::core::Result<void> in the success case or a corresponding error code.

Error Handling and Preconditions

Before the call, the context must have been successfully configured with a key via SetKey; otherwise the function fails with ara::crypto::CryptoErrc::kUninitializedContext [SWS_CRYPT_50073]. In addition, the following return values occur in the event of an error:

  • ara::crypto::CryptoErrc::kUnsupported if stream processing is not supported by the context or if the context strictly requires the explicit specification of an IV in the selected transformation direction [SWS_CRYPT_50073].
  • ara::crypto::CryptoErrc::kUsageViolation if the permitted key usage in the configured KeySlot does not include the required permission kAllowDataEncrypt for encryption or kAllowDataDecrypt for decryption at the time of the call [SWS_CRYPT_50073].
  • EmptyKeySlot or ara::crypto::CryptoErrc::kBusyResource if a configured KeySlot is currently empty or blocked [SWS_CRYPT_50073].
  • ara::crypto::CryptoErrc::kIncompatibleObject if the configured KeySlot does not contain a SymmetricKey or if this key type is not supported by the context [SWS_CRYPT_50073].

If an error occurs, the specified rollback semantics (rollback_semantics) take effect [SWS_CRYPT_50073].

Concurrency and Interaction

The function is declared with noexcept=0, ensures exception safety, and is designed to be thread-safe [SWS_CRYPT_50073]. If the algorithm requires the external provision of an initialization vector, the overload Start(CryptoTransform, ReadOnlyMemRegion) must be used instead [SWS_CRYPT_24715]. After successful initialization, additional authenticated data can be incorporated into the calculation of the authentication tag via UpdateAuthenticatedData [SWS_CRYPT_20313].

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

Implementer's Guide to follow (complexity I1)

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

Parameter (in)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50073
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50073@rel:R25-11#24eaa91a
Content hash
24eaa91a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50073
Status: valid/unmigrated Version: rel:R25-11#24eaa91a Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50073@rel:R25-11#24eaa91a
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function UpdateAuthenticatedData [SWS_CRYPT_20313] Upstream: RS_CRYPTO_02302

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f3852a997444 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The method UpdateAuthenticatedData of interface ara::crypto::cryp::AuthCipherCtx serves to update the calculation of the authentication tag incrementally with another portion of additional authenticated data (Additional Authenticated Data) [SWS_CRYPT_20313]. Via the parameter authenticatedData, the corresponding buffer is passed as ReadOnlyMemRegion [SWS_CRYPT_20313].

Regarding call context and concurrency, the operation is defined as thread-safe and exception safe [SWS_CRYPT_20313]. Strict sequence conditions apply to the call:

  • The transformation must have been initiated beforehand via the method Start(); otherwise, ara::crypto::CryptoErrc::kProcessingNotStarted is reported [SWS_CRYPT_20313].
  • The function must no longer be called once UpdateConfidentialData has already been executed; in case of non-compliance, the error ara::crypto::CryptoErrc::kInvalidUsageOrder is returned [SWS_CRYPT_20313].

As a return value, the function returns a ara::core::Result<void> that is empty in case of success or encapsulates an occurred error code [SWS_CRYPT_20313]. All errors exhibit rollback semantics [SWS_CRYPT_20313]:

  • ara::crypto::CryptoErrc::kInvalidInputSize: The size of the passed input buffer is invalid [SWS_CRYPT_20313].
  • ara::crypto::CryptoErrc::kUnsupported: Stream processing is not supported by the current context [SWS_CRYPT_20313].

This text was generated by an AI and serves as guidance. The AUTOSAR specification is authoritative.

Implementer's Guide to follow (complexity I1)

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

Parameter (in)

ParameterBeschreibung
authenticatedDataa part of the additional authenticated data

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_20313
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20313@rel:R25-11#e6b73691
Content hash
e6b73691
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20313
Status: valid/unmigrated Version: rel:R25-11#fcb70f91 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_20313@rel:R25-11#fcb70f91
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#e6b736912026-09-30
  • R19-11rel:R19-11#f75b41ea2026-10-14
  • R20-11rel:R20-11#4c46c8f42026-10-14
  • R21-11rel:R21-11#50979c0c2026-10-14
  • R22-11rel:R22-11#f4a00d3a2026-10-14
  • R23-11rel:R23-11#a528f60f2026-10-14
  • R24-11rel:R24-11#7dfc69482026-10-14
  • R25-11rel:R25-11#fcb70f912026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

function UpdateConfidentialData [SWS_CRYPT_50074] Upstream: RS_CRYPTO_02302

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

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

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 0a7976c267f4 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The method UpdateConfidentialData of the class ara::crypto::cryp::AuthCipherCtx serves to encrypt or decrypt confidential payload data step by step within the scope of an authenticated encryption context [SWS_CRYPT_50074]. The input buffer in (type ReadOnlyMemRegion) with part of the plaintext or ciphertext as well as the output buffer out (type ReadWriteMemRegion) are passed to it [SWS_CRYPT_50074]. As a synchronous return value, the function returns a ara::core::Result<std::size_t>, which upon success contains the number of bytes actually written; this can be smaller than the capacity of out [SWS_CRYPT_50074].

Regarding the sequence and concurrency, the following conditions apply:

  • Execution order and integrity: Before processing, the operation must have been initiated via Start() [SWS_CRYPT_50074]. If the method is used for decryption, the plaintext is output without a prior authenticity check; the application must under no circumstances use this data before the final verification by means of Finish() [SWS_CRYPT_50074]. Additional authenticated data can be factored into the tag calculation in parallel via UpdateAuthenticatedData [SWS_CRYPT_20313].
  • Thread and exception safety: The operation is declared as thread-safe as well as exception-safe and does not throw any exceptions (noexcept) [SWS_CRYPT_50074].

If processing fails, rollback semantics apply while returning a corresponding error code in ara::core::Result [SWS_CRYPT_50074]:

  • ara::crypto::CryptoErrc::kProcessingNotStarted: Processing has not yet been initiated via Start() [SWS_CRYPT_50074].
  • ara::crypto::CryptoErrc::kInsufficientCapacity: The output buffer out is dimensioned too small [SWS_CRYPT_50074].
  • ara::crypto::CryptoErrc::kInvalidInputSize: The size of the buffer in is invalid [SWS_CRYPT_50074].
  • ara::crypto::CryptoErrc::kUnsupported: Stream processing is not supported by the context [SWS_CRYPT_50074].

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

Implementer's Guide to follow (complexity I1)

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

Parameter (in)

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

Parameter (out)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50074
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50074@rel:R25-11#342cdc85
Content hash
342cdc85
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50074
Status: valid/unmigrated Version: rel:R25-11#342cdc85 Versionshistorie & Revisions (1 transition)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_50074@rel:R25-11#342cdc85
Point-in-Time History:
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

Type alias documentation

type alias Sptr [SWS_CRYPT_20101] Upstream: RS_CRYPTO_02207

using Sptr = std::shared_ptr<AuthCipherCtx>;

Smart pointer of the interface.

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_20101
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_20101@rel:R25-11#6cded4ce
Content hash
6cded4ce
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_20101
Status: valid/unmigrated Version: rel:R25-11#56d76308 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_20101@rel:R25-11#56d76308
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#6cded4ce2026-09-30
  • R19-11rel:R19-11#d499b7852026-10-14
  • R20-11rel:R20-11#38ae99fd2026-10-14
  • R21-11rel:R21-11#15df77a52026-10-14
  • R22-11rel:R22-11#22ad2b2d2026-10-14
  • R23-11rel:R23-11#d20afa502026-10-14
  • R24-11rel:R24-11#d20afa502026-10-14
  • R25-11rel:R25-11#56d763082026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill