DEENESPTFRRUARHIKOZHNL

clase ara::crypto::cryp::HashFunctionCtx

[SWS_CRYPT_21100] Upstream: RS_CRYPTO_02205

class HashFunctionCtx :           public CryptoContext {...};

Hash function interface.

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

Guía del usuarioGENERADO POR IA

Calcula valores hash criptográficos sobre flujos de datos continuos o bloques de memoria individuales.
GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: bf2cec48587e Procedencia Preguntas abiertas (1)
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

Calcula valores hash criptográficos sobre flujos de datos continuos o bloques de memoria individuales.

La clase ara::crypto::cryp::HashFunctionCtx proporciona la interfaz para el cálculo de valores hash criptográficos sobre bloques de memoria y flujos de datos ([SWS_CRYPT_50060]). Las operaciones de streaming requieren respetar el ciclo de procesamiento compuesto por inicialización mediante Start(), transferencia gradual de datos mediante Update(), finalización mediante Finish() y posterior lectura a través de GetDigest() ([SWS_CRYPT_21116]). Todos los métodos están especificados como seguros para subprocesos (thread-safe), garantizan semántica de reversión (rollback) y notifican errores de secuencia o de búfer de manera determinista mediante objetos de resultado.

Contexto

La clase ara::crypto::cryp::HashFunctionCtx define en el módulo crypto de la AUTOSAR Adaptive Platform la interfaz para calcular valores hash criptográficos y sumas de comprobación. Como especialización de CryptoContext, proporciona métodos para llamadas individuales sin estado, así como para procedimientos de streaming con estado. La gestión del ciclo de vida y de la propiedad se realiza típicamente a través del alias de tipo de puntero inteligente Sptr ([SWS_CRYPT_21101]), que está definido como std::shared_ptr<HashFunctionCtx>.

Entre los interlocutores principales se encuentran:

  • Aplicación invocadora: Controla el ciclo de vida del cálculo y transfiere datos de entrada por bloques o como mensaje completo.
  • Áreas de memoria: Los datos de entrada, los vectores de inicialización (IV) y los búferes de salida y de estado se transportan a través de ReadOnlyMemRegion y ReadWriteMemRegion.
  • Objetos de clave: A través de CryptoObject::Sptr pueden incluirse claves criptográficas directamente como fuente de datos en el cálculo del hash ([SWS_CRYPT_50057]).
  • Crypto Provider: Interpretación: es probable que las instancias de HashFunctionCtx se creen típicamente mediante un Crypto Provider asociado; el intercambio de estados de contexto exportados presupone obligatoriamente el mismo Crypto Provider y el mismo ID de algoritmo ([SWS_CRYPT_50065]). Pregunta Q-8365d4bee96bbf67 (abierta)

Ciclo de vida

Una instancia de HashFunctionCtx pasa por varios estados discretos durante el procesamiento en streaming:

hash_states Bereit Bereit InVerarbeitung InVerarbeitung Bereit->InVerarbeitung Start() / Start(iv) Bereit->InVerarbeitung ImportContextState() InVerarbeitung->Bereit Cancel() / Start() InVerarbeitung->InVerarbeitung Update() / GetIntermediateDigest() Abgeschlossen Abgeschlossen InVerarbeitung->Abgeschlossen Finish() Unterbrochen Unterbrochen InVerarbeitung->Unterbrochen ExportContextState() Abgeschlossen->Bereit Start()

Diagrama de estados: transiciones de estado del contexto hash durante la inicialización, el procesamiento y la finalización. Fuentes: [SWS_CRYPT_50152], [SWS_CRYPT_50153], [SWS_CRYPT_21113], [SWS_CRYPT_50058], [SWS_CRYPT_21115], [SWS_CRYPT_50064], [SWS_CRYPT_50065]

Tras la creación, el contexto se encuentra en estado no iniciado. Mediante la llamada a Start() sin IV ([SWS_CRYPT_50152]) o a Start(iv) con vector de inicialización ([SWS_CRYPT_50153]), el contexto pasa a la fase de procesamiento activo. Los cálculos que ya se encuentren en ejecución se descartan implícitamente mediante una nueva llamada de inicio.

En el estado de procesamiento, los datos de entrada se acumulan mediante llamadas repetidas a Update() con fragmentos de datos sin procesar ([SWS_CRYPT_21113]) o claves ([SWS_CRYPT_50057]). A través de GetIntermediateDigest() se puede calcular un resultado intermedio sin finalizar el contexto ni interrumpir el flujo de datos ([SWS_CRYPT_50059]). Una operación de transmisión continua en curso se puede cancelar en cualquier momento mediante Cancel() ([SWS_CRYPT_50058]), lo que hace que el contexto vuelva al estado no iniciado.

La llamada a Finish() transfiere el contexto al estado «finalizado» ([SWS_CRYPT_21115]). Solo en este estado se puede extraer el valor hash resultante a través de GetDigest() ([SWS_CRYPT_21116]) o comprobar directamente contra un valor esperado mediante Compare() ([SWS_CRYPT_50154]).

Para interrumpir y reanudar cálculos posteriormente, se puede consultar el tamaño de búfer requerido mediante GetContextStateSize() ([SWS_CRYPT_50063]) y guardar el estado interno a través de ExportContextState() ([SWS_CRYPT_50064]). La reanudación se realiza a través de ImportContextState() ([SWS_CRYPT_50065]). Todos los métodos de interfaz están declarados como seguros frente a excepciones (exception safe) y seguros para subprocesos (thread-safe).

Ruta de uso

La clase admite dos modos de procesamiento: el cálculo directo en un solo paso y el procesamiento segmentado por transmisión continua.

El cálculo en un solo paso se realiza mediante CalculateHashDigest() ([SWS_CRYPT_50060]). Aquí se transfieren los datos de entrada, un IV opcional y el área de memoria de destino, calculándose el valor hash en una operación atómica.

Para volúmenes mayores de datos o flujos de datos continuos se utiliza la ruta de transmisión continua:

Procesamiento en streaming de un valor hashAplicaciónHashFunctionCtxStart()Result<void>loopPara cada bloque de datosUpdate(data)Result<void>Finish()Result<void>GetDigest(digest)Result<std::size_t>

Diagrama de secuencia: Flujo típico del cálculo por transmisión continua mediante Start, Update, Finish y GetDigest. Fuentes: [SWS_CRYPT_50152], [SWS_CRYPT_21113], [SWS_CRYPT_21115], [SWS_CRYPT_21116]

  1. Comprobación de capacidad: Consulta del tamaño de salida mediante GetDigestSize() ([SWS_CRYPT_50061]) y del tamaño de bloque máximo a través de GetMaximumChunkSize() ([SWS_CRYPT_50062]).
  2. Inicialización: Preparación del contexto mediante la llamada a Start() ([SWS_CRYPT_50152]) o Start(iv) ([SWS_CRYPT_50153]).
  3. Transferencia de datos: Entrega sucesiva de bloques de datos a través de Update(data) ([SWS_CRYPT_21113]) o de claves mediante Update(key) ([SWS_CRYPT_50057]).
  4. Finalización: Finalización de la acumulación del valor hash mediante Finish() ([SWS_CRYPT_21115]).
  5. Evaluación del resultado: Lectura del valor hash calculado mediante GetDigest() ([SWS_CRYPT_21116]) o comparación in-situ con un valor de referencia a través de Compare() ([SWS_CRYPT_50154]).

Escenarios de error

Los métodos de HashFunctionCtx señalan errores a través de ara::core::Result y garantizan semántica de reversión en caso de fallos. Las causas típicas de error son:

  • Infracciones de secuencia:\nSi se invoca Update() ([SWS_CRYPT_21113], [SWS_CRYPT_50057]) o Cancel() ([SWS_CRYPT_50058]) sin una llamada previa y exitosa a Start(), se devuelve CryptoErrc::kProcessingNotStarted.\nSi se llama a Finish() ([SWS_CRYPT_21115]) o GetIntermediateDigest() ([SWS_CRYPT_50059]) sin inicialización previa, el contexto notifica CryptoErrc::kInvalidUsageOrder.\nLa obtención de resultados a través de GetDigest() ([SWS_CRYPT_21116]) o Compare() ([SWS_CRYPT_50154]) antes de la ejecución de Finish() falla con CryptoErrc::kProcessingNotFinished.
  • Problemas de búfer y de tamaño:\nSi el búfer de salida no es suficiente, CalculateHashDigest() ([SWS_CRYPT_50060]), GetDigest() ([SWS_CRYPT_21116]), GetIntermediateDigest() ([SWS_CRYPT_50059]) así como ExportContextState() ([SWS_CRYPT_50064]) devuelven el error CryptoErrc::kInsufficientCapacity.\nLas longitudes de entrada o de IV no compatibles dan lugar a CryptoErrc::kInvalidInputSize en CalculateHashDigest(), Start(iv) ([SWS_CRYPT_50153]) y Update().
  • Incompatibilidad y falta de compatibilidad con funciones:\nCryptoErrc::kUnsupported señala que no se admiten llamadas individuales ([SWS_CRYPT_50060]), que la presencia de un IV no coincide con la función hash ([SWS_CRYPT_50152], [SWS_CRYPT_50153]), que no se proporcionan resultados intermedios ([SWS_CRYPT_50059]), que no se admite la exportación/importación del contexto ([SWS_CRYPT_50063], [SWS_CRYPT_50064], [SWS_CRYPT_50065]) o que no está permitido el cálculo de hash de claves ([SWS_CRYPT_50057]).
  • Validación de objetos y permisos:\nEn las transferencias de claves a través de Update(key), una clave incompatible produce CryptoErrc::kIncompatibleObject y la falta de autorización para kAllowHashCalculation genera CryptoErrc::kUsageViolation ([SWS_CRYPT_50057]).\nLos contenidos de búfer no válidos en ImportContextState() producen CryptoErrc::kInvalidArgument ([SWS_CRYPT_50065]).
  • Cuellos de botella de recursos:\nSi un recurso criptográfico requerido está ocupado, Start() responde al intento con CryptoErrc::kBusyResource ([SWS_CRYPT_50152], [SWS_CRYPT_50153]).

Esta guía se basa en la especificación AUTOSAR Adaptive Platform R25-11.

Mapa de miembros

Diagrama de clases

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

G nara__crypto__cryp__HashFunctionCtx412 HashFunctionCtx + CalculateHashDigest() + Cancel() + Compare() + ExportContextState() + Finish() + GetContextStateSize() + GetDigest() + GetDigestSize() + GetIntermediateDigest() + GetMaximumChunkSize() + ImportContextState() + Start() + Update() nara__crypto__cryp__CryptoContext85 CryptoContext nara__crypto__cryp__HashFunctionCtx412->nara__crypto__cryp__CryptoContext85

Vista de detalle

Selecciona una entrada en el índice.

Métodos

Calculate the hash digest and write the the calculated digest into the provided output buffer.

virtual ara::core::Result< std::size_t > CalculateHashDigest (ReadOnly MemRegion data, ReadWriteMemRegion digest, ara::core::Optional< Read OnlyMemRegion > iv) const noexcept=0;
Cancel función

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;
Compare función

