Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnetwork committed Sep 27, 2023
1 parent 5e56fb4 commit ae8a98b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
* TransactionBuilder
* Fix bugs

## 1.0.2
## 1.0.3

* Update dependencies
26 changes: 13 additions & 13 deletions lib/src/crypto/ec/ec_encryption.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ final prime = BigInt.parse(
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F",
radix: 16);

final ZERO32 = Uint8List.fromList(List.generate(32, (index) => 0));
final EC_GROUP_ORDER = hexToBytes(
final _zero32 = Uint8List(32);
final _ecGroupOrder = hexToBytes(
"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");
final EC_P = hexToBytes(
final _ecP = hexToBytes(
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f");
final secp256k1 = ECCurve_secp256k1();
final n = secp256k1.n;
Expand All @@ -29,10 +29,10 @@ BigInt nDiv2 = n >> 1;

bool isPrivate(Uint8List x) {
if (!isScalar(x)) return false;
return _compare(x, ZERO32) > 0 &&
return _compare(x, _zero32) > 0 &&

/// > 0
_compare(x, EC_GROUP_ORDER) < 0;
_compare(x, _ecGroupOrder) < 0;

/// < G
}
Expand Down Expand Up @@ -60,10 +60,10 @@ bool isPoint(Uint8List p) {
var t = p[0];
var x = p.sublist(1, 33);

if (_compare(x, ZERO32) == 0) {
if (_compare(x, _zero32) == 0) {
return false;
}
if (_compare(x, EC_P) == 1) {
if (_compare(x, _ecP) == 1) {
return false;
}
try {
Expand All @@ -75,10 +75,10 @@ bool isPoint(Uint8List p) {
return true;
}
var y = p.sublist(33);
if (_compare(y, ZERO32) == 0) {
if (_compare(y, _zero32) == 0) {
return false;
}
if (_compare(y, EC_P) == 1) {
if (_compare(y, _ecP) == 1) {
return false;
}
if (t == 0x04 && p.length == 65) {
Expand All @@ -93,7 +93,7 @@ bool isScalar(Uint8List x) {

bool isOrderScalar(x) {
if (!isScalar(x)) return false;
return _compare(x, EC_GROUP_ORDER) < 0;
return _compare(x, _ecGroupOrder) < 0;

/// < G
}
Expand All @@ -103,8 +103,8 @@ bool isSignature(Uint8List value) {
Uint8List s = value.sublist(32, 64);

return value.length == 64 &&
_compare(r, EC_GROUP_ORDER) < 0 &&
_compare(s, EC_GROUP_ORDER) < 0;
_compare(r, _ecGroupOrder) < 0 &&
_compare(s, _ecGroupOrder) < 0;
}

bool _isPointCompressed(Uint8List p) {
Expand All @@ -130,7 +130,7 @@ Uint8List? pointAddScalar(Uint8List p, Uint8List tweak, bool compress) {
if (!isOrderScalar(tweak)) throw ArgumentError("Bad Tweek");
bool compressed = assumeCompression(compress, p);
ECPoint? pp = _decodeFrom(p);
if (_compare(tweak, ZERO32) == 0) {
if (_compare(tweak, _zero32) == 0) {
return pp!.getEncoded(compressed);
}
BigInt tt = decodeBigInt(tweak);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/provider/provider.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// ignore_for_file: constant_identifier_names
// ignore_for_file: constant_identifier_names

import 'package:bitcoin_base/src/models/network.dart';

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: bitcoin_base
description: A comprehensive Bitcoin library for creating/signing and spending P2PK, P2PKH, P2SH, P2WPKH, P2WSH, Taproot ...
version: 1.0.2
version: 1.0.3
homepage: "https://github.com/mrtnetwork/bitcoin_base"
repository: "https://github.com/mrtnetwork/bitcoin_base"
environment:
Expand Down

0 comments on commit ae8a98b

Please sign in to comment.