DEENESPTFRRUARHIKOZHNL

classe ara::crypto::cryp::SymmetricCipherCtx

[SWS_CRYPT_50136] Upstream: RS_CRYPTO_02201

class SymmetricCipherCtx :           public CryptoContext {...};

Interface for Symmetric Cipher Operations.

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

Guia do utilizadorGERADO POR IA

Serve como interface para operações de criptografia e descriptografia simétrica em fluxos de dados ou chamadas individuais.
GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 0261b663ca0d Procedência Perguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

Serve como interface para operações de criptografia e descriptografia simétrica em fluxos de dados ou chamadas individuais.

A classe ara::crypto::cryp::SymmetricCipherCtx serve como uma interface thread-safe para operações de criptografia e descriptografia simétrica em AUTOSAR Adaptive [SWS_CRYPT_50044]. Após a configuração de uma chave via SetKey(), os dados podem ser processados em uma única chamada ou passo a passo em um ciclo de streaming composto por Start(), Update() e Finish() [SWS_CRYPT_50138], [SWS_CRYPT_50139]. Todos os métodos são especificados como noexcept e sinalizam erros, como falta de inicialização ou buffers muito pequenos, via ara::core::Result [SWS_CRYPT_50140].

Contexto

A interface ara::crypto::cryp::SymmetricCipherCtx encapsula transformações criptográficas simétricas, que abrangem operações de criptografia e descriptografia. Dentro da arquitetura criptográfica, a classe atua como contexto de execução para algoritmos simétricos e coopera com objetos de chave e buffers de memória. Para a configuração da chave criptográfica, a classe interage diretamente com chaves voláteis por meio de SymmetricKey [SWS_CRYPT_50138] ou com chaves gerenciadas de forma persistente ou isolada via KeySlot [SWS_CRYPT_50043]. Textos simples e cifrados a serem processados, bem como vetores de inicialização (IV), são passados e recebidos por meio de áreas de memória do tipo ReadOnlyMemRegion e ReadWriteMemRegion [SWS_CRYPT_50048], [SWS_CRYPT_50049].

Ciclo de vida

O ciclo de vida e a posse da interface são controlados primariamente por meio do alias de smart pointer tipado Sptr (std::shared_ptr<SymmetricCipherCtx>) [SWS_CRYPT_50137]. A disponibilização de uma instância concreta deve ocorrer na prática por meio de um método de fábrica criptográfico superior (interpretação), visto que a própria definição da interface não apresenta funções de criação. Pergunta Q-5b5f5ffdf964c91f (aberta)

Após a instanciação, o contexto passa por várias fases operacionais:

  • Não inicializado: imediatamente após a instanciação, nenhuma chave está atribuída ao contexto. Qualquer chamada de processamento nesta fase resulta no erro CryptoErrc::kUninitializedContext [SWS_CRYPT_50044], [SWS_CRYPT_50047].
  • Inicializado / Chave vinculada: ao chamar SetKey() com um SymmetricKey [SWS_CRYPT_50138] ou KeySlot [SWS_CRYPT_50043], o contexto fica pronto para uso. A partir desse estado, podem ser executadas operações sem estado de chamada única ou pode ser iniciado um processo de streaming com estado.
  • Processamento em streaming: uma chamada de Start() inicia uma transformação passo a passo [SWS_CRYPT_50044], [SWS_CRYPT_23625]. Nesta fase, os dados podem ser transformados via Update() [SWS_CRYPT_50139] e a posição pode ser modificada via Seek() [SWS_CRYPT_23613]. O estado de streaming é encerrado regularmente por Finish() [SWS_CRYPT_50045] ou FinishEncrypt() [SWS_CRYPT_23618], ou descartado prematuramente via Cancel() [SWS_CRYPT_50046]. Em seguida, o contexto retorna ao estado básico inicializado.

Todos os métodos de SymmetricCipherCtx são declarados como noexcept, asseguram segurança contra exceções ("exception safe") e são especificados como thread-safe ("thread-safe") para acesso concorrente [SWS_CRYPT_50044], [SWS_CRYPT_50139].

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

Diagrama de estados: ciclo de vida e transições de estado do contexto de cifra simétrica. Fontes: [SWS_CRYPT_50138], [SWS_CRYPT_50044], [SWS_CRYPT_50139], [SWS_CRYPT_50045], [SWS_CRYPT_50046]

Caminho de utilização

Antes da transformação de dados propriamente dita, recomenda-se determinar os tamanhos de buffer e chunk exigidos. Por meio de GetMinimumChunkSize() [SWS_CRYPT_50144] e GetMaximumChunkSize() [SWS_CRYPT_50050], podem ser determinados os limites permitidos para blocos de entrada. Caso sejam necessários vetores de inicialização, seus limites de comprimento podem ser consultados por meio de GetMinimumInputIvSize() [SWS_CRYPT_50141], GetMaximumInputIvSize() [SWS_CRYPT_50142] ou GetOutputIvSize() [SWS_CRYPT_50143]. O tamanho máximo de buffer de destino necessário para uma operação é calculado por meio de GetRequiredOutputBufferSize() [SWS_CRYPT_50140].

Para a criptografia ou descriptografia passo a passo em fluxo, aplica-se o seguinte fluxo padrão:

  1. Configurar chave: vinculação da chave criptográfica ao contexto via SetKey() [SWS_CRYPT_50138].
  2. Iniciar transformação: chamada de Start() especificando a direção da transformação (criptografia ou descriptografia) e IV opcional [SWS_CRYPT_23625] ou sem IV [SWS_CRYPT_50044].
  3. Transformar blocos de dados: chamada repetida de Update() para a passagem passo a passo de dados de entrada e extração dos dados de saída [SWS_CRYPT_50139]. Conforme necessário, é possível navegar dentro do fluxo de dados via Seek() [SWS_CRYPT_23613].
  4. Conclusão: finalização via Finish() [SWS_CRYPT_50045] ou via FinishEncrypt(), caso o IV gerado pelo contexto deva ser retornado [SWS_CRYPT_23618].

Como alternativa a esse padrão de streaming, a interface suporta chamadas síncronas individuais. Se todo o payload estiver disponível, a operação pode ser executada diretamente por meio de ProcessSingleCall() [SWS_CRYPT_50047], ProcessSingleCallWithInputIv() [SWS_CRYPT_50048] ou, para geração de IV própria do contexto, via EncryptSingleCallWithOutputIv() [SWS_CRYPT_50049].

Cifragem simétrica de fluxo de dadosAplicaçãoSymmetricCipherCtxSetKey(key)Result<void>Start(kEncrypt, iv)Result<void>loopEnquanto houver blocos disponíveisUpdate(in, out)Result<size_t>FinishEncrypt(in, out, ivOut)Result<size_t>

Diagrama de sequência: sequência típica de chamadas de uma criptografia em streaming. Fontes: [SWS_CRYPT_50138], [SWS_CRYPT_23625], [SWS_CRYPT_50139], [SWS_CRYPT_23618]

Cenários de erro

Métodos da classe sinalizam erros por meio de ara::core::Result com códigos do domínio de erros ara::crypto::CryptoErrc. As principais condições de erro incluem:

  • CryptoErrc::kUninitializedContext: ocorre quando chamadas de processamento como Start() [SWS_CRYPT_50044], rotinas de chamada única [SWS_CRYPT_50047] ou GetRequiredOutputBufferSize() [SWS_CRYPT_50140] são chamadas antes que uma chave tenha sido configurada via SetKey().
  • CryptoErrc::kProcessingNotStarted: é disparado quando funções de streaming como Update() [SWS_CRYPT_50139], Finish() [SWS_CRYPT_50045], FinishEncrypt() [SWS_CRYPT_23618], Seek() [SWS_CRYPT_23613] ou Cancel() [SWS_CRYPT_50046] são executadas sem uma chamada prévia bem-sucedida a Start().
  • CryptoErrc::kInsufficientCapacity: o buffer de destino fornecido para dados ou IVs é menor que a capacidade mínima necessária [SWS_CRYPT_50139], [SWS_CRYPT_50049].
  • CryptoErrc::kUsageViolation e CryptoErrc::kIncompatibleObject: o tipo de chave passado é inadequado para a transformação ou as regras de uso armazenadas na chave proíbem a operação (por exemplo, ausência de kAllowDataEncryption ou kAllowDataDecryption) [SWS_CRYPT_50044], [SWS_CRYPT_50047].
  • CryptoErrc::kEmptyKeySlot e CryptoErrc::kBusyResource: indica que um KeySlot configurado não contém chave em tempo de execução ou que um recurso necessário para a operação criptográfica está bloqueado [SWS_CRYPT_50048], [SWS_CRYPT_50049].
  • CryptoErrc::kUnsupported: é retornado quando um modo de operação (como processamento em fluxo, chamada única ou Seek()) não é suportado pelo contexto ou algoritmo selecionado [SWS_CRYPT_23613], [SWS_CRYPT_50047].

Este guia foi elaborado por um assistente de IA com base nas especificações.

Mapa de membros

Diagrama de classes

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

G nara__crypto__cryp__SymmetricCipherCtx167 SymmetricCipherCtx + Cancel() + EncryptSingleCallWithOutputIv() + Finish() + FinishEncrypt() + GetMaximumChunkSize() + GetMaximumInputIvSize() + GetMinimumChunkSize() + GetMinimumInputIvSize() + GetOutputIvSize() + GetRequiredOutputBufferSize() + ProcessSingleCall() + ProcessSingleCallWithInputIv() + Seek() + SetKey() + Start() + Update() nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__SymmetricCipherCtx167->nara__crypto__cryp__CryptoContext85

Vista de detalhes

Selecione uma entrada no índice.

Métodos

Cancel função

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

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

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

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

Finalize the encryption/decryption without returning an IV.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Sobrecargas SetKey 2
virtual ara::core::Result< void > SetKey (KeySlot::Sptr keySlot) noexcept=0; SWS_CRYPT_50043
virtual ara::core::Result< void > SetKey (SymmetricKey::Sptr key) noexcept=0; SWS_CRYPT_50138
Start função 2

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

Sobrecargas Start 2
virtual ara::core::Result< void > Start (CryptoTransform transform Direction, ReadOnlyMemRegion iv) noexcept=0; SWS_CRYPT_23625
virtual ara::core::Result< void > Start (CryptoTransform transform Direction) noexcept=0; SWS_CRYPT_50044
Update função

Encrypt or decrypt a data buffer.

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

Aliases de tipo

Sptr alias de tipo

Smart pointer of the interface.

Documentação dos métodos

função Cancel [SWS_CRYPT_50046] Upstream: RS_CRYPTO_02302

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

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

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 0bea3f0e1d0d Procedência Perguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método síncrono Cancel() da classe ara::crypto::cryp::SymmetricCipherCtx destina-se ao cancelamento prematuro de uma operação de streaming em andamento, previamente iniciada com Start() e ainda não concluída [SWS_CRYPT_50046]. A interface é declarada sem parâmetros em ara/crypto/cryp/symmetric_cipher_ctx.h e retorna um ara::core::Result<void> vazio em caso de execução bem-sucedida [SWS_CRYPT_50046].