Compare the size and content of the calculated digest against an expected value.

virtual ara::core::Result< bool > Compare (ReadOnlyMemRegion expected) const noexcept=0;

Write the current state of this hash context into the provided output buffer contextState. This function can be used to suspend an ongoing hash operation and resume it at a later point in time.

virtual ara::core::Result< void > ExportContextState (ReadWriteMem Region contextState) const noexcept=0;
Finish función

Finish the digest calculation.

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

Get the buffer size required to store the state of this context using ExportContextState()

virtual ara::core::Result< std::size_t > GetContextStateSize () const noexcept=0;
GetDigest función

Write the calculated hash digest into the provided output buffer.

virtual ara::core::Result< std::size_t > GetDigest (ReadWriteMemRegion digest) const noexcept=0;
GetDigestSize función

Get the output digest size.

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

Calculate the hash digest with the data provided to the hash context and write the calculated hash digest into the provided output buffer. The hash digest is equal to the hash digest returned when calling Finish() and GetDigest(), however, after calling GetIntermediateDigest(), this context can still be updated with additional data.

virtual ara::core::Result< std::size_t > GetIntermediateDigest (Read WriteMemRegion digest) const noexcept=0;

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

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

Set the current state of this hash context to the state provided by contextState. This function can be used to resume a previously suspended hash operation. The contextState must have been exported from a HashFunctionCtx with the same AlgorithmId provided by the same Crypto Provider as the current context using the function ExportContextState(). The current state of this context (e.g., any ongoing hash calculation) will be replaced by the state provided to this function.

virtual ara::core::Result< void > ImportContextState (ReadOnlyMem Region contextState) noexcept=0;
Start función 2

Initialize the context for processing of a hash digest without an IV. Will cancel any ongoing hash calculation.

Sobrecargas Start 2
virtual ara::core::Result< void > Start () noexcept=0; SWS_CRYPT_50152
virtual ara::core::Result< void > Start (ReadOnlyMemRegion iv) noexcept=0; SWS_CRYPT_50153
Update función 2

Update the digest calculation context by a new part of the message.

Sobrecargas Update 2
virtual ara::core::Result< void > Update (ReadOnlyMemRegion data) noexcept=0; SWS_CRYPT_21113
virtual ara::core::Result< void > Update (CryptoObject::Sptr key) noexcept=0; SWS_CRYPT_50057

Alias de tipo

Sptr alias de tipo

Smart pointer of the interface.

Documentación de los métodos

función CalculateHashDigest [SWS_CRYPT_50060] Upstream: RS_CRYPTO_02205

virtual ara::core::Result< std::size_t > CalculateHashDigest (ReadOnly MemRegion data, ReadWriteMemRegion digest, ara::core::Optional< Read OnlyMemRegion > iv) const noexcept=0;

Calculate the hash digest and write the the calculated digest into the provided output buffer.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: adb7aefb7feb Procedencia
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

El método CalculateHashDigest realiza un cálculo one-shot síncrono de un valor hash criptográfico y escribe el resultado en el búfer de salida proporcionado [SWS_CRYPT_50060]. Se pasan como parámetros el mensaje de entrada a procesar data, el búfer de destino digest y, opcionalmente, un vector de inicialización iv. En caso de ejecución correcta, la función devuelve a través del objeto de resultado ara::core::Result<std::size_t> el número real de bytes de digest escritos [SWS_CRYPT_50060].

Manejo de errores

Si el cálculo falla, la interfaz garantiza una semántica de reversión [SWS_CRYPT_50060]. El resultado puede contener los siguientes códigos de error:

  • ara::crypto::CryptoErrc::kInvalidInputSize: El tamaño de los datos pasados o del vector de inicialización no es compatible [SWS_CRYPT_50060].
  • ara::crypto::CryptoErrc::kUnsupported: El contexto no admite el cálculo mediante llamada única (single-call), o la transferencia del vector de inicialización no coincide con la configuración del contexto (IV requerido pero ausente, o bien IV transferido aunque no es compatible) [SWS_CRYPT_50060].
  • ara::crypto::CryptoErrc::kInsufficientCapacity: La capacidad del búfer de salida digest no es suficiente para el digest calculado [SWS_CRYPT_50060].

Concurrencia e interacción

La función está declarada como segura frente a excepciones (exception safe) y segura frente a hilos (thread-safe) [SWS_CRYPT_50060]. Para evitar de antemano errores relativos a longitudes de entrada no permitidas, el tamaño de búfer máximo permitido del contexto para una única llamada puede determinarse a través de GetMaximumChunkSize [SWS_CRYPT_50062].

Esta nota de uso fue generada automáticamente sobre la base de la especificación AUTOSAR R25-11.

Guía del implementador pendiente (complejidad I1)

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

Parameter (in)

ParameterBeschreibung
datathe input message that should be processed
ivan optional initialization vector

Parameter (out)

ParameterBeschreibung
digestan output data buffer that the digest will be written into.

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the size in bytes of the digest or an error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided data or IV is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if single-call operation is not supported, or if the context requires setting an IV but no IV is provided, or if the context does not support setting an IV but an IV is provided
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50060
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50060@rel:R25-11#51ecbb29
Content hash
51ecbb29
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50060
Status: valid/unmigrated Version: rel:R25-11#29fd4c6d 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_50060@rel:R25-11#29fd4c6d
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

función Cancel [SWS_CRYPT_50058] 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.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 5c8d759c011a Procedencia
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

usar

El método Cancel() sirve para la cancelación selectiva de una operación de streaming en curso que se inició previamente mediante el método Start() y aún no ha concluido con normalidad [SWS_CRYPT_50058]. La llamada se realiza de forma sincrónica y sin parámetros en una instancia de ara::crypto::cryp::HashFunctionCtx del archivo de cabecera ara/crypto/cryp/hash_function_ctx.h [SWS_CRYPT_50058]. Si se ejecuta con éxito, la operación devuelve un ara::core::Result<void> vacío [SWS_CRYPT_50058].

Manejo de errores

Si surge un problema durante la ejecución, el ara::core::Result devuelto contiene un valor de error correspondiente [SWS_CRYPT_50058]. Si el procesamiento no se inició mediante Start() antes de la llamada a Cancel(), la cancelación falla y devuelve el código de error específico ara::crypto::CryptoErrc::kProcessingNotStarted con semántica de reversión [SWS_CRYPT_50058].

Concurrencia y restricciones

La interfaz está definida como thread-safe y exception safe, y está declarada con noexcept [SWS_CRYPT_50058]. Como condición previa funcional esencial, el procesamiento de datos debe encontrarse en un estado activo generado por una llamada previa a Start() [SWS_CRYPT_50058].

Interacción

El patrón implementado por Cancel() está estandarizado en diversos contextos de streaming de la pila criptográfica. Los contextos VerifierPublicCtx [SWS_CRYPT_50023], MessageAuthnCodeCtx [SWS_CRYPT_50027], SignerPrivateCtx [SWS_CRYPT_50041], SymmetricCipherCtx [SWS_CRYPT_50046], DecryptorPrivateCtx [SWS_CRYPT_50069], AuthCipherCtx [SWS_CRYPT_50077] y EncryptorPublicCtx [SWS_CRYPT_50089] también presentan una semántica y una señalización de errores exactamente coincidentes.

Esta nota de uso se basa en la especificación de AUTOSAR Adaptive R25-11.

Guía del implementador pendiente (complejidad I1)

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
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_50058
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50058@rel:R25-11#d1f15a2b
Content hash
d1f15a2b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50058
Status: valid/unmigrated Version: rel:R25-11#69ced25c 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_50058@rel:R25-11#69ced25c
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

función Compare [SWS_CRYPT_50154] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< bool > Compare (ReadOnlyMemRegion expected) const noexcept=0;

Compare the size and content of the calculated digest against an expected value.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 1c3bf0837502 Procedencia Preguntas abiertas (1)
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

El método Compare de la clase ara::crypto::cryp::HashFunctionCtx ([SWS_CRYPT_50154]) compara de forma síncrona el tamaño y el contenido de un digest hash calculado previamente con un valor de referencia esperado. El valor nominal se transfiere a través del parámetro expected del tipo ReadOnlyMemRegion. En caso de éxito, la función devuelve un ara::core::Result<bool> que contiene true si y solo si la secuencia de bytes esperada es idéntica al digest calculado.

El requisito previo para la llamada es que el cálculo del digest se haya concluido previamente con el método Finish(). Si este no es el caso, la llamada falla y devuelve el error ara::crypto::CryptoErrc::kProcessingNotFinished con semántica de reversión ([SWS_CRYPT_50154]). Interpretación: Es de suponer que una longitud discrepante o un contenido no coincidente de expected no dé lugar a un código de error, sino a un false regular en el objeto de resultado. Pregunta Q-fdd0ecaec22f6985 (abierta)

En cuanto a la concurrencia, el método está especificado como thread-safe y exception safe ([SWS_CRYPT_50154]). Debido a su declaración como noexcept, no lanza excepciones de C++.

En contextos criptográficos relacionados se utiliza el mismo patrón de comprobación: para Message Authentication Codes, ara::crypto::cryp::MessageAuthnCodeCtx::Compare ([SWS_CRYPT_50133]) compara el tamaño y el contenido del valor MAC calculado, mientras que CompareSubspan ([SWS_CRYPT_50028]) comprueba los bits más significativos. Ambos métodos exigen por igual un cálculo finalizado previamente.

Este texto ha sido generado por una IA sobre la base de la especificación AUTOSAR R25-11.

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

Parameter (in)

ParameterBeschreibung
expectedthe memory region containing an expected digest value

Rückgabewert

TypBeschreibung
ara::core::Result< bool >true if the expected byte sequence is identical to the calculated digest

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics if the digest calculation was not finished by a call of the Finish() method

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

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

función ExportContextState [SWS_CRYPT_50064] Upstream: RS_CRYPTO_02309

virtual ara::core::Result< void > ExportContextState (ReadWriteMem Region contextState) const noexcept=0;

Write the current state of this hash context into the provided output buffer contextState. This function can be used to suspend an ongoing hash operation and resume it at a later point in time.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 78b3b1c67b6a Procedencia
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

El método [SWS_CRYPT_50064] de la clase ara::crypto::cryp::HashFunctionCtx escribe de forma síncrona el estado actual de un contexto de hash en el búfer de salida pasado contextState de tipo ReadWriteMem Region. Esto permite a las aplicaciones interrumpir una operación de hash criptográfica en curso y reanudarla en un momento posterior. En caso de ejecución correcta, la llamada devuelve un ara::core::Result<void> vacío.

Interacción y dimensionamiento del búfer

Para evitar errores de memoria, el tamaño de búfer en bytes estrictamente necesario debe consultarse de antemano a través de la función [SWS_CRYPT_50063]. El estado exportado puede reimportarse posteriormente en un contexto de hash mediante [SWS_CRYPT_50065]. El requisito para ello es que el contexto de destino presente la misma AlgorithmId y sea proporcionado por el mismo Crypto Provider que el contexto de origen. Al realizar la importación, cualquier estado de cálculo existente se sobrescribe por completo.

Manejo de errores

Si la operación falla, se devuelve un error en el ara::core::Result. Se especifican los siguientes códigos de error de ara::crypto::CryptoErrc:

  • ara::crypto::CryptoErrc::kUnsupported: El contexto concreto no admite la exportación o importación de estados.
  • ara::crypto::CryptoErrc::kInsufficientCapacity: La capacidad del búfer pasado contextState no es suficiente para albergar el estado.

Para ambos casos de error se define una semántica de reversión, de modo que el estado del objeto permanece inalterado.

Concurrencia y seguridad de ejecución

La interfaz está declarada como const y noexcept. Según la especificación, la llamada es tanto thread-safe como exception-safe.

Esta nota de uso fue generada automáticamente a partir de la especificación de AUTOSAR.

Guía del implementador pendiente (complejidad I1)

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

Parameter (out)

ParameterBeschreibung
contextStatean output data buffer that the state of the context will be written into.

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this context does not support im-/exporting the context state
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50064
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50064@rel:R25-11#29b5da7b
Content hash
29b5da7b
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50064
Status: valid/unmigrated Version: rel:R25-11#10cf645c 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_50064@rel:R25-11#10cf645c
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

función Finish [SWS_CRYPT_21115] Upstream: RS_CRYPTO_02302, RS_CRYPTO_02205

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

Finish the digest calculation.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 3afea8abb39d Procedencia Preguntas abiertas (1)
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

usar

El método síncrono Finish() finaliza el cálculo de un valor hash en ara::crypto::cryp::HashFunctionCtx [SWS_CRYPT_21115]. La llamada sin parámetros devuelve un ara::core::Result<void> que señala la finalización correcta o encapsula un error [SWS_CRYPT_21115]. La interfaz está declarada como noexcept y especificada como segura frente a excepciones (exception safe) y segura para hilos (thread-safe) [SWS_CRYPT_21115].

Tratamiento de errores y concurrencia

Si el cálculo de hash no se inició correctamente antes de la llamada, el método falla con el error ara::crypto::CryptoErrc::kInvalidUsageOrder [SWS_CRYPT_21115]. Para este caso de error se define una semántica de reversión, de modo que los llamantes deben asegurarse obligatoriamente de contar con un contexto debidamente iniciado antes de la finalización [SWS_CRYPT_21115].

Interacción

Tras una llamada correcta a Finish(), el digest hash calculado se transfiere típicamente con GetDigest() a un búfer provisto [SWS_CRYPT_21116], [SWS_CRYPT_50059]. Como diferenciación sirve GetIntermediateDigest(): esta función proporciona el mismo valor hash que la secuencia de Finish() y GetDigest(), pero permite a continuación el paso de más datos [SWS_CRYPT_50059]. Interpretación: Tras la llamada a Finish(), es de esperar que el cálculo haya finalizado definitivamente y que el contexto ya no acepte datos adicionales. Pregunta Q-f4daf29364f45fd5 (abierta) Los tamaños de búfer admisibles para los pasos de procesamiento en el contexto pueden consultarse mediante GetMaximumChunkSize() [SWS_CRYPT_50062].

Esta nota de uso se ha generado automáticamente a partir de la especificación AUTOSAR R25-11.

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

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kInvalidUsageOrderrollback_semantics the hash calculation has not been started successfully.

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

Record
AUTOSAR/AP/record/SWS_CRYPT_21115
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_21115@rel:R25-11#101a9c1a
Content hash
101a9c1a
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21115
Status: valid/unmigrated Version: rel:R25-11#03ec3455 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_21115@rel:R25-11#03ec3455
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#5c49c1122026-09-30
  • R20-11rel:R20-11#23a4ded62026-10-14
  • R21-11rel:R21-11#33ec9dc92026-10-14
  • R22-11rel:R22-11#13315a192026-10-14
  • R23-11rel:R23-11#6b14e99d2026-10-14
  • R24-11rel:R24-11#de528ef72026-10-14
  • R25-11rel:R25-11#03ec34552026-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

función GetContextStateSize [SWS_CRYPT_50063] Upstream: RS_CRYPTO_02309

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

Get the buffer size required to store the state of this context using ExportContextState()

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing required context state buffer size in bytes or an error

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this context does not support im-/exporting the context state

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

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

función GetDigest [SWS_CRYPT_21116] Upstream: RS_CRYPTO_02205

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

Write the calculated hash digest into the provided output buffer.

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

Parameter (out)

ParameterBeschreibung
digestan output data buffer that the hash digest will be written into

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the size in bytes of the hash digest or an error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotFinishedrollback_semantics if the hash calculation was not finished by a call of the Finish() method
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small

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

Record
AUTOSAR/AP/record/SWS_CRYPT_21116
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_21116@rel:R25-11#655d6698
Content hash
655d6698
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21116
Status: valid/unmigrated Version: rel:R25-11#5176bc54 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_21116@rel:R25-11#5176bc54
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#d36ab7962026-09-30
  • R20-11rel:R20-11#6044ba662026-10-14
  • R21-11rel:R21-11#c195cbba2026-10-14
  • R22-11rel:R22-11#32e02a4e2026-10-14
  • R23-11rel:R23-11#7888ecb32026-10-14
  • R24-11rel:R24-11#96e2c5772026-10-14
  • R25-11rel:R25-11#5176bc542026-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

