Re: [Ocf-linux-users] Computing SHA1 for large files
Brought to you by:
david-m
From: Ajay M. <aj...@sy...> - 2012-06-21 19:02:43
|
At this point, I am wondering if it is even possible to use OCF SHA1 for any buffers greater than 32K? If I call single CIOCCRYPT with 32K data block that works fine. If I break the same 32K block into 2 of 16k each and call CIOCCRYPT in a rolling fashion - the result is total garbage. Also, not able to get anything bigger than 32K block working: get a ioctl: Invalid argument error. Any insight will be very helpful. Thanks, --ajay -----Original Message----- From: Ajay Matai Sent: Tuesday, June 19, 2012 4:02 PM To: 'ocf...@li...' Subject: Computing SHA1 for large files Hello, I am a beginner at OCF interface. I have been trying to compute SHA1 hash for a large file (say 2GB). I thought, I could read the file say 8192 sized block at a time, call CIOCCRYPT with updated buffer. In the end, call CIOCCRYPT one last time with src=NULL and len=0. I should be able to get the mac back in the buffer pointed by mac. Tried it but this doesn't seem to work. What is the right way of working with large files and OCF framework. I know very basic question but any amount of googling and stack-overflowing didn't help. Thanks! -ajay |