DEENESPTFRRUARHIKOZHNL

class ara::crypto::cryp::DecryptorPrivateCtx

[SWS_CRYPT_50155] Upstream: RS_CRYPTO_02201

class DecryptorPrivateCtx :             public CryptoContext {...};

Interface for asymmetric decryption.

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

User GuideAI-GENERATED

Enables asymmetric decryption of data using private keys as a single call or data stream.
AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 80609e0a7ac2 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Enables asymmetric decryption of data using private keys as a single call or data stream.

The interface ara::crypto::cryp::DecryptorPrivateCtx is used for asymmetric decryption of ciphertexts in the AUTOSAR Adaptive Platform ([SWS_CRYPT_50070]). Before execution, a private key possessing the usage permission for decryption must be provided to the context ([SWS_CRYPT_50157]). Processing can take place either in a single call or as a multi-part data stream across the Start, Update, and Finish phases. All methods of the interface are implemented to be thread-safe and exception-safe.

Context

The interface ara::crypto::cryp::DecryptorPrivateCtx is used for the asymmetric decryption of ciphertexts in the cryptography module of the AUTOSAR Adaptive Platform. As a specialization of CryptoContext, it provides the cryptographic transformation functions used to convert ciphertexts back into plaintext using private keys. Essential interaction partners include the calling application as well as key objects provided as PrivateKey or via a KeySlot. Instances of this interface are typically managed via the typed smart pointer Sptr ([SWS_CRYPT_50156]).

Lifecycle

Management of DecryptorPrivateCtx is performed via the alias ara::crypto::cryp::DecryptorPrivateCtx::Sptr, which maps to std::shared_ptr<DecryptorPrivateCtx> ([SWS_CRYPT_50156]). Interpretation: Since the class is an interface with pure virtual methods, concrete creation is typically expected to be performed by a factory of the crypto driver. Question Q-6130603fcaf29ef9 (open)

Immediately after instantiation, the context is in an uninitialized state. In this state, operational transformation calls lead to errors. For activation, a private key must be assigned. This is done either by passing an PrivateKey::Sptr using SetKey() ([SWS_CRYPT_50157]) or via a KeySlot::Sptr ([SWS_CRYPT_50066]) that encapsulates the key.

As soon as the context is configured with a valid key, it transitions to the Initialized state. In this state, the context can either be used directly for single-call decryption or transitioned via Start() ([SWS_CRYPT_50067]) to the Streaming processing state. During streaming, Update() ([SWS_CRYPT_50158]) accepts ciphertext fragments. The sequence is completed by Finish() ([SWS_CRYPT_50068]) or aborted via Cancel() ([SWS_CRYPT_50069]), whereupon the context is again ready for new operations. All interface methods are specified as thread-safe and exception-safe ([SWS_CRYPT_50066], [SWS_CRYPT_50067], [SWS_CRYPT_50070]).

StateMachine Uninitialized Uninitialized Initialized Initialized Uninitialized->Initialized SetKey() Initialized->Initialized SetKey() / Decrypt() Streaming Streaming Initialized->Streaming Start() Streaming->Initialized Finish() / Cancel() Streaming->Streaming Update()

State diagram: Lifecycle states of the context from key binding through streaming to termination. Sources: [SWS_CRYPT_50066], [SWS_CRYPT_50157], [SWS_CRYPT_50067], [SWS_CRYPT_50158], [SWS_CRYPT_50068], [SWS_CRYPT_50069], [SWS_CRYPT_50070].

Usage Path

Two different sequences are available for decryption: stateless single-call decryption and multi-step streaming processing. Before passing data, the calling application can query the permissible input restrictions for ciphertexts using GetMinimumChunkSize() ([SWS_CRYPT_50160]) and GetMaximumChunkSize() ([SWS_CRYPT_50071]). Via GetRequiredOutputBufferSize() ([SWS_CRYPT_50159]), the required size of the output buffer for Update(), Finish(), or Decrypt() can be determined in advance.

