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
Fix SHA hash OOB on strings that are exact multiples of message chunk size (rapidsai#21004)
Closesrapidsai#21003
This is a small change to SHA hash processing to handle the case where the input data length is an exact multiple of message chunk size. Taking SHA256 on strlen 128 for instance: after copying/hashing the first 64 bytes, the existing loop checks 128 > 64 + 64:
```cpp
while (len > Hasher::message_chunk_size + copylen)
```
which does not trigger and `process()` returns with an unhashed 64 bytes left in the buffer.
Subsequently, `finalize()` tries to write the end message flag at buffer[64] (during `thrust::fill_n`), triggering the error in the issue.
Authors:
- Rishi Chandra (https://github.com/rishic3)
Approvers:
- Lawrence Mitchell (https://github.com/wence-)
- David Wendt (https://github.com/davidwendt)
URL: rapidsai#21004
0 commit comments