función GetDigestSize [SWS_CRYPT_50061] Upstream: RS_CRYPTO_02309

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

Get the output digest size.

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the size of the output from this digest-function in bytes or an error

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_50061
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50061@rel:R25-11#538438a5
Content hash
538438a5
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50061
Status: valid/unmigrated Version: rel:R25-11#739a55c8 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_50061@rel:R25-11#739a55c8
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

función GetIntermediateDigest [SWS_CRYPT_50059] Upstream: RS_CRYPTO_02205

virtual ara::core::Result< std::size_t > GetIntermediateDigest (Read WriteMemRegion digest) const noexcept=0;

Calculate the hash digest with the data provided to the hash context and write the calculated hash digest into the provided output buffer. The hash digest is equal to the hash digest returned when calling Finish() and GetDigest(), however, after calling GetIntermediateDigest(), this context can still be updated with additional data.

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

Parameter (out)

ParameterBeschreibung
digestan output data buffer that the hash digest will be written into

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the size in bytes of the hash digest or an error.

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kInvalidUsageOrderrollback_semantics the hash calculation has not been started successfully.
ara::crypto::CryptoErrc::kInsufficientCapacityrollback_semantics if the output buffer is too small
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this context does not support getting an intemediate digest

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50059
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50059@rel:R25-11#0155ebdf
Content hash
0155ebdf
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50059
Status: valid/unmigrated Version: rel:R25-11#9bc73898 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_50059@rel:R25-11#9bc73898
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

función GetMaximumChunkSize [SWS_CRYPT_50062] 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 CalculateHashDigest() by this context.

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

Rückgabewert

TypBeschreibung
ara::core::Result<std::size_t >A result containing the maximum buffer size in bytes or an error

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_50062
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50062@rel:R25-11#3aadd768
Content hash
3aadd768
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50062
Status: valid/unmigrated Version: rel:R25-11#17fdd281 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_50062@rel:R25-11#17fdd281
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

función ImportContextState [SWS_CRYPT_50065] Upstream: RS_CRYPTO_02309

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

Set the current state of this hash context to the state provided by contextState. This function can be used to resume a previously suspended hash operation. The contextState must have been exported from a HashFunctionCtx with the same AlgorithmId provided by the same Crypto Provider as the current context using the function ExportContextState(). The current state of this context (e.g., any ongoing hash calculation) will be replaced by the state provided to this function.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 16a68c3d97e9 Procedencia
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

El método ImportContextState de la clase ara::crypto::cryp::HashFunctionCtx (definido en ara/crypto/cryp/hash_function_ctx.h) sirve para restaurar el estado interno de un contexto de hash a partir de un búfer pasado y continuar así una operación de hash interrumpida previamente [SWS_CRYPT_50065]. Cualquier estado de cálculo en curso del contexto actual se sustituye completamente por el estado importado [SWS_CRYPT_50065].

Llamada y condiciones previas

La llamada síncrona se realiza a través de la firma ImportContextState(ReadOnlyMem Region contextState) noexcept y devuelve un ara::core::Result<void> [SWS_CRYPT_50065]. Para el parámetro contextState se aplican los siguientes requisitos obligatorios:

  • El búfer de datos debe haber sido exportado previamente con el método ExportContextState() desde una instancia de HashFunctionCtx [SWS_CRYPT_50065].
  • El contexto de origen debe haber tenido la misma AlgorithmId y haber sido proporcionado por el mismo Crypto Provider que el contexto de destino [SWS_CRYPT_50065].

Tratamiento de errores y concurrencia

En caso de error, se devuelve un código de error con semántica de reversión, de modo que el estado existente del contexto permanezca inalterado ante un fallo [SWS_CRYPT_50065]:

  • ara::crypto::CryptoErrc::kInvalidArgument: El argumento contextState contiene datos no válidos [SWS_CRYPT_50065].
  • ara::crypto::CryptoErrc::kUnsupported: El contexto específico no soporta la exportación e importación de estados de contexto [SWS_CRYPT_50065].

La operación está especificada como thread-safe y exception safe [SWS_CRYPT_50065].

Esta nota de uso se basa en la especificación AUTOSAR Adaptive Release R25-11.

Guía del implementador pendiente (complejidad I1)

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

Parameter (in)

ParameterBeschreibung
contextStatea data buffer that contains a previously exported state of the context

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this context does not support im-/exporting the context state
ara::crypto::CryptoErrc::kInvalidArgumentrollback_semantics if the contextState argument contains invalid data

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

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

función Start [SWS_CRYPT_50152] Upstream: RS_CRYPTO_02302

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

Initialize the context for processing of a hash digest without an IV. Will cancel any ongoing hash calculation.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 6588b8251bb2 Procedencia Preguntas abiertas (1)
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

El método Start() de la interfaz ara::crypto::cryp::HashFunctionCtx inicializa el contexto para el cálculo paso a paso de un valor hash sin vector de inicialización (IV) [SWS_CRYPT_50152]. Una nueva llamada cancela un cálculo de hash que posiblemente ya esté en curso y configura el contexto para un nuevo cálculo [SWS_CRYPT_50152].

La función es síncrona, no recibe parámetros y devuelve un ara::core::Result<void> [SWS_CRYPT_50152]. Si se produce un error durante la inicialización, se aplica la semántica de reversión con los siguientes códigos de error específicos [SWS_CRYPT_50152]:

  • ara::crypto::CryptoErrc::kUnsupported: la función hash utilizada requiere obligatoriamente un vector de inicialización [SWS_CRYPT_50152].
  • ara::crypto::CryptoErrc::kBusyResource: un recurso interno imprescindible para la operación está ocupado [SWS_CRYPT_50152].

