mirror of
https://github.com/signalapp/libsignal.git
synced 2026-05-08 16:13:04 +02:00
This known-answer test was originally ported over from libsignal-protocol-java, but did not produce the same results. Why? Because one of the private keys chosen by libsignal-protocol-java for its test was unclamped, while libsignal-the-Rust-implementation always clamps private keys as part of deserialization, not just generation. Consequently, the public key didn't actually correspond to the private key according to our modern libsignal. Rather than try to line up exactly with what libsignal-protocol-java was coincidentally doing, this commit clamps the private key, computes the resulting public key, and verifies a new consistent-between-both-sides outcome.