Neoscrypt argument validation
@@ -18,6 +18,7 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+using System;
using MiningCore.Contracts;
using MiningCore.Native;
@@ -35,6 +36,7 @@ namespace MiningCore.Crypto.Hashing.Algorithms
public byte[] Digest(byte[] data, params object[] extra)
{
Contract.RequiresNonNull(data, nameof(data));
+ Contract.Requires<ArgumentException>(data.Length == 80, $"{nameof(data)} length must be exactly 80 bytes");
var result = new byte[32];
