Closed krigga closed 1 year ago
TON expects 64 byte long signatures. This way https://github.com/novusnota/tonutils-dart/blob/e7179a1d3d82971dda67300b6a4cca65e138e0e0/lib/src/crypto/nacl/sign.dart#L12 produces a concatenation of signature and something else and is 96 bytes long. You need to use signingKey.sign(Uint8List.fromList(data)).signature.toUint8List();, otherwise signature check fails in the wallet smart contract for example.
signingKey.sign(Uint8List.fromList(data)).signature.toUint8List();
Thanks for spotting the issue, looking into it now
@krigga thanks again, fixed and tested correct behavior in 3a83b64
TON expects 64 byte long signatures. This way https://github.com/novusnota/tonutils-dart/blob/e7179a1d3d82971dda67300b6a4cca65e138e0e0/lib/src/crypto/nacl/sign.dart#L12 produces a concatenation of signature and something else and is 96 bytes long. You need to use
signingKey.sign(Uint8List.fromList(data)).signature.toUint8List();
, otherwise signature check fails in the wallet smart contract for example.