diff --git a/cryptography/lib/src/browser/hmac.dart b/cryptography/lib/src/browser/hmac.dart index ef7cce35..ccc8278c 100644 --- a/cryptography/lib/src/browser/hmac.dart +++ b/cryptography/lib/src/browser/hmac.dart @@ -66,13 +66,6 @@ class BrowserHmac extends Hmac { Future _jsCryptoKey(SecretKey secretKey) async { final secretKeyBytes = await secretKey.extractBytes(); - if (secretKeyBytes.isEmpty) { - throw ArgumentError.value( - secretKey, - 'secretKey', - 'SecretKey bytes must be non-empty', - ); - } return await web_crypto.importKeyWhenRaw( web_crypto.jsUint8ListFrom(secretKeyBytes), web_crypto.HmacImportParams( diff --git a/cryptography/lib/src/dart/hmac.dart b/cryptography/lib/src/dart/hmac.dart index 06e41baf..07a1991e 100644 --- a/cryptography/lib/src/dart/hmac.dart +++ b/cryptography/lib/src/dart/hmac.dart @@ -120,13 +120,6 @@ class _DartHmacSink extends MacSink with DartMacSinkMixin { 'AAD is not supported by HMAC', ); } - if (secretKey.bytes.isEmpty) { - throw ArgumentError.value( - secretKey, - 'secretKey', - 'Secret key must be non-empty', - ); - } _isClosed = false; var hmacKey = secretKey.bytes; var eraseKey = false;