Skip to content
Snippets Groups Projects
Commit 5e9ddca5 authored by Jono Wenger's avatar Jono Wenger
Browse files

Add functions to get ChannelDbCipher from tracker

parent d639eea8
No related branches found
No related tags found
3 merge requests!510Release,!422Add cipher bindings,!340Project/channels
......@@ -1455,6 +1455,12 @@ func (ct *channelDbCipherTracker) delete(id int) {
delete(ct.tracked, id)
}
// GetChannelDbCipherTrackerFromID returns the ChannelDbCipher with the
// corresponding ID in the tracker.
func GetChannelDbCipherTrackerFromID(id int) (*ChannelDbCipher, error) {
return channelDbCipherTrackerSingleton.get(id)
}
// NewChannelsDatabaseCipher constructs a ChannelDbCipher object.
//
// Parameters:
......@@ -1493,6 +1499,11 @@ func NewChannelsDatabaseCipher(cmixID int, password []byte,
return channelDbCipherTrackerSingleton.make(c), nil
}
// GetID returns the ID for this ChannelDbCipher in the channelDbCipherTracker.
func (c *ChannelDbCipher) GetID() int {
return c.id
}
// Encrypt will encrypt the raw data. It will return a ciphertext. Padding is
// done on the plaintext so all encrypted data looks uniform at rest.
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment