DEENESPTFRRUARHIKOZHNL
AUTOSAR_EXP_SWArchitecture FIG-812733f50d84d305 930 × 1031 px 1 Release(s)

Figure 9.46: CryptoService and CryptoContext Interfaces

SHA-256 Inhalts-Fingerabdruck: 812733f50d84d305d11f5db376ba8435afae4601f0d976d61c90421a35c0b689
✦ KI-generierte Bildanalyse & technische Beschreibung Modell: gemini-3.8-flash (via agy) · Rezept figure-series@1 · erstellt am 2026-10-08

1. Diagrammtyp & Architektur-Kontext

  • Diagrammtyp: UML-Klassendiagramm / Schnittstellenspezifikation (AUTOSAR Adaptive Platform).
  • Architektur-Kontext: Spezifikation der C++ Native API-Bindung für den Functional Cluster Cryptography (ara::crypto) gemäß AUTOSAR Adaptive Platform (R21-11, AUTOSAR_EXP_SWArchitecture).
  • Technischer Zweck: Darstellung der Entkopplung zwischen der konsumierenden Adaptive Application und der Plattform-Realisierung im Modus daemon-based (getrennter Prozess/Daemon für Krypto-Primitive, Key-Storage und HSM-Anbindung). Es definiert die Schnittstellenteilung zwischen zustandsbehafteten Rechenkontexten (CryptoContext) und zustandslosen Algorithmen-Metadaten (ExtensionService).

2. Komponenten, Entitäten & Schnittstellen

  • Komponenten / Akteure:
    • Adaptive Application: Anwendungsprozess im User Space, agiert als Service-Konsument.
    • «aapFunctionalCluster» Cryptography (Tag: daemon-based): Plattform-Dienst/Daemon, der die kryptografischen Treiber, Hardware-Security-Module (HSM) oder Software-Ciphers kapselt.
  • Schnittstellen (Stereotypen: «aapAPI, aapNativeInterface»):
    • CryptoContext::EncryptorPrivateCtx: Asymmetrischer/privater Verschlüsselungskontext.
      • Methoden: + GetCryptoService(), + ProcessBlock(), + Reset(), + SetKey().
    • CryptoContext::DecryptorPrivateCtx: Asymmetrischer/privater Entschlüsselungskontext.
      • Methoden: + GetCryptoService(), + ProcessBlock(), + Reset(), + SetKey().
    • CryptoContext::SymmetricBlockCipherCtx: Symmetrischer Blockchiffrier-Kontext (z. B. AES-CBC, AES-GCM).
      • Methoden: + GetCryptoService(), + GetTransformation(), + ProcessBlock(), + ProcessBlocks(), + Reset(), + SetKey().
    • ExtensionService::CryptoService: Dienst zur Bereitstellung algorhythmusspezifischer Parameter und Puffergrenzen.
      • Methoden: + GetBlockSize(), + GetMaxInputSize(), + GetMaxOutputSize().
  • Beziehungen & Vererbung:
    • Interface-Realization (gestrichelte Linie mit geschlossener, nicht ausgefüllter Pfeilspitze): Cryptography realisiert alle vier nativen Schnittstellen.
    • Nutzungsabhängigkeit («use», gestrichelte Pfeile): Adaptive Application bindet und konsumiert alle vier Interfaces direkt.
    • Assoziation / Navigation: Jeder CryptoContext referenziert über GetCryptoService() die zugehörige Instanz von ExtensionService::CryptoService.

3. Dynamisches Verhalten & Sequenzablauf

Obwohl als statisches Strukturdiagramm dargestellt, erzwingt das API-Design folgenden Ablauf:

  1. Kontext-Allokation & Konfiguration:
    • Erzeugung/Bezug einer Kontextinstanz (EncryptorPrivateCtx, DecryptorPrivateCtx oder SymmetricBlockCipherCtx) über eine Factory/Provider-API.
    • Bindung des Schlüssels über SetKey().
  2. Puffer- und Größenabfrage:
    • Aufruf von GetCryptoService() am Kontext liefert CryptoService.
    • Abfrage von Block- und Maximalgrößen (GetBlockSize(), GetMaxInputSize(), GetMaxOutputSize()) zur Vorallokation applikationsseitiger Ein-/Ausgabepuffer.
  3. Kryptografische Transformation:
    • Synchroner Aufruf von ProcessBlock() für Einzelblöcke bzw. ProcessBlocks() für Blockströme.
    • Bei symmetrischen Chiffren: Identifikation des Transformationsmodus (Algorithmus, Chaining-Modus, Padding) via GetTransformation().
  4. Zustandsverwaltung / Reset:
    • Reset() setzt interne Zustände (Initialisierungsvektoren IV, Zwischenpuffer) zurück, behält jedoch die Schlüsselbindung (SetKey()) bei.

