feat: Check the HMAC during decryption

This commit is contained in:
2022-08-03 16:41:33 +02:00
parent 6d8238475c
commit 8d222a160f
3 changed files with 23 additions and 1 deletions

View File

@@ -7,3 +7,16 @@ List<int> concat(List<List<int>> inputs) {
return tmp;
}
/// Compares the two lists [a] and [b] and return true if [a] and [b] are index-by-index
/// equal. Returns false, if they are not "equal";
bool listsEqual(List<int> a, List<int> b) {
// TODO(Unknown): Do we need to use a constant time comparison?
if (a.length != b.length) return false;
for (var i = 0; i < a.length; i++) {
if (a[i] != b[i]) return false;
}
return true;
}