On the Matrix side, we explicitly didn't forklift the same library - we wrote our own cleanroom implementation from scratch, first in C/C++ as https://gitlab.matrix.org/matrix-org/olm and then in rust as https://github.com/matrix-org/vodozemac. They have no code at all in common with libsignal, and are Apache licensed rather than copyleft, and have been independently audited, independent of whatever Signal gets up to (https://matrix.org/blog/2016/11/21/matrix-s-olm-end-to-end-e... and https://matrix.org/blog/2022/05/16/independent-public-audit-... respectively)