From d6f398af40c055e1cdf99274cc46628c845aa7da Mon Sep 17 00:00:00 2001 From: Pointcheval Hugo Date: Tue, 16 Feb 2021 21:42:06 +0100 Subject: [PATCH] Change some outputs --- example/lib/widgets/output.dart | 7 ++++++- lib/native_crypto.dart | 5 +++-- lib/src/key.dart | 9 +-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/example/lib/widgets/output.dart b/example/lib/widgets/output.dart index a36123e..45bdccb 100644 --- a/example/lib/widgets/output.dart +++ b/example/lib/widgets/output.dart @@ -1,5 +1,7 @@ // Copyright (c) 2020 // Author: Hugo Pointcheval +import 'dart:developer'; + import 'package:flutter/material.dart'; class Output extends StatelessWidget { @@ -15,14 +17,17 @@ class Output extends StatelessWidget { final bool editable; void print(String message) { + log(message, name: "NativeCrypto Example"); textEditingController.text = message; } void append(String message) { + log(message, name: "NativeCrypto Example"); textEditingController.text += message; } void appendln(String message) { + log(message, name: "NativeCrypto Example"); textEditingController.text += message + "\n"; } @@ -41,7 +46,7 @@ class Output extends StatelessWidget { enableInteractiveSelection: true, readOnly: editable ? false : true, minLines: large ? 3 : 1, - maxLines: large ? 50 : 5, + maxLines: large ? 500 : 5, decoration: InputDecoration(border: OutlineInputBorder()), controller: textEditingController, ), diff --git a/lib/native_crypto.dart b/lib/native_crypto.dart index fe6c4c7..b1257b2 100644 --- a/lib/native_crypto.dart +++ b/lib/native_crypto.dart @@ -1,4 +1,4 @@ -// Copyright (c) 2020 +// Copyright (c) 2021 // Author: Hugo Pointcheval export './src/exceptions.dart'; export './src/key.dart'; @@ -13,6 +13,7 @@ export './src/utils.dart'; export './src/sym/AES.dart'; //export './src/asym/RSA.dart'; -const String version = "0.0.5"; +const String version = "0.0.6"; const String author = "Hugo Pointcheval"; const String website = "https://hugo.pointcheval.fr/"; +const String repository = "https://github.com/hugo-pcl/native-crypto-flutter"; diff --git a/lib/src/key.dart b/lib/src/key.dart index d451ba5..3ee2db8 100644 --- a/lib/src/key.dart +++ b/lib/src/key.dart @@ -1,7 +1,6 @@ -// Copyright (c) 2020 +// Copyright (c) 2021 // Author: Hugo Pointcheval -import 'dart:developer'; import 'dart:typed_data'; import 'package:flutter/services.dart'; @@ -60,11 +59,8 @@ class SecretKey extends Key { try { Uint8List _key = await Platform().keygen(size); - log("Generated SecretKey size: ${_key.length * 8} bits (${_key.length} bytes)", - name: "NativeCrypto"); return SecretKey.fromBytes(_key, algorithm: algorithm); } on PlatformException catch (e) { - log(e.message, name: "NativeCrypto"); throw KeyException(e); } } @@ -109,10 +105,7 @@ class KeyPair extends Key { _publicKey = PublicKey.fromBytes(kp.first); _privateKey = PrivateKey.fromBytes(kp.last); _algo = "RSA"; - log("Generated public and private keys size: ${_publicKey.encoded.length * 8} bits (${_publicKey.encoded.length} bytes)", - name: "NativeCrypto"); } on PlatformException catch (e) { - log(e.message, name: "NativeCrypto"); throw KeyException(e); } } else {