Skip to content
Juvix imports

module arch.node.engines.encryption_messages;

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

Encryption Messages

Message interface

type EncryptionMsg :=
| EncryptRequest {
data : Plaintext;
externalIdentity : ExternalIdentity;
useReadsFor : Bool
}
| EncryptResponse {
ciphertext : Ciphertext;
err : Option String
};

EncryptRequest message

EncryptRequest

EncryptRequest {
  data : Plaintext;
  externalIdentity : ExternalIdentity;
  useReadsFor : Bool
}

An EncryptRequest instructs the Encryption Engine to encrypt data to a particular external identity, possibly using known reads_for relationships.

  • data: The data to encrypt.
  • externalIdentity: The external identity to encrypt to.
  • useReadsFor: Whether to use known reads_for relationships or not.

EncryptResponse message

EncryptResponse

EncryptResponse {
  ciphertext : Ciphertext;
  err : Option String
}

An EncryptResponse contains the data encrypted by the Encryption Engine in response to an EncryptRequest.

  • ciphertext: The encrypted data.
  • err: An error message if encryption failed.

Message sequence diagrams

Encryption Sequence (Without ReadsFor evidence)

sequenceDiagram
    participant Client
    participant EncryptionEngine

    Client->>EncryptionEngine: EncryptRequest (useReadsFor: false)
    Note over EncryptionEngine: Encrypt commitment
    EncryptionEngine->>Client: EncryptResponse
Sequence diagram for verification (no reads for).

Encryption Sequence (With ReadsFor evidence)

sequenceDiagram
    participant Client
    participant EncryptionEngine
    participant ReadsForEngine

    Client->>EncryptionEngine: EncryptRequest (useReadsFor: true)
    EncryptionEngine->>ReadsForEngine: QueryReadsForEvidenceRequest
    Note over ReadsForEngine: Retrieve evidence
    ReadsForEngine->>EncryptionEngine: QueryReadsForEvidenceResponse
    Note over EncryptionEngine: Encrypt commitment using ReadsFor evidence
    EncryptionEngine->>Client: EncryptResponse
Sequence diagram for verification (reads for).

Engine Components

  • Encryption Engine Environment
  • Encryption Engine Dynamics