Skip to content
Juvix imports

module arch.node.engines.decryption_messages;

import prelude open;
import arch.node.types.identities open;

Decryption Messages

Message interface

MsgDecryptionRequest RequestDecryption

type RequestDecryption := mkRequestDecryption@{data : Ciphertext};

A RequestDecryption instructs a decryption engine instance to decrypt data.

Arguments
data:
The encrypted ciphertext to decrypt.

MsgDecryptionResponse ResponseDecryption

type ResponseDecryption :=
mkResponseDecryption@{
data : Plaintext;
err : Option String;
};

A ResponseDecryption contains the data decrypted by a decryption engine instance in response to a RequestDecryption.

Arguments
data:
The decrypted data.
err:
An error message if decryption failed.

DecryptionMsg

type DecryptionMsg :=
| MsgDecryptionRequest RequestDecryption
| MsgDecryptionResponse ResponseDecryption;

Message sequence diagrams

Decryption Sequence

sequenceDiagram
    participant C as Client
    participant DE as Decryption Engine

    C->>DE: RequestDecryption(encryptedData)
    Note over DE: Attempt to decrypt data
    alt Decryption Successful
        DE-->>C: ResponseDecryption(decryptedData, err=none)
    else Decryption Failed
        DE-->>C: ResponseDecryption(emptyByteString, err="Decryption Failed")
    end
Sequence diagram for decryption.

Engine Components