Updated encryption logic according to toxcore changes