Open jifang opened 11 months ago
import 'dart:typed_data'; import 'package:crypton/crypton.dart'; main() { ECKeypair ecKeypair = ECKeypair.fromRandom(); for (int i = 0; i < 100; i++) { String message = i.toRadixString(16); final List<int> codeUnits = message.codeUnits; final Uint8List unit8List = Uint8List.fromList(codeUnits); final signature = ecKeypair.privateKey.createSHA256Signature(unit8List); bool verified = ecKeypair.publicKey.verifySHA256Signature(unit8List, signature); if (!verified) { print('verified failed: $unit8List'); } } }
On average, the fail rate is about 5%. RSAKey seems fine though.
Hmm, that seems wired. I'm gonna look into it
On average, the fail rate is about 5%. RSAKey seems fine though.