This caused secret key files to become close to MAXINT bytes, as the unsigned int that is the private key size would be subtracted from MAXINT when its negative was used as offset.
The variable sm should contain the signature and the message, not the message and the signature (i.e. the order is crucial).
This makes it easier to mix and match with other implementations for compatibility testing.