When signing detached, there are 2 more bytes at the beginning of the signature then what is expected.
https://openquantumsafe.org/liboqs/algorithms/sig/dilithium.html
There should be 4595 bytes
In the test below the sig is 4597 bytes
const test = async () => {
const keyPair = await dilithium.keyPair();
var sig = await dilithium.signDetached(Buffer.from("this is a test", 'utf8'), keyPair.privateKey)
console.log(sig.length)
}
If the two bytes are trimmed, the signature is then verifiable by other implementations of dilithium.