For compact amounts of data, decryption takes place directly via Decrypt() ([SWS_CRYPT_50070]) after key configuration. The ciphertext is transformed in a single step, and the actual number of decrypted bytes is returned.

Larger or fragmented incoming ciphertexts are processed via the streaming path:

  1. Key assignment: Configuration of the context via SetKey() with an PrivateKey ([SWS_CRYPT_50157]) or KeySlot ([SWS_CRYPT_50066]).
  2. Initialization: Call to Start() ([SWS_CRYPT_50067]) to prepare the internal processing state.
  3. Blockwise processing: Repeated call to Update() ([SWS_CRYPT_50158]) for successive ciphertext blocks.
  4. Finalization: Call to Finish() ([SWS_CRYPT_50068]) to process the final block and terminate the stream. Alternatively, the operation can be aborted prematurely using Cancel() ([SWS_CRYPT_50069]).
Sequence of a streaming decryptionApplicationDecryptorPrivateCtxSetKey(key)Result<void>Start()Result<void>loopSolange Chunks vorhandenUpdate(in, out)Result<std::size_t>Finish(in, out)Result<std::size_t>

Sequence diagram: Typical call sequence of a multi-part streaming decryption. Sources: [SWS_CRYPT_50157], [SWS_CRYPT_50067], [SWS_CRYPT_50158], [SWS_CRYPT_50068].

Error Scenarios

Methods of DecryptorPrivateCtx return errors via ara::core::Result with codes from ara::crypto::CryptoErrc and follow rollback semantics:

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

Member map

Class diagram

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

G nara__crypto__cryp__DecryptorPrivateCtx616 DecryptorPrivateCtx + Cancel() + Decrypt() + Finish() + GetMaximumChunkSize() + GetMinimumChunkSize() + GetRequiredOutputBufferSize() + SetKey() + Start() + Update() nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__DecryptorPrivateCtx616->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;
Decrypt function

Decrypt data in a single-call.

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

Finalize the decryption.

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

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

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

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

virtual ara::core::Result< std::size_t > GetMinimumChunkSize () 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;
SetKey function 2

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

Overloads SetKey 2
virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0; SWS_CRYPT_50066
virtual ara::core::Result< void > SetKey (PrivateKey::Sptr key) noexcept=0; SWS_CRYPT_50157
Start function

Initialize the context for a new decryption.

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

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_50069] 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: 1601c28db7a4 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Method Cancel of class ara::crypto::cryp::DecryptorPrivateCtx, defined in ara/crypto/cryp/decryptor_private_ctx.h, aborts an ongoing streaming operation that was previously initiated by means of Start() and has not yet been completed [SWS_CRYPT_50069]. The call takes no input parameters and returns a ara::core::Result<void> as return value [SWS_CRYPT_50069]. If the abort of the streaming processing was successful, the object contains an empty result; otherwise, it conveys an occurred error [SWS_CRYPT_50069]. The purely virtual interface is declared as noexcept, exhibits complete exception safety, and is designated as thread-safe for concurrent access [SWS_CRYPT_50069].

In error handling and pre-conditions, the exact sequence must be observed: If data processing was not previously initiated by calling the Start() method, the operation fails and returns the specific error code ara::crypto::CryptoErrc::kProcessingNotStarted with rollback semantics [SWS_CRYPT_50069]. The caller must therefore ensure that an active operation already exists prior to the abort in order to avoid this error state [SWS_CRYPT_50069].

