Skip to content
Juvix imports

module arch.node.engines.decryption_messages;

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


Decryption Messages

Message interface

type DecryptionMsg :=
| MsgDecryptionRequest RequestDecryption
| MsgDecryptionReply ReplyDecryption;

Message sequence diagrams

Request 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: ReplyDecryption(decryptedData, err=none)
    else Decryption Failed
        DE-->>C: ReplyDecryption(emptyByteString, err="Decryption Failed")
    end
Sequence diagram for decryption.

Message types

RequestDecryption

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

A RequestDecryption instructs a decryption engine instance to decrypt data.

Arguments
data:
The encrypted ciphertext to decrypt.

ReplyDecryption

type ReplyDecryption :=
mkReplyDecryption@{
data : Plaintext;
err : Option String;
};

A ReplyDecryption 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
| MsgDecryptionReply ReplyDecryption;

Engine components