En cuanto a la concurrencia, el método está especificado como thread-safe y exception safe, y está declarado como noexcept [SWS_CRYPT_50152]. Tras una inicialización correcta, las partes del mensaje se pueden suministrar secuencialmente a través del método Update() del contexto [SWS_CRYPT_21113]. Dado que la llamada cancela los cálculos en curso, en la práctica la función probablemente también sirve como mecanismo de restablecimiento antes de un reinicio. Pregunta Q-9c369489a6c6e8cb (abierta)

Esta nota de uso se generó automáticamente a partir de la especificación AUTOSAR para R25-11.

Guía del implementador pendiente (complejidad I1)

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

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics the used hash function expects an IV
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy

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

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

función Start [SWS_CRYPT_50153] Upstream: RS_CRYPTO_02302

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

Initialize the context for processing of a hash digest with an IV. Will cancel any ongoing hash calculation.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 3e6743c0173b Procedencia
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

usar

La función Start de la interfaz ara::crypto::cryp::HashFunctionCtx inicializa el contexto para el cálculo de un resumen de hash utilizando un vector de inicialización (IV) [SWS_CRYPT_50153]. Como parámetro, el vector de inicialización iv se transfiere a través de un ReadOnlyMemRegion [SWS_CRYPT_50153]. La llamada síncrona devuelve un ara::core::Result<void>, que en caso de éxito no contiene ningún valor de retorno [SWS_CRYPT_50153]. Una llamada cancela además un cálculo de hash que posiblemente ya esté en curso en este contexto [SWS_CRYPT_50153].

Manejo de errores

Si se produce un error durante la inicialización, se devuelve un código de error correspondiente, garantizándose una semántica de reversión para todos los casos de error [SWS_CRYPT_50153]:

  • ara::crypto::CryptoErrc::kInvalidInputSize: el tamaño del vector de inicialización proporcionado no es compatible [SWS_CRYPT_50153].
  • ara::crypto::CryptoErrc::kUnsupported: la función hash subyacente no utiliza ningún vector de inicialización [SWS_CRYPT_50153].
  • ara::crypto::CryptoErrc::kBusyResource: un recurso necesario para la inicialización está ocupado [SWS_CRYPT_50153].

Concurrencia e interacción

La interfaz está declarada como noexcept y especificada como segura para subprocesos (thread-safe) y segura frente a excepciones (exception safe) [SWS_CRYPT_50153]. En el flujo típico, la llamada constituye la condición previa para el posterior procesamiento secuencial del mensaje de entrada a través del método Update [SWS_CRYPT_21113].

Esta nota de uso se ha generado de forma automatizada sobre la base de la especificación AUTOSAR R25-11.

Guía del implementador pendiente (complejidad I1)

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

Parameter (in)

ParameterBeschreibung
ivthe used Initialization Vector (IV)

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics the size of provided IV is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics the used hash function does not use an IV
ara::crypto::CryptoErrc::kBusyResourcerollback_semantics a required resource is busy

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50153
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50153@rel:R25-11#18746a6c
Content hash
18746a6c
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50153
Status: valid/unmigrated Version: rel:R25-11#8543358e 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_50153@rel:R25-11#8543358e
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

función Update [SWS_CRYPT_21113] Upstream: RS_CRYPTO_02302

virtual ara::core::Result< void > Update (ReadOnlyMemRegion data) noexcept=0;

Update the digest calculation context by a new part of the message.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: fe6681ce0628 Procedencia Preguntas abiertas (1)
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

El método síncrono Update sirve en [SWS_CRYPT_21113] para la actualización incremental de un contexto de cálculo de hash en curso (ara::crypto::cryp::HashFunctionCtx). A través del parámetro data (ReadOnlyMemRegion) se transmite una parte del mensaje de entrada que se va a procesar. La función devuelve un ara::core::Result<void> que está vacío en caso de éxito o encapsula un código de error correspondiente.

En lo relativo al comportamiento ante errores, el método ofrece semántica de reversión en dos estados de error específicos:

  • ara::crypto::CryptoErrc::kProcessingNotStarted: el cálculo no se inició previamente mediante una llamada al método Start() [SWS_CRYPT_21113].
  • ara::crypto::CryptoErrc::kInvalidInputSize: el tamaño de los datos transmitidos no es admitido por el contexto [SWS_CRYPT_21113].

Para el contexto de llamada rigen condiciones claras de orden y tamaño: antes de la transferencia de datos, la operación de hash debe haberse inicializado [SWS_CRYPT_21113]. Para evitar kInvalidInputSize, el tamaño de bloque máximo permitido para una única llamada a Update se puede determinar previamente mediante GetMaximumChunkSize [SWS_CRYPT_50062]. Conforme a la especificación, la función está declarada como segura frente a excepciones (exception safe) y segura para subprocesos (thread-safe) [SWS_CRYPT_21113].

En la interacción con otras interfaces, dentro de HashFunctionCtx existe una sobrecarga para transferir objetos de clave mediante Update(CryptoObject::Sptr) [SWS_CRYPT_50057]. Tras el suministro de todos los bloques de datos, la finalización del valor de comprobación presumiblemente debería realizarse mediante Finish() [SWS_CRYPT_50062]. Pregunta Q-dcac20f353ca55f4 (abierta)

Esta nota de uso fue generada automáticamente sobre la base de la especificación.

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

Parameter (in)

ParameterBeschreibung
dataa part of the input message that should be processed

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ara::crypto::CryptoErrc::kProcessingNotStartedrollback_semantics if the digest calculation was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided data is not supported

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

