Amarula.Protocol.Signal.Group.GroupCipher (amarula v0.1.0)

View Source

Handles encryption and decryption of group messages using the Signal protocol.

This module provides the main interface for group message encryption/decryption, managing sender keys and coordinating with the sender key store.

Summary

Functions

decrypt(sender_key_store, sender_key_name, encrypted_message)

@spec decrypt(map(), Amarula.Protocol.Signal.Group.SenderKeyName.t(), binary()) ::
  {:ok, binary()} | {:error, String.t()}

Decrypts a group message.

Parameters

  • sender_key_store - The store for managing sender keys
  • sender_key_name - The name identifying the sender key
  • encrypted_message - The encrypted message to decrypt

Returns

  • {:ok, plaintext} - Success with decrypted message
  • {:error, reason} - Error with reason

encrypt(sender_key_store, sender_key_name, plaintext)

@spec encrypt(map(), Amarula.Protocol.Signal.Group.SenderKeyName.t(), binary()) ::
  {:ok, binary()} | {:error, String.t()}

Encrypts a message for group communication.

Parameters

  • sender_key_store - The store for managing sender keys
  • sender_key_name - The name identifying the sender key
  • plaintext - The message to encrypt

Returns

  • {:ok, encrypted_message} - Success with encrypted message
  • {:error, reason} - Error with reason