4. Normative Relevanz & Entwickler-Hinweise

  • IPC-Overhead bei daemon-based: Da das Cluster als Daemon instanziiert ist, involvieren Aufrufe Prozesswechsel (Context Switches) und Inter-Process Communication (IPC/Shared Memory). Entwickler müssen für Durchsatzoptimierung zwingend ProcessBlocks() (Streaming/Batching) statt sequenzieller ProcessBlock()-Aufrufe verwenden.
  • Puffer-Vorvalidierung: Vor Aufruf von ProcessBlock(s) muss die Applikation die Puffergrößen strikt gegen GetMaxInputSize() und GetMaxOutputSize() validieren. Fehldimensionierungen führen zu Fehlern aus der CryptoErrorDomain (ara::core::Result<T>).
  • Schlüsselisolierung: SetKey() verarbeitet Key-Slot-Handles/Referenzen (ara::crypto::keys). Reines Schlüsselmaterial verbleibt im geschützten Speicherbereich des Daemons oder im Secure Element/HSM und wird nicht in den Prozessraum der Adaptive Application kopiert.
  • Thread-Sicherheit: Instanzen von CryptoContext sind zustandsbehaftet und in der Regel nicht reentrant/thread-safe. Nebenläufige Verschlüsselungsoperationen erfordern separate Kontext-Instanzen je Thread.

Versionsvergleich KI-generiert · gemini-3.8-flash (via agy)

R21-11 → R22-11 redaktionell Vorgänger: FIG-70313ccefe6db35e
  • Tabellenlayout / Umbruch: Am oberen Bildrand ist das Operations-Fragment der tabellarischen Schnittstellendefinition von StreamCipherCtx (Methoden CountBytesInCache bis Start) als unvollständiger Umbruchabschnitt oberhalb des Klassendiagramms sichtbar; Tabellenkopf und Metadatenzeilen fehlen. Das eigentliche Klassendiagramm ist unverändert.
R22-11 → R23-11 redaktionell Nachfolger: FIG-672e05f032fe2470
  • Tabellenlayout / Umbruch: Das am oberen Bildrand als Umbruchfragment sichtbare Tabellenfragment der Schnittstelle StreamCipherCtx wurde entfernt. Das verbleibende UML-Klassendiagramm ist unverändert.

Aus dem Dokument extrahierter Text & Kontext

Beschriftungen im Schaubild:

CountBytesInCache Count number of bytes now kept in the context cache. | EstimateMaxInputSize Estimate maximal number of input bytes that may be processed for filling of an output buffer without overflow. | EstimateRequiredCapacity Estimate minimal required capacity of the output buffer, which is enough for saving a result of input data processing. | FinishBytes Process the final part of message (that may be not aligned to the block-size boundary). | GetBlockService Get the BlockService instance. | GetTransformation Get the kind of transformation configured for this context: Encrypt or Decrypt. | IsBytewiseMode Check the operation mode for the byte-wise property. | IsSeekableMode Check if the seek operation is supported in the current mode. | ProcessBlocks Process initial parts of message aligned to the block-size boundary. | ProcessBytes Process a non-final part of message (that is not aligned to the block-size boundary). | Reset Clear the crypto context. | Seek Set the position of the next byte within the stream of the encryption/decryption gamma. | SetKey Set (deploy) a key to the stream cihper algorithm context. | Operations: | Start Initialize the context for a new data stream processing or generation (depending from the primitive). | «aapFunctionalCluster» | Cryptography daemon-based | CryptoContext | «aapAPI,aapNativeInterface» | DecryptorPrivateCtx | + GetCryptoService() + ProcessBlock() + Reset() + SetKey() | CryptoContext | «aapAPI,aapNativeInterface» | EncryptorPrivateCtx | + GetCryptoService() + ProcessBlock() + Reset() + SetKey() | CryptoContext | «aapAPI,aapNativeInterface» | SymmetricBlockCipherCtx | + GetCryptoService() + GetTransformation() + ProcessBlock() + ProcessBlocks() + Reset() + SetKey() | ExtensionService | «aapAPI,aapNativeInterface» | CryptoService | + GetBlockSize() + GetMaxInputSize() + GetMaxOutputSize() | Adaptive Application | «use» «use» «use» «use»

Vorkommen in AUTOSAR-Releases (1)

Release Dokument Seite Nr. Bildunterschrift im Dokument
R22-11 AUTOSAR_EXP_SWArchitecture S. 76 9.46 Figure 9.46: CryptoService and CryptoContext Interfaces