In interaction with the overall module architecture of crypt, Cancel follows a standardized design pattern for stateful streaming operations. The related cryptographic contexts ara::crypto::cryp::VerifierPublicCtx [SWS_CRYPT_50023], ara::crypto::cryp::MessageAuthnCodeCtx [SWS_CRYPT_50027], ara::crypto::cryp::SignerPrivateCtx [SWS_CRYPT_50041], ara::crypto::cryp::SymmetricCipherCtx [SWS_CRYPT_50046], ara::crypto::cryp::HashFunctionCtx [SWS_CRYPT_50058], ara::crypto::cryp::AuthCipherCtx [SWS_CRYPT_50077], and ara::crypto::cryp::EncryptorPublicCtx [SWS_CRYPT_50089] share the same signature, return semantics, and error handling.

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/decryptor_private_ctx.h"
Scopeclass ara::crypto::cryp::DecryptorPrivateCtx
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_50069
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50069@rel:R25-11#2a0972af
Content hash
2a0972af
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50069
Status: valid/unmigrated Version: rel:R25-11#2a0972af 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_50069@rel:R25-11#2a0972af
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 Decrypt [SWS_CRYPT_50070] Upstream: RS_CRYPTO_02302

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

Decrypt data in a single-call.

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

The synchronous method Decrypt decrypts ciphertext data in a single step ([SWS_CRYPT_50070]). The input buffer in passes the ciphertext as ReadOnlyMemRegion, while the output buffer out of type ReadWriteMemRegion receives the plaintext ([SWS_CRYPT_50070]). Upon successful decryption, the function returns the actual number of bytes written via ara::core::Result<std::size_t>, which may be smaller than the total capacity of out ([SWS_CRYPT_50070]).

The interface is specified as thread-safe as well as exception-safe ([SWS_CRYPT_50070]). Before the call, the context must have been initialized by assigning a key; otherwise the function fails with UninitializedContext or, if the KeySlot is empty, with ara::crypto::CryptoErrc::kEmptyKeySlot ([SWS_CRYPT_50070]). The key must be compatible with the transformation algorithm (otherwise kIncompatibleObject) and include permission kAllowDataDecryption (otherwise kUsageViolation) ([SWS_CRYPT_50070]).

To prevent buffer overflows, the maximum required capacity of the output buffer can be queried in advance using GetRequiredOutputBufferSize by specifying isFinal = true ([SWS_CRYPT_50159]). If the capacity of out is insufficient, the method aborts with ara::crypto::CryptoErrc::kInsufficientCapacity ([SWS_CRYPT_50070]). Furthermore, the size of the input buffer in must be in the range between GetMinimumChunkSize ([SWS_CRYPT_50160]) and GetMaximumChunkSize ([SWS_CRYPT_50071]); otherwise ara::crypto::CryptoErrc::kInvalidInputSize is returned ([SWS_CRYPT_50070]). Other specified errors with rollback semantics are kUnsupported, kInvalidArgument, and kBusyResource ([SWS_CRYPT_50070]).

This usage note was generated automatically based on the specification.

Implementer's Guide to follow (complexity I1)

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

Parameter (in)

ParameterBeschreibung
inan input data buffer containing the ciphertext

Parameter (out)

ParameterBeschreibung
outan output data buffer that the 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
UninitializedContextif the context was not initialized by deploying a key
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if single-call decryption is not supported
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 Decryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50070
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50070@rel:R25-11#42aea752
Content hash
42aea752
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50070
Status: valid/unmigrated Version: rel:R25-11#42aea752 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_50070@rel:R25-11#42aea752
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_50068] Upstream: RS_CRYPTO_02302

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

Finalize the decryption.

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

The Finish method synchronously completes a decryption process in the context of ara::crypto::cryp::DecryptorPrivateCtx [SWS_CRYPT_50068]. Via the input buffer in (ReadOnlyMemRegion), it processes the last ciphertext segment and writes the resulting plaintext data into the output buffer out (ReadWriteMemRegion) [SWS_CRYPT_50068]. The actual number of written bytes is returned as ara::core::Result<std::size_t> and may be smaller than the total capacity of the destination buffer out [SWS_CRYPT_50068].

Prior to the call, data processing must strictly have been initiated with Start(); otherwise, the error CryptoErrc::kProcessingNotStarted is reported [SWS_CRYPT_50068]. The maximum permitted block size for in can be determined via GetMaximumChunkSize() [SWS_CRYPT_50071]; if the input length is inappropriate, the call fails with CryptoErrc::kInvalidInputSize [SWS_CRYPT_50068]. If out is too small, CryptoErrc::kInsufficientCapacity results, where the required buffer size can be queried using GetRequiredOutputBufferSize() [SWS_CRYPT_50068]. Further possible errors are CryptoErrc::kInvalidArgument in case of invalid ciphertext data as well as CryptoErrc::kUnsupported if stream processing is not supported in the context [SWS_CRYPT_50068].

The operation is specified as thread-safe as well as exception safe [SWS_CRYPT_50068]. Thanks to the designated rollback semantics, the processing state is expected to remain unchanged in the event of buffer errors, so that a retry should be possible after increasing the buffer size. Question Q-e2562509449aa32c (open)

This usage note was generated automatically based on the ara::crypto specification (AUTOSAR R25-11).

Header-Datei#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scopeclass ara::crypto::cryp::DecryptorPrivateCtx
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

Parameter (out)

ParameterBeschreibung
outan output data buffer that contains decrypted data. The required size of this buffer can be queried using GetRequiredOutputBuffer Size()

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50068
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50068@rel:R25-11#4e88e7ba
Content hash
4e88e7ba
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50068
Status: valid/unmigrated Version: rel:R25-11#4e88e7ba 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_50068@rel:R25-11#4e88e7ba
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 GetMaximumChunkSize [SWS_CRYPT_50071] Upstream: RS_CRYPTO_02309

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

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

Header-Datei#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scopeclass ara::crypto::cryp::DecryptorPrivateCtx
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_50071
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50071@rel:R25-11#363f8dce
Content hash
363f8dce
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50071
Status: valid/unmigrated Version: rel:R25-11#363f8dce 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_50071@rel:R25-11#363f8dce
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_50160] 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(), or Decrypt() by this context.

Header-Datei#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scopeclass ara::crypto::cryp::DecryptorPrivateCtx
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_50160
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50160@rel:R25-11#840ff3d7
Content hash
840ff3d7
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50160
Status: valid/unmigrated Version: rel:R25-11#840ff3d7 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_50160@rel:R25-11#840ff3d7
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_50159] 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/decryptor_private_ctx.h"
Scopeclass ara::crypto::cryp::DecryptorPrivateCtx
Exception-Sicherheitexception safe
Thread-Sicherheitthread-safe

Parameter (in)

ParameterBeschreibung
inputSizesize of input data
isFinalif true, calculate maximum required output buffer size for Finish() or Decrypt(), 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_50159
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50159@rel:R25-11#34d4f358
Content hash
34d4f358
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50159
Status: valid/unmigrated Version: rel:R25-11#34d4f358 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_50159@rel:R25-11#34d4f358
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_50066] 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 decryption is started.

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

use

The SetKey method configures an instance of ara::crypto::cryp::DecryptorPrivateCtx for the use of a key stored in a passed KeySlot [SWS_CRYPT_50066]. A KeySlot::Sptr is passed as a parameter, which must contain a PrivateKey [SWS_CRYPT_50066]. The actual key is only referenced at the point in time when the decryption operation is started [SWS_CRYPT_50066]. The function operates synchronously and reports the result back via ara::core::Result<void> [SWS_CRYPT_50066].

Error handling

In case of an error, a corresponding error code is returned in the ara::core::Result, whereby rollback semantics apply [SWS_CRYPT_50066]:

  • ara::crypto::CryptoErrc::kIncompatibleObject: The provided KeySlot is not compatible with the context [SWS_CRYPT_50066].
  • ara::crypto::CryptoErrc::kUnsupported: The context supports only setting a PrivateKey directly and does not support KeySlots [SWS_CRYPT_50066].

Concurrency and Interaction

