novusnota / tonutils-dart

Comprehensive Dart SDK for interacting with TON Blockchain. When combined with Flutter can be used for any popular platform out there!
https://pub.dev/packages/tonutils
Apache License 2.0
22 stars 2 forks source link

Wrong signature length #1

Closed krigga closed 1 year ago

krigga commented 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.

novusnota commented 1 year ago

Thanks for spotting the issue, looking into it now

novusnota commented 1 year ago

@krigga thanks again, fixed and tested correct behavior in 3a83b64