ParentFull threadgen3·Matrix uses the same encryption as signal, one of their implementations can be found here: https://gitlab.matrix.org/matrix-org/olmView on HN