You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -52,37 +51,68 @@ public HashAlgorithmWrapper_Implementation(IHashAlgorithmWrapperConfig config)
52
51
_config=config.Clone();
53
52
if(_config.InstanceFactory==null)
54
53
{
55
-
thrownewArgumentException($"{nameof(config)}.{nameof(config.InstanceFactory)} has not been set.",$"{nameof(config)}.{nameof(config.InstanceFactory)}");
54
+
thrownewArgumentException($"{nameof(_config)}.{nameof(_config.InstanceFactory)} has not been set.",$"{nameof(_config)}.{nameof(_config.InstanceFactory)}");
56
55
}
57
56
58
-
using(varhashAlgorithm=_config.InstanceFactory())
57
+
hashAlgorithm=_config.InstanceFactory()??thrownewInvalidOperationException("The hash algorithm factory returned null.");
thrownewInvalidOperationException($"{nameof(config)}.{nameof(config.HashSizeInBits)} does not match the underlying {nameof(config.InstanceFactory)} hash algorithm's size. Expected {config.HashSizeInBits} bits but got {hashAlgorithm.HashSize} bits.");
63
-
}
61
+
thrownewInvalidOperationException($"{nameof(_config)}.{nameof(_config.HashSizeInBits)} does not match the underlying {nameof(_config.InstanceFactory)} hash algorithm's size. Expected {_config.HashSizeInBits} bits but got {hashAlgorithm.HashSize} bits.");
0 commit comments