package
10.9.0+incompatible
Repository: https://github.com/status-im/status-go.git
Documentation: pkg.go.dev

# README

protocol/encryption package

Hash ratchet encryption

encryptor.GenerateHashRatchetKey() generates a hash ratchet key and stores it in in the DB. There, 2 new tables are created: hash_ratchet_encryption and hash_ratchet_encryption_cache. Each hash ratchet key is uniquely identified by the (groupId, keyId) pair, where keyId is derived from a clock value.

protocol.BuildHashRatchetKeyExchangeMessage builds an 1-on-1 message containing the hash ratchet key, given it's ID.

protocol.BuildHashRatchetMessage builds a hash ratchet message with arbitrary payload, given groupId. It will use the latest hash ratchet key available. encryptor.encryptWithHR encrypts the payload using Hash Ratchet algorithms. Intermediate hashes are stored in hash_ratchet_encryption_cache table.

protocol.HandleMessage uses encryptor.decryptWithHR fn for decryption.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

ExtractIdentity extracts the identity key from a given bundle.
No description provided by the author
GetCurrentTime64 returns the current unix time in milliseconds.
New creates a new ProtocolService instance.
NewBundleContainer creates a new BundleContainer from an identity private key.
DB and migrations are shared between encryption package and its sub-packages.
PerformActiveDH performs a Diffie-Hellman exchange using a public key and a generated ephemeral key.
PerformActiveX3DH takes someone else's bundle and calculates shared secret.
PerformDH generates a shared key given a private and a public key.
PerformPassiveX3DH handles the part of the protocol where our interlocutor used our bundle, with ID of the signedPreKey, we loaded our identity key and the correct signedPreKey and we perform X3DH.
SignBundle signs the bundle and refreshes the timestamps.
VerifyBundle checks that a bundle is valid.

# Constants

No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrNoPayload means that there was no payload found in the received protocol message.
No description provided by the author
ErrNotPairedDevice means that we received a message signed with our public key but from a device that has not been paired.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
RatchetInfo holds the current ratchet state.
No description provided by the author

# Type aliases

No description provided by the author