The interface is declared thread-safe (thread-safe) and exception-safe (exception safe) [SWS_CRYPT_50066]. Since the key is evaluated only when decryption starts, updating the slot content prior to this start time should take effect. Question Q-ec258ea8b5a1d1c2 (open) While other cryptographic contexts accept keys partly directly as an instance (for example, SignerPrivateCtx [SWS_CRYPT_23515]), this method follows the pattern of deferred binding via key slots, as is also used in VerifierPublicCtx [SWS_CRYPT_50018] and KeyDerivationFunctionCtx [SWS_CRYPT_50010], among others.

This text was generated by an AI and serves as guidance in the AUTOSAR standard.

Implementer's Guide to follow (complexity I2)

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

Parameter (in)

ParameterBeschreibung
keySlota keyslot containing a PrivateKey.

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 PrivateKey

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50066
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50066@rel:R25-11#a48ca2e4
Content hash
a48ca2e4
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50066
Status: valid/unmigrated Version: rel:R25-11#a48ca2e4 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_50066@rel:R25-11#a48ca2e4
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_50157] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

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

Configure the context to use the provided key.

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

use

The SetKey method configures an instance of ara::crypto::cryp::DecryptorPrivateCtx to use a specific private key for data decryption [SWS_CRYPT_50157]. An instance is passed as a parameter via PrivateKey::Sptr key. The return value is ara::core::Result<void>, confirming successful assignment or returning an error. The call is expected to be executed synchronously (interpretation: the interface blocks until the key is accepted and does not return an asynchronous future object). Question Q-b8e9b5cb4174e2b2 (open)

Error handling

In the event of an error, the implementation ensures rollback semantics so that the context state remains unchanged upon failure [SWS_CRYPT_50157]. The following error codes can occur:

  • ara::crypto::CryptoErrc::kIncompatibleObject: The passed key object is not compatible with this context [SWS_CRYPT_50157].
  • ara::crypto::CryptoErrc::kUsageViolation: The allowed key usage does not include data decryption (kAllowData Decryption) [SWS_CRYPT_50157].
  • ara::crypto::CryptoErrc::kUnsupported: The context does not support directly setting a key object if it is exclusively designed for assignment via a KeySlot [SWS_CRYPT_50157].

Concurrency and Limitations

The interface is explicitly specified as thread-safe and exception safe [SWS_CRYPT_50157]. It guarantees safe execution in concurrent environments and throws no C++ exceptions (noexcept=0).

Interaction

The procedure for key assignment via SetKey is applied uniformly across various cryptographic contexts in the Adaptive Platform: While related asymmetric contexts such as KeyAgreementPrivateCtx [SWS_CRYPT_21313], KeyDecapsulatorPrivateCtx [SWS_CRYPT_21413], and SignerPrivateCtx [SWS_CRYPT_23515] also use PrivateKey::Sptr, alternative variants with KeySlot::Sptr exist in other contexts such as KeyDerivationFunctionCtx [SWS_CRYPT_50010] or VerifierPublicCtx [SWS_CRYPT_50018].

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

Implementer's Guide to follow (complexity I2)

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

Parameter (in)

ParameterBeschreibung
keythe PrivateKey to be used for 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 key object is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowData Decryption

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50157
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50157@rel:R25-11#05a94de8
Content hash
05a94de8
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50157
Status: valid/unmigrated Version: rel:R25-11#05a94de8 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_50157@rel:R25-11#05a94de8
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_50067] Upstream: RS_CRYPTO_02302

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

Initialize the context for a new decryption.

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

The member function Start of class ara::crypto::cryp::DecryptorPrivateCtx ([SWS_CRYPT_50067]) synchronously initializes the context for a new decryption. The call takes no parameters, throws no exceptions (noexcept), and returns an ara::core::Result<void> that is empty in the success case ([SWS_CRYPT_50067]). For concurrent accesses, the method is specified as thread-safe ([SWS_CRYPT_50067]).

