Skip to content

Commit c77dfa2

Browse files
committed
Lots of improvements for package:cryptography.
A short summary of the changes: * Better test coverage helped to identify bugs. * Some small API changes that are unlikely to affect developers. For example, hash sinks now have `outputBytes` and length properties. * The documentation was improved.
1 parent 8d9d4ac commit c77dfa2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3117
-1653
lines changed

cryptography/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## 2.4.0
2+
* Fixes many issues found by adding more tests. Also improves documentation.
3+
* Improves performance of SHA256, HMAC, and PBKDF2 by cutting unnecessary state allocations and
4+
futures.
5+
* Some small API refactoring and new class members that don't really affect the publicly visible
6+
API. We plan to address most API design issues (some discussed in the issue tracker) in the next
7+
major version (3.x).
8+
* Adds support for seck256k1 key type ([#135](https://github.com/dint-dev/cryptography/pull/135)).
9+
110
## 2.3.0
211
* Fixes some small issues.
312
* Improves documentation.

cryptography/README.md

Lines changed: 107 additions & 78 deletions
Large diffs are not rendered by default.

cryptography/lib/browser.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
// limitations under the License.
1414

1515
/// @nodoc
16+
@Deprecated(
17+
'This library will be removed in a future major version.'
18+
' You can find `BrowserCryptography` class in "package:cryptography/cryptography.dart".',
19+
)
1620
library cryptography.browser;
1721

1822
export 'src/browser/browser_cryptography_when_not_browser.dart'

cryptography/lib/dart.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ export 'src/dart/aes_cbc.dart';
2323
export 'src/dart/aes_ctr.dart';
2424
export 'src/dart/aes_gcm.dart';
2525
export 'src/dart/argon2.dart';
26-
export 'src/dart/base_classes.dart';
2726
export 'src/dart/blake2b.dart';
2827
export 'src/dart/blake2s.dart';
2928
export 'src/dart/chacha20.dart';
30-
export 'src/dart/chacha20_poly1305_aead.dart';
31-
export 'src/dart/cipher_base_classes.dart';
29+
export 'src/dart/chacha20_poly1305_aead_mac_algorithm.dart';
3230
export 'src/dart/cryptography.dart';
31+
export 'src/dart/dart_cipher.dart';
32+
export 'src/dart/dart_hash_algorithm.dart';
33+
export 'src/dart/dart_key_exchange_algorithm.dart';
34+
export 'src/dart/dart_mac_algorithm.dart';
35+
export 'src/dart/dart_signature_algorithm.dart';
3336
export 'src/dart/ecdh.dart';
3437
export 'src/dart/ecdsa.dart';
3538
export 'src/dart/ed25519.dart';
@@ -40,6 +43,8 @@ export 'src/dart/pbkdf2.dart';
4043
export 'src/dart/poly1305.dart';
4144
export 'src/dart/rsa_pss.dart';
4245
export 'src/dart/rsa_ssa_pkcs1v15.dart';
43-
export 'src/dart/sha1_sha2.dart';
46+
export 'src/dart/sha1.dart';
47+
export 'src/dart/sha256.dart';
48+
export 'src/dart/sha512.dart';
4449
export 'src/dart/x25519.dart';
4550
export 'src/dart/xchacha20.dart';

cryptography/lib/src/browser/hkdf.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class BrowserHkdf extends Hkdf {
3434
: super.constructor();
3535

3636
@override
37-
Future<SecretKey> deriveKey({
37+
Future<SecretKeyData> deriveKey({
3838
required SecretKey secretKey,
3939
List<int> nonce = const <int>[],
4040
List<int> info = const <int>[],
@@ -50,7 +50,7 @@ class BrowserHkdf extends Hkdf {
5050
jsCryptoKey,
5151
8 * outputLength,
5252
);
53-
return SecretKey(Uint8List.view(byteBuffer));
53+
return SecretKeyData(Uint8List.view(byteBuffer));
5454
}
5555

5656
Future<web_crypto.CryptoKey> _jsCryptoKey(SecretKey secretKey) async {

cryptography/lib/src/browser/rsa_pss.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import 'hash.dart';
3232
class BrowserRsaPss extends RsaPss {
3333
static const _webCryptoAlgorithm = 'RSA-PSS';
3434

35+
@override
3536
final int nonceLengthInBytes;
3637

3738
@override

0 commit comments

Comments
 (0)