Record
AUTOSAR/AP/record/SWS_CRYPT_21113
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_21113@rel:R25-11#03833fbd
Content hash
03833fbd
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21113
Status: valid/unmigrated Version: rel:R25-11#1061ad76 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_21113@rel:R25-11#1061ad76
Point-in-Time History:
Recorded Revisions (7):
  • R25-11rel:R25-11#a256303e2026-09-30
  • R20-11rel:R20-11#c42a6b602026-10-14
  • R21-11rel:R21-11#8395b3922026-10-14
  • R22-11rel:R22-11#c133132e2026-10-14
  • R23-11rel:R23-11#68132f692026-10-14
  • R24-11rel:R24-11#0809f9622026-10-14
  • R25-11rel:R25-11#1061ad762026-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

función Update [SWS_CRYPT_50057] Upstream: RS_CRYPTO_02302

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

Update the digest calculation context by a new part of the message.

GENERADO POR IA no revisado Modelo: gemini-3.8-flash-medium · Esfuerzo: medium · Temperatura: no controlable · Prompt: 87fb2c080f4a Procedencia
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

El método síncrono Update sirve en [SWS_CRYPT_50057] para ampliar paso a paso el contexto de un cálculo de valor hash en ara::crypto::cryp::HashFunctionCtx con un nuevo segmento de mensaje en forma de objeto de clave. Como parámetro se pasa un puntero inteligente al objeto de clave (CryptoObject::Sptr key). La llamada devuelve como valor de retorno un ara::core::Result<void> que, en caso de procesamiento correcto, está vacío o, en caso de error, encapsula un código de error correspondiente [SWS_CRYPT_50057].

Como condición de secuencia se aplica que el cálculo debe haberse iniciado previamente de forma obligatoria mediante la llamada a Start(); de lo contrario, se notifica el error ProcessingNotStarted [SWS_CRYPT_50057]. Otros casos de error específicos incluyen (cada uno con semántica de reversión) [SWS_CRYPT_50057]:

  • ara::crypto::CryptoErrc::kUnsupported, si el contexto de hash no soporta en general el cálculo de hash de claves,
  • ara::crypto::CryptoErrc::kIncompatibleObject, si el objeto de clave pasado no es compatible con el contexto,
  • ara::crypto::CryptoErrc::kUsageViolation, siempre que el uso permitido de la clave no incluya kAllowHash Calculation,
  • ara::crypto::CryptoErrc::kInvalidInputSize, si el tamaño de datos de la clave pasada no está soportado.

El método está declarado como thread-safe así como exception safe (noexcept) [SWS_CRYPT_50057]. En interacción con otras interfaces del módulo, el tamaño de búfer máximo admisible para llamadas individuales a Update se puede determinar a través de GetMaximumChunkSize() [SWS_CRYPT_50062]. Para partes regulares del mensaje sin objeto de clave, existe en paralelo en HashFunctionCtx la sobrecarga Update(ReadOnlyMemRegion data) [SWS_CRYPT_21113].

Esta nota de uso se ha creado automáticamente a partir de la especificación.

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

Parameter (in)

ParameterBeschreibung
keya part of the input message that should be processed

Rückgabewert

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

Fehler

FehlercodeBeschreibung
ProcessingNotStartedif the digest calculation was not initiated by a call of the Start() method
ara::crypto::CryptoErrc::kInvalidInputSizerollback_semantics if the size of provided data is not supported
ara::crypto::CryptoErrc::kUnsupportedrollback_semantics if this context does not support hashing of keys
ara::crypto::CryptoErrc::kIncompatibleObjectrollback_semantics if the provided key is incompatible with this context
ara::crypto::CryptoErrc::kUsageViolationrollback_semantics if the allowed usage of the key does not include kAllowHash Calculation

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

Record
AUTOSAR/AP/record/SWS_CRYPT_50057
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_50057@rel:R25-11#9fd6ab9d
Content hash
9fd6ab9d
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_50057
Status: valid/unmigrated Version: rel:R25-11#6d3cf021 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_50057@rel:R25-11#6d3cf021
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

Documentación de los alias de tipo

alias de tipo Sptr [SWS_CRYPT_21101] Upstream: RS_CRYPTO_02205

using Sptr = std::shared_ptr<HashFunctionCtx>;

Smart pointer of the interface.

Header-Datei#include "ara/crypto/cryp/hash_function_ctx.h"
Scopeclass ara::crypto::cryp::HashFunctionCtx
SymbolSptr

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

Record
AUTOSAR/AP/record/SWS_CRYPT_21101
Status
valid/unmigrated
Version
AUTOSAR/AP/record/SWS_CRYPT_21101@rel:R25-11#1c95427e
Content hash
1c95427e
Source
https://www.autosar.org/fileadmin/standards/R25-11/AP/AUTOSAR_AP_SWS_Cryptography.pdf#nameddest=SWS_CRYPT_21101
Status: valid/unmigrated Version: rel:R25-11#6b0a2315 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_21101@rel:R25-11#6b0a2315
Point-in-Time History:
Recorded Revisions (8):
  • R25-11rel:R25-11#806f0f392026-09-30
  • R19-11rel:R19-11#d559cb4a2026-10-14
  • R20-11rel:R20-11#6ba26a492026-10-14
  • R21-11rel:R21-11#6ba26a492026-10-14
  • R22-11rel:R22-11#49c7b6f72026-10-14
  • R23-11rel:R23-11#cfd4adfd2026-10-14
  • R24-11rel:R24-11#cfd4adfd2026-10-14
  • R25-11rel:R25-11#6b0a23152026-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