Before execution, a compatible key must be stored, as Start checks its state and permissions ([SWS_CRYPT_50067]). If the operation fails, rollback semantics apply ([SWS_CRYPT_50067]). Relevant error codes are:

  • ara::crypto::CryptoErrc::kUninitializedContext: No key has been assigned to the context yet ([SWS_CRYPT_50067]).
  • ara::crypto::CryptoErrc::kEmptyKeySlot: A configured KeySlot is currently empty ([SWS_CRYPT_50067]).
  • ara::crypto::CryptoErrc::kUsageViolation: The permissions of the key do not permit data decryption ([SWS_CRYPT_50067]).
  • ara::crypto::CryptoErrc::kIncompatibleObject: The key type is incompatible with the transformation ([SWS_CRYPT_50067]).
  • ara::crypto::CryptoErrc::kBusyResource: A required resource is busy ([SWS_CRYPT_50067]).
  • ara::crypto::CryptoErrc::kUnsupported: Stream processing is not supported by the context ([SWS_CRYPT_50067]).

In the overall system, the method corresponds to the standardized lifecycle of adaptive crypto contexts, as is used comparably for signature verification ([SWS_CRYPT_50019]), signature generation ([SWS_CRYPT_50037]), or MAC calculation ([SWS_CRYPT_22111]). Interpretation: A call to Start should presumably be strictly required before further processing steps in order to put the decryptor into a defined initial state. Question Q-7d5a95305eb4626a (open)

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

Implementer's Guide to follow (complexity I1)

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

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::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 Decryption
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if type of the key is incompatible to the transformation
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_50067
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50067@rel:R25-11#0df0233a
Content hash
0df0233a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50067
Status: valid/unmigrated Version: rel:R25-11#0df0233a 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_50067@rel:R25-11#0df0233a
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_50158] Upstream: RS_CRYPTO_02302

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

Decrypt a data buffer.

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

use

The Update method serves to decrypt a data buffer in the context of ara::crypto::cryp::DecryptorPrivateCtx [SWS_CRYPT_50158]. The synchronous call receives a ciphertext subsection in parameter in (ReadOnlyMemRegion) and writes the decrypted data into buffer out (ReadWriteMemRegion) [SWS_CRYPT_50158]. The result returned is a ara::core::Result<std::size_t> containing the actual number of bytes written; this value can be smaller than the total capacity of out [SWS_CRYPT_50158].

Interaction and Buffer Dimensioning

Prior to executing Update, data processing must mandatory have been initiated by calling Start() [SWS_CRYPT_50158]. The minimum size required for out can be queried via GetRequiredOutputBufferSize() [SWS_CRYPT_50158]. In addition, the maximum input size that can be processed for individual Update calls can be determined via GetMaximumChunkSize() [SWS_CRYPT_50071].

Error Handling and Concurrency

The interface is specified as thread-safe and exception-safe [SWS_CRYPT_50158]. All error cases have rollback semantics and return specific error codes in ara::core::Result [SWS_CRYPT_50158]:

  • ara::crypto::CryptoErrc::kProcessingNotStarted: Processing was not previously started using Start() [SWS_CRYPT_50158].
  • ara::crypto::CryptoErrc::kInsufficientCapacity: Output buffer out is sized too small [SWS_CRYPT_50158].
  • ara::crypto::CryptoErrc::kInvalidInputSize: The size of the passed input buffer is invalid [SWS_CRYPT_50158].
  • ara::crypto::CryptoErrc::kUnsupported: Stream processing is not supported by the context [SWS_CRYPT_50158].

This usage note was generated automatically based on the specification.

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

Parameter (in)

ParameterBeschreibung
inan input data buffer containing a part of the ciphertext

Parameter (out)

ParameterBeschreibung
outan output data buffer that the decrypted data will be written into. 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
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_50158
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50158@rel:R25-11#ad98aa1d
Content hash
ad98aa1d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50158
Status: valid/unmigrated Version: rel:R25-11#ad98aa1d 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_50158@rel:R25-11#ad98aa1d
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_50156] Upstream: RS_CRYPTO_02201

using Sptr = std::shared_ptr<DecryptorPrivateCtx>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/decryptor_private_ctx.h"
Scopeclass ara::crypto::cryp::DecryptorPrivateCtx
SymbolSptr

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

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