Se o processamento de dados não tiver sido iniciado previamente pela chamada de Start(), a operação falha com o código de erro específico ara::crypto::CryptoErrc::kProcessingNotStarted e semântica de rollback [SWS_CRYPT_50046]. Para o contexto de chamada, a especificação garante segurança de threads (thread-safe) bem como segurança contra exceções (exception safe) com declaração noexcept [SWS_CRYPT_50046]. Interpretação: devido à semântica de rollback, o objeto deve retornar a um estado inicial pronto após um cancelamento. Pergunta Q-b6deb8db5367acc5 (aberta)

Este padrão funcional está definido de forma consistente em todos os contextos de streaming criptográfico no AUTOSAR Adaptive. Assinaturas e semânticas de erro idênticas aplicam-se às classes de contexto VerifierPublicCtx ([SWS_CRYPT_50023]), MessageAuthnCodeCtx ([SWS_CRYPT_50027]), SignerPrivateCtx ([SWS_CRYPT_50041]), HashFunctionCtx ([SWS_CRYPT_50058]), DecryptorPrivateCtx ([SWS_CRYPT_50069]), AuthCipherCtx ([SWS_CRYPT_50077]) e EncryptorPublicCtx ([SWS_CRYPT_50089]).

Este texto foi curado por uma IA e baseia-se na especificação AUTOSAR Adaptive R25-11.

Guia do implementador em breve (complexidade I1)

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

Rückgabewert

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

Fehler

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

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

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

função EncryptSingleCallWithOutputIv [SWS_CRYPT_50049] Upstream: RS_CRYPTO_02302

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

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

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 9c4059afbb11 Procedência Perguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

Utilização e tratamento de buffers

O método síncrono EncryptSingleCallWithOutputIv executa uma cifragem simétrica numa única chamada e retorna o vetor de inicialização gerado pelo contexto através do buffer ivOut [SWS_CRYPT_50049]. Os dados de entrada são passados através de in, enquanto out recebe os dados cifrados [SWS_CRYPT_50049]. Em caso de execução bem-sucedida, o resultado ara::core::Result<std::size_t> fornece o tamanho real dos dados de saída gerados, o qual pode ser inferior à capacidade total de out [SWS_CRYPT_50049]. Se o algoritmo selecionado não necessitar de vetor de inicialização, nenhuns dados são escritos em ivOut [SWS_CRYPT_50049].

Interação e pré-condições

Antes da chamada, o contexto tem de ser inicializado através de uma chave adequada [SWS_CRYPT_50049]. Para assegurar uma capacidade suficiente do buffer ivOut, o comprimento de IV necessário pode ser determinado previamente através de GetOutputIvSize() [SWS_CRYPT_50143]. Caso seja adicionalmente necessária uma autenticação com cálculo de tag, ara::crypto::cryp::AuthCipherCtx oferece a contraparte correspondente [SWS_CRYPT_50080].

Tratamento de erros e simultaneidade

A interface está especificada como thread-safe, bem como segura contra exceções ("exception safe"), e aplica uma semântica de rollback em caso de erros [SWS_CRYPT_50049]. Interpretação: esta semântica de rollback presumivelmente deverá garantir que, na ocorrência de erros, o estado do contexto permaneça intacto e nenhuns dados incompletos permaneçam como válidos no buffer. Pergunta Q-841087731518d866 (aberta) Entre os erros relevantes contam-se:

  • UninitializedContext: ainda não foi atribuída nenhuma chave ao contexto [SWS_CRYPT_50049].
  • ara::crypto::CryptoErrc::kInsufficientCapacity: a capacidade de out ou de ivOut é insuficiente [SWS_CRYPT_50049].
  • ara::crypto::CryptoErrc::kUnsupported: a cifragem em chamada única não é suportada ou o algoritmo força a especificação de um IV de entrada [SWS_CRYPT_50049].
  • ara::crypto::CryptoErrc::kUsageViolation ou ara::crypto::CryptoErrc::kIncompatibleObject: o tipo de chave não é adequado à transformação ou a utilização da chave não permite a cifragem de dados [SWS_CRYPT_50049].

Esta nota de utilização foi gerada por uma IA com base nas especificações de AUTOSAR Adaptive.

Guia do implementador em breve (complexidade I2)

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

Parameter (in)

ParameterBeschreibung
inan input data buffer containing the ciphertext or plaintext

Parameter (out)

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

Rückgabewert

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

Fehler

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

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

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

função Finish [SWS_CRYPT_50045] Upstream: RS_CRYPTO_02302

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

Finalize the encryption/decryption without returning an IV.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 041cbaba2731 Procedência Perguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método síncrono Finish finaliza uma cifragem ou decifragem simétrica dentro de ara::crypto::cryp::SymmetricCipherCtx sem retorno de um vetor de inicialização ([SWS_CRYPT_50045]). Ele processa a última secção de dados do buffer de entrada in (ReadOnlyMemRegion) e escreve os dados resultantes no buffer de saída out (ReadWriteMemRegion) ([SWS_CRYPT_50045]). O tamanho de buffer necessário para o efeito pode ser consultado previamente através de GetRequiredOutputBufferSize() ([SWS_CRYPT_50045]). O valor de retorno do tipo ara::core::Result<std::size_t> fornece, em caso de sucesso, o número exato de bytes escritos, o qual pode ser inferior à capacidade total de out ([SWS_CRYPT_50045]).

Tratamento de erros

Em caso de erro, o método fornece um ara::core::Result com códigos de erro específicos ([SWS_CRYPT_50045]):

  • ProcessingNotStarted: o processamento de dados não foi iniciado previamente por Start() ([SWS_CRYPT_50045]).
  • ara::crypto::CryptoErrc::kInsufficientCapacity: o buffer de saída out é demasiado pequeno ([SWS_CRYPT_50045]).
  • ara::crypto::CryptoErrc::kInvalidInputSize: o tamanho dos dados de entrada não pode ser processado ([SWS_CRYPT_50045]).
  • ara::crypto::CryptoErrc::kInvalidArgument: os dados de entrada passados são inválidos ([SWS_CRYPT_50045]).
  • ara::crypto::CryptoErrc::kUnsupported: o processamento de stream não é suportado pelo contexto atual ([SWS_CRYPT_50045]).

Se ocorrer um dos erros CryptoErrc, aplica-se uma semântica de rollback ([SWS_CRYPT_50045]).

Concorrência e interação

A operação está definida como thread-safe e exception safe ([SWS_CRYPT_50045]). Antes da chamada, a transformação tem de ter sido obrigatoriamente iniciada por Start() ([SWS_CRYPT_50045]). O tamanho de entrada máximo permitido para chamadas individuais de Finish() pode ser determinado através de GetMaximumChunkSize() ([SWS_CRYPT_50050]). Após a conclusão, a execução da transformação presumivelmente deverá estar terminada e, para operações adicionais, presumivelmente tornar-se-á necessária uma nova chamada de Start(). Pergunta Q-c4ffc8028e8f522b (aberta)

Este texto foi gerado por uma IA com base na especificação AUTOSAR R25-11.

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

Parameter (in)

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

Parameter (out)

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

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ProcessingNotStartedif data processing was not started by a call of the Start() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of the input buffer cannot be processed
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the provided input data contains invalid data
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if stream processing is not supported by the context or

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

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

função FinishEncrypt [SWS_CRYPT_23618] Upstream: RS_CRYPTO_02302

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

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

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: c0e4f2ad1bdc Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método FinishEncrypt conclui uma operação de criptografia e retorna o vetor de inicialização (IV) gerado pelo contexto [SWS_CRYPT_23618]. Ele processa o buffer de dados de entrada final in e grava os dados resultantes no buffer de saída out, bem como o IV em ivOut. Como valor de retorno, ele fornece um ara::core::Result<std::size_t> com o tamanho real dos dados de saída gravados, o qual pode ser menor do que a capacidade de out [SWS_CRYPT_23618].

Para uma execução sem erros, as dimensões dos buffers e o estado do contexto devem ser ajustados previamente:

  • O tamanho de buffer necessário para out pode ser determinado via [SWS_CRYPT_50140] com o parâmetro isFinal = true definido. Se out for dimensionado pequeno demais, a chamada falhará com CryptoErrc::kInsufficientCapacity [SWS_CRYPT_23618].
  • O tamanho esperado para ivOut pode ser consultado por meio de [SWS_CRYPT_50143].
  • O tamanho de entrada de in deve estar entre os limites mínimo e máximo definidos por [SWS_CRYPT_50144] e [SWS_CRYPT_50050]; caso contrário, CryptoErrc::kInvalidInputSize será retornado [SWS_CRYPT_23618].

Se o processamento de dados não tiver sido iniciado previamente por Start(), o método reportará CryptoErrc::kProcessingNotStarted [SWS_CRYPT_23618]. Se o buffer de entrada contiver dados inválidos, segue-se CryptoErrc::kInvalidArgument [SWS_CRYPT_23618]. O erro CryptoErrc::kUnsupported ocorre se o processamento em stream não for suportado, se o contexto não utilizar um IV ou se um IV já tiver sido passado em Start() [SWS_CRYPT_23618]. Todos os erros possuem semântica de rollback [SWS_CRYPT_23618]. De acordo com a especificação, a chamada é segura para threads e segura contra exceções (noexcept) [SWS_CRYPT_23618].

Esta nota de uso foi gerada automaticamente com base no payload do AUTOSAR.

Guia do implementador em breve (complexidade I2)

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

Parameter (in)

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

Parameter (out)

ParameterBeschreibung
outan output data buffer that contains encrypted or decrypted data
ivOutan output data buffer that contains the IV

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_23618
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_23618@rel:R25-11#528c08b9
Content hash
528c08b9
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_23618
Status: valid/unmigrated Version: rel:R25-11#dcc35b13 Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_23618@rel:R25-11#dcc35b13
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#c50d30f82026-09-30
  • R19-11rel:R19-11#c41ea37b2026-10-14
  • R20-11rel:R20-11#06f18fb12026-10-14
  • R21-11rel:R21-11#3725bc5a2026-10-14
  • R22-11rel:R22-11#724878ec2026-10-14
  • R23-11rel:R23-11#8e98bdf02026-10-14
  • R24-11rel:R24-11#1d9181d92026-10-14
  • R25-11rel:R25-11#dcc35b132026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

função GetMaximumChunkSize [SWS_CRYPT_50050] Upstream: RS_CRYPTO_02309

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

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

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

Rückgabewert

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

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

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

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

função GetMaximumInputIvSize [SWS_CRYPT_50142] Upstream: RS_CRYPTO_02309

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

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

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

Parameter (in)

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

Rückgabewert

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

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

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

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

função GetMinimumChunkSize [SWS_CRYPT_50144] Upstream: RS_CRYPTO_02309

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

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

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

Rückgabewert

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

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

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

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

função GetMinimumInputIvSize [SWS_CRYPT_50141] Upstream: RS_CRYPTO_02309

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

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

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

Parameter (in)

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

Rückgabewert

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

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

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

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

função GetOutputIvSize [SWS_CRYPT_50143] Upstream: RS_CRYPTO_02309

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

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

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

Rückgabewert

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

Fehler

FehlercodeBeschreibung
This function does not specify any standardized errors.

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

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

função GetRequiredOutputBufferSize [SWS_CRYPT_50140] Upstream: RS_CRYPTO_02302

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

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

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

Parameter (in)

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

Rückgabewert

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

Fehler

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

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

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

função ProcessSingleCall [SWS_CRYPT_50047] Upstream: RS_CRYPTO_02302

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

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

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 4a1fdc95f521 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método ProcessSingleCall executa uma cifragem ou decifragem numa única chamada síncrona sem vetor de inicialização (IV) ([SWS_CRYPT_50047]). Como parâmetros de entrada servem o buffer de dados in (ReadOnlyMemRegion) e o sentido de transformação transformDirection (CryptoTransform), enquanto o resultado é escrito no buffer out (ReadWriteMemRegion). Em caso de execução bem-sucedida, a função retorna um ara::core::Result<std::size_t> que contém o número de bytes escritos; este valor pode ser menor do que a capacidade total do buffer de saída.

No que diz respeito à concorrência e à segurança, o método está especificado como thread-safe e exception safe ([SWS_CRYPT_50047]). O tamanho de entrada processável de in está sujeito aos limites definidos pelo contexto, os quais podem ser consultados através de [SWS_CRYPT_50144] (GetMinimumChunkSize) e [SWS_CRYPT_50050] (GetMaximumChunkSize).

Todos os casos de erro seguem uma semântica de rollback ([SWS_CRYPT_50047]):

  • ara::crypto::CryptoErrc::kUninitializedContext: o contexto não foi inicializado previamente pela atribuição de uma chave.
  • ara::crypto::CryptoErrc::kUnsupported: o processamento em chamada única não é suportado ou a transformação exige a definição ou a leitura de um IV.
  • ara::crypto::CryptoErrc::kInsufficientCapacity: o buffer de saída out não disponibiliza capacidade suficiente.
  • ara::crypto::CryptoErrc::kInvalidInputSize: o tamanho de entrada não pode ser processado pelo contexto.
  • ara::crypto::CryptoErrc::kUsageViolation: a utilização da chave não cobre a operação solicitada (kAllowDataEncryption ou kAllowDataDecryption).
  • ara::crypto::CryptoErrc::kIncompatibleObject, kEmptyKeySlot, kInvalidArgument ou kBusyResource: a chave é incompatível, o slot de chave está vazio, os dados de entrada são inválidos ou os recursos necessários estão ocupados.

Na interação com outras interfaces, a chamada requer um contexto completamente configurado; para cifras autenticadas com processamento de tag adicional, a interface alternativa [SWS_CRYPT_50078] está disponível em AuthCipherCtx.

Esta nota de utilização foi gerada automaticamente com base na especificação AUTOSAR.

Guia do implementador em breve (complexidade I2)

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

Parameter (in)

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

Parameter (out)

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

Rückgabewert

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

Fehler

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

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

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

função ProcessSingleCallWithInputIv [SWS_CRYPT_50048] Upstream: RS_CRYPTO_02302

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

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

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: f491c775eb62 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método ProcessSingleCallWithInputIv em ara::crypto::cryp::SymmetricCipherCtx executa uma cifragem ou decifragem simétrica de dados numa única chamada síncrona (single-call) [SWS_CRYPT_50048]. Neste processo, o vetor de inicialização utilizado para a transformação é passado explicitamente através do buffer de entrada iv.

Utilização e interação

Através de transformDirection, controla-se se os dados de in são cifrados ou decifrados. O resultado é escrito no buffer out. O ara::core::Result<std::size_t> retornado contém o número real de bytes escritos, o qual pode revelar-se inferior à capacidade total de out [SWS_CRYPT_50048].

Para o dimensionamento dos buffers, estão disponíveis funções auxiliares:

  • O tamanho de buffer necessário para out pode ser calculado previamente através de GetRequiredOutputBufferSize com o parâmetro isFinal = true [SWS_CRYPT_50140].
  • O comprimento permitido para iv pode ser determinado para o sentido de transformação selecionado através de GetMinimumInputIvSize [SWS_CRYPT_50141], bem como de GetMaximumInputIvSize [SWS_CRYPT_50142].
  • Se adicionalmente for necessária a geração ou verificação de uma tag de autenticação, deve utilizar-se ara::crypto::cryp::AuthCipherCtx::ProcessSingleCallWithInputIv em seu lugar [SWS_CRYPT_50079].

Tratamento de erros e simultaneidade

A operação está definida como thread-safe e exception safe [SWS_CRYPT_50048]. Todos os erros possuem semântica de rollback:

  • CryptoErrc::kUninitializedContext ou CryptoErrc::kEmptyKeySlot: nenhuma chave foi atribuída ao contexto ou o KeySlot está vazio [SWS_CRYPT_50048].
  • CryptoErrc::kUsageViolation: a chave não permite o sentido selecionado (falta kAllowDataEncryption ou kAllowDataDecryption) [SWS_CRYPT_50048].
  • CryptoErrc::kIncompatibleObject: o tipo de chave é incompatível com a transformação [SWS_CRYPT_50048].
  • CryptoErrc::kInsufficientCapacity: o buffer de saída out é demasiado pequeno [SWS_CRYPT_50048].
  • CryptoErrc::kInvalidInputSize ou CryptoErrc::kInvalidArgument: o tamanho do buffer ou o conteúdo de in são inválidos [SWS_CRYPT_50048].
  • CryptoErrc::kUnsupported: o processamento em chamada única ou os IVs de entrada não são suportados [SWS_CRYPT_50048].
  • CryptoErrc::kBusyResource: um recurso necessário está ocupado [SWS_CRYPT_50048].

Este texto foi criado por uma IA e serve de apoio na utilização do elemento de especificação.

Guia do implementador em breve (complexidade I2)

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

Parameter (in)

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

Parameter (out)

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

Rückgabewert

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

Fehler

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

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

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

função Seek [SWS_CRYPT_23613] Upstream: RS_CRYPTO_02304

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

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

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 2287fbd40f75 Procedência Perguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método Seek da interface ara::crypto::cryp::SymmetricCipherCtx define a posição do próximo byte a ser processado dentro de um fluxo de dados [SWS_CRYPT_23613]. Devido à ausência de tipos de retorno assíncronos, tais como futures, a chamada deve ocorrer de forma síncrona. Pergunta Q-fccf732722263f60 (aberta)

usar

O posicionamento é controlado através de dois parâmetros [SWS_CRYPT_23613]:

  • offset: Deslocamento de bytes no fluxo de dados, referenciado em relação ao início do fluxo ou à posição atual [SWS_CRYPT_23613].
  • fromBegin: Ponto de referência do posicionamento; true endereça o deslocamento a partir do início do fluxo, false relativamente à posição atual [SWS_CRYPT_23613].

A função é declarada como noexcept e retorna um ara::core::Result<void>, o qual sinaliza a conclusão bem-sucedida ou contém um objeto de erro ocorrido [SWS_CRYPT_23613].

Simultaneidade e restrições

De acordo com a especificação, Seek é classificado como seguro contra exceções (exception safe) e seguro para threads (thread-safe) [SWS_CRYPT_23613]. O pré-requisito para a execução é que o processamento de dados tenha sido iniciado previamente através da chamada de Start() [SWS_CRYPT_23613].

Tratamento de erros

Todos os casos de erro estão sujeitos a uma semântica de rollback definida (rollback_semantics), de modo que o estado interno permaneça consistente em caso de erros [SWS_CRYPT_23613]:

  • ara::crypto::CryptoErrc::kUnsupported: A operação de seek não é suportada pelo contexto criptográfico atual [SWS_CRYPT_23613].
  • ara::crypto::CryptoErrc::kProcessingNotStarted: O processamento de dados não foi iniciado previamente através de Start() [SWS_CRYPT_23613].
  • ara::crypto::CryptoErrc::kOutOfBounds: O deslocamento resultante é pequeno demais ou grande demais para o fluxo de dados [SWS_CRYPT_23613].
  • ara::crypto::CryptoErrc::kInvalidArgument: O offset resultante não está alinhado a um limite de bloco, embora o contexto exija alinhamento de bloco [SWS_CRYPT_23613].

Este texto foi gerado por uma IA.

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

Parameter (in)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_23613
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_23613@rel:R25-11#05fe345b
Content hash
05fe345b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_23613
Status: valid/unmigrated Version: rel:R25-11#383a800f Versionshistorie & Revisions (1 transition, 8 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_23613@rel:R25-11#383a800f
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#6a4153822026-09-30
  • R19-11rel:R19-11#9c63158a2026-10-14
  • R20-11rel:R20-11#36a48d2b2026-10-14
  • R21-11rel:R21-11#f3b5692c2026-10-14
  • R22-11rel:R22-11#a11f983a2026-10-14
  • R23-11rel:R23-11#10ff1b922026-10-14
  • R24-11rel:R24-11#23dbf8e42026-10-14
  • R25-11rel:R25-11#383a800f2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

função SetKey [SWS_CRYPT_50043] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

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

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

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 72406ca015ea Procedência Perguntas em aberto (1)
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método puramente virtual SetKey configura a instância de ara::crypto::cryp::SymmetricCipherCtx de modo a que utilize a chave proveniente do KeySlot passado para operações criptográficas futuras [SWS_CRYPT_50043].

Utilização e contexto de chamada

A chamada ocorre de forma síncrona e recebe como parâmetro keySlot um KeySlot::Sptr que contém um SymmetricKey [SWS_CRYPT_50043]. O valor de retorno é um ara::core::Result<void>, o qual sinaliza o sucesso ou, em caso de erro, transporta um código de erro [SWS_CRYPT_50043]. A configuração faz com que a chave guardada no slot apenas seja utilizada no momento em que a cifragem ou decifragem propriamente dita for iniciada [SWS_CRYPT_50043].

Tratamento de erros

Em caso de erro, nenhuma exceção é lançada (o método está especificado como noexcept e exception safe), sendo retornado um código de erro com semântica de rollback [SWS_CRYPT_50043]:

  • ara::crypto::CryptoErrc::kIncompatibleObject: o KeySlot passado é incompatível com o contexto de cifragem [SWS_CRYPT_50043].
  • ara::crypto::CryptoErrc::kUnsupported: a implementação do contexto suporta exclusivamente a definição de uma chave direta (como SymmetricKey) e nenhuma atribuição através de um KeySlot [SWS_CRYPT_50043].

Concorrência e interação

O método está identificado como thread-safe [SWS_CRYPT_50043]. Interpretação: a leitura real do material de chave presumivelmente só deverá ocorrer ao iniciar a cifragem ou decifragem, de modo que o slot deve permanecer consistente até ao início da transformação. O conceito de configurar contextos através de KeySlot::Sptr em vez de objetos de chave diretos corresponde ao padrão uniforme de contextos criptográficos relacionados, entre os quais KeyDerivationFunctionCtx [SWS_CRYPT_50010], MessageAuthnCodeCtx [SWS_CRYPT_50026], SymmetricKeyWrapperCtx [SWS_CRYPT_50034], bem como VerifierPublicCtx [SWS_CRYPT_50018]. Pergunta Q-799125800ab0f93c (aberta)

Este texto foi gerado por uma IA com base na especificação AUTOSAR Adaptive R25-11.

Guia do implementador em breve (complexidade I2)

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

Parameter (in)

ParameterBeschreibung
keySlota keyslot containing a SymmetricKey.

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the provided keyslot is incompatible with this context
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context only supports setting a SymmetricKey

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

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

função SetKey [SWS_CRYPT_50138] Upstream: RS_CRYPTO_02001, RS_CRYPTO_02003

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

Configure the context to use the provided symmetric key.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 7e5086bb8751 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método SetKey serve para configurar uma instância de ara::crypto::cryp::SymmetricCipherCtx para a utilização de uma chave simétrica passada [SWS_CRYPT_50138]. Como parâmetro de entrada, a função recebe a chave a utilizar como smart pointer key do tipo SymmetricKey::Sptr. A chamada efetua-se de forma síncrona e retorna um ara::core::Result<void>, que está vazio em caso de atribuição bem-sucedida ou disponibiliza um código de erro em caso de falha [SWS_CRYPT_50138]. A declaração está incluída através do cabeçalho ara/crypto/cryp/symmetric_cipher_ctx.h.

Tratamento de erros

O tratamento de erros garante semântica de rollback, de modo que o contexto permaneça no seu estado anterior em caso de falha da atribuição [SWS_CRYPT_50138]. Estão definidos dois erros específicos:

  • ara::crypto::CryptoErrc::kUnsupported: Ocorre quando o contexto suporta exclusivamente a atribuição de uma chave através de um KeySlot [SWS_CRYPT_50138].
  • ara::crypto::CryptoErrc::kIncompatibleObject: É retornado quando o objeto de chave passado não é compatível com o contexto [SWS_CRYPT_50138].

Concorrência e interação

A função virtual está definida como noexcept, é considerada exception-safe e está implementada como thread-safe de acordo com a especificação [SWS_CRYPT_50138]. Interfaces semelhantes para a atribuição de SymmetricKey::Sptr encontram-se em contextos criptográficos relacionados, como AuthCipherCtx [SWS_CRYPT_23911] bem como SymmetricKeyWrapperCtx [SWS_CRYPT_24018]. A interação com contentores de chave é também ilustrada por classes de contexto que, em alternativa, aceitam KeySlot::Sptr [SWS_CRYPT_50034].

Esta nota de uso foi gerada automaticamente com base na especificação AUTOSAR R25-11.

Guia do implementador em breve (complexidade I2)

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

Parameter (in)

ParameterBeschreibung
keythe SymmetricKey to be used.

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if the context only supports setting a KeySlot
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the provided key object is incompatible with this context

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

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

função Start [SWS_CRYPT_23625] Upstream: RS_CRYPTO_02302

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

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

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 33beff56357b Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método Start inicializa o contexto ara::crypto::cryp::SymmetricCipherCtx para uma nova operação síncrona de cifragem ou decifragem e define o respectivo vetor de inicialização (IV) ou valor de nonce [SWS_CRYPT_23625]. A direção de transformação é especificada através do parâmetro transformDirection, enquanto iv disponibiliza o vetor de inicialização como ReadOnlyMemRegion [SWS_CRYPT_23625]. O tamanho permitido do buffer pode ser consultado previamente através dos métodos GetMinimumInputIvSize() e GetMaximumInputIvSize() [SWS_CRYPT_23625]. A chamada retorna um ara::core::Result<void>, é declarada como noexcept e é considerada segura contra exceções (exception safe) [SWS_CRYPT_23625].

Tratamento de erros

Em caso de erro, é retornado um código de erro com semântica de rollback [SWS_CRYPT_23625]:

  • ara::crypto::CryptoErrc::kUninitializedContext: O contexto não foi inicializado previamente através da atribuição de uma chave [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kInvalidInputSize: O tamanho de IV fornecido não é suportado [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kUnsupported: A definição de um IV na direção de transformação especificada ou o processamento em fluxo não é suportado pelo contexto [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kEmptyKeySlot: Um KeySlot configurado está atualmente vazio [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kUsageViolation: O uso permitido da chave não inclui kAllowDataEncryption para a cifragem ou kAllowDataDecryption para a decifragem [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kIncompatibleObject: O tipo de chave é incompatível com a transformação ou com a direção de transformação [SWS_CRYPT_23625].
  • ara::crypto::CryptoErrc::kBusyResource: um recurso necessário está ocupado [SWS_CRYPT_23625].

Concorrência e interação

A função está especificada como segura para threads (thread-safe) [SWS_CRYPT_23625]. No fluxo de um processamento em stream, Start atua como passo iniciador, ao qual se seguem, por exemplo, operações de posicionamento via Seek [SWS_CRYPT_23613] ou a finalização através de FinishEncrypt [SWS_CRYPT_23618].

Este texto foi gerado por um sistema de IA com base na especificação AUTOSAR R25-11.

Guia do implementador em breve (complexidade I1)

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

Parameter (in)

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

Rückgabewert

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

Fehler

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

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

Record
AUTOSAR/AP/record/SWS_CRYPT_23625
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_23625@rel:R25-11#4d691ff3
Content hash
4d691ff3
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_23625
Status: valid/unmigrated Version: rel:R25-11#608e87fd Versionshistorie & Revisions (1 transition, 7 revision)
Current State
valid/unmigrated
Reason
mechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record
Campaign
2026-08-13-status-backfill
Active Version
AUTOSAR/AP/record/SWS_CRYPT_23625@rel:R25-11#608e87fd
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#a536a6ca2026-09-30
  • R20-11rel:R20-11#6996665a2026-10-14
  • R21-11rel:R21-11#c2b5cf1e2026-10-14
  • R22-11rel:R22-11#25b4dab42026-10-14
  • R23-11rel:R23-11#e01d837d2026-10-14
  • R24-11rel:R24-11#26e85c6c2026-10-14
  • R25-11rel:R25-11#608e87fd2026-10-14 active
DateActorTransitionReason / RationaleCampaign
2026-08-13toolnone → valid/unmigratedmechanically backfilled by migriere_status_backfill.py -- no per-field curation history exists yet for this record2026-08-13-status-backfill

função Start [SWS_CRYPT_50044] Upstream: RS_CRYPTO_02302

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

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

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 09affb4844e4 Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

usar

O método Start inicializa uma instância de ara::crypto::cryp::SymmetricCipherCtx de forma síncrona para uma criptografia ou descriptografia pendente ([SWS_CRYPT_50044]). Ele é utilizado quando não é necessário nenhum vetor de inicialização (IV) para a direção de transformação pré-definida através do parâmetro transformDirection ou quando o próprio contexto o gera ([SWS_CRYPT_50044]). Se, pelo contrário, o contexto exigir um IV explícito na direção selecionada, a sobrecarga com o parâmetro IV deve ser chamada ([SWS_CRYPT_23625]).

Tratamento de erros e simultaneidade

A operação é especificada como segura para threads e segura contra exceções ([SWS_CRYPT_50044]). Em caso de erro, a função retorna um ara::core::Result<void> com semântica de rollback ([SWS_CRYPT_50044]). Causas de erro relevantes são:

  • ara::crypto::CryptoErrc::kUninitializedContext: Nenhuma chave foi atribuída previamente ao contexto ([SWS_CRYPT_50044]).
  • ara::crypto::CryptoErrc::kUnsupported: O processamento de stream não é suportado ou a operação exige obrigatoriamente a definição de um IV nessa direção ([SWS_CRYPT_50044]).
  • ara::crypto::CryptoErrc::kUsageViolation: A chave não possui a permissão necessária kAllowDataEncryption ou kAllowDataDecryption ([SWS_CRYPT_50044]).
  • ara::crypto::CryptoErrc::kIncompatibleObject ou ara::crypto::CryptoErrc::kEmptyKeySlot: O tipo de chave não corresponde à transformação ou o espaço de chave configurado está vazio ([SWS_CRYPT_50044]).
  • ara::crypto::CryptoErrc::kBusyResource: Um recurso necessário está ocupado no momento ([SWS_CRYPT_50044]).

Interação

Após a inicialização bem-sucedida, o fluxo de dados pode ser posicionado através de Seek, se necessário ([SWS_CRYPT_23613]). Se o IV tiver sido definido pelo próprio contexto, este será entregue ao chamador ao final da criptografia através de FinishEncrypt ([SWS_CRYPT_23618]).

Esta nota de uso foi criada de forma automatizada com base na especificação AUTOSAR R25-11.

Guia do implementador em breve (complexidade I1)

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

Parameter (in)

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

Rückgabewert

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

Fehler

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

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

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

função Update [SWS_CRYPT_50139] Upstream: RS_CRYPTO_02302

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

Encrypt or decrypt a data buffer.

GERADO POR IA não revisado Modelo: gemini-3.8-flash-medium · Esforço: medium · Temperatura: não controlável · Prompt: 5cb4a9bba31d Procedência
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

O método síncrono Update() serve em ara::crypto::cryp::SymmetricCipherCtx para encriptar ou desencriptar passo a passo fluxos de dados parciais [SWS_CRYPT_50139]. Processa um buffer de entrada in (tipo ReadOnlyMemRegion) com texto em claro ou texto cifrado e escreve os dados transformados no buffer de saída out (tipo ReadWriteMemRegion) [SWS_CRYPT_50139]. Em caso de sucesso, o valor de retorno ara::core::Result<std::size_t> fornece o número exato de bytes efetivamente escritos em out, que pode ser inferior à capacidade total do buffer de destino [SWS_CRYPT_50139].

Aplicam-se à chamada pré-condições definidas e regras de buffer:

  • Ordem de execução: O processamento de dados tem de ter sido obrigatoriamente iniciado previamente com o método Start(); caso contrário, a chamada falha com ara::crypto::CryptoErrc::kProcessingNotStarted [SWS_CRYPT_50139].
  • Dimensionamento do buffer: O tamanho máximo de entrada permitido por chamada individual pode ser determinado através de GetMaximumChunkSize() [SWS_CRYPT_50050]; o método responde a tamanhos de buffer inválidos com ara::crypto::CryptoErrc::kInvalidInputSize [SWS_CRYPT_50139]. O buffer de saída necessário pode ser consultado através de GetRequiredOutputBufferSize() [SWS_CRYPT_50139]; um buffer demasiado pequeno leva a ara::crypto::CryptoErrc::kInsufficientCapacity [SWS_CRYPT_50139].
  • Suporte de streaming: Se o contexto concreto não suportar processamento de stream contínuo, a chamada falha com ara::crypto::CryptoErrc::kUnsupported [SWS_CRYPT_50139].

A interface está especificada como thread-safe e exception safe e garante semântica de rollback em qualquer erro [SWS_CRYPT_50139]. No ciclo de processamento, interage com GetMaximumChunkSize() bem como com operações de finalização como Finish() ou FinishEncrypt() [SWS_CRYPT_50050].

Esta nota de uso foi gerada automaticamente com base na especificação AUTOSAR Adaptive R25-11.

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

Parameter (in)

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

Parameter (out)

ParameterBeschreibung
outan output data buffer that the encrypted or decrypted data will be written into. The required size of this buffer can be queried using GetRequiredOutputBufferSize()

Rückgabewert

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

Fehler

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

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

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

Documentação dos aliases de tipo

alias de tipo Sptr [SWS_CRYPT_50137] Upstream: RS_CRYPTO_02201

using Sptr = std::shared_ptr<SymmetricCipherCtx>;

Smart pointer of the interface.

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

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

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