From 0f1d6c627151d0a92ee9fa2a69e99f24f7f26616 Mon Sep 17 00:00:00 2001 From: Stephen Akridge Date: Tue, 5 Mar 2019 11:17:59 -0800 Subject: [PATCH] Check for no entries left in blocktree in a given slot There may not be ENTRIES_PER_SEGMENT entries a slot, if so then we will hang waiting for more. --- core/src/chacha_cuda.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/chacha_cuda.rs b/core/src/chacha_cuda.rs index 05c40bcbd6..5d9aa31865 100644 --- a/core/src/chacha_cuda.rs +++ b/core/src/chacha_cuda.rs @@ -54,6 +54,9 @@ pub fn chacha_cbc_encrypt_file_many_keys( "chacha_cuda: encrypting segment: {} num_entries: {} entry_len: {}", segment, num_entries, entry_len ); + if num_entries == 0 { + break; + } let entry_len_usz = entry_len as usize; unsafe { chacha_cbc_encrypt_many_sample(