Re: [Ocf-linux-users] Computing SHA1 for large files
Brought to you by:
david-m
From: David M. <dav...@mc...> - 2012-06-20 00:42:58
|
Jivin Ajay Matai lays it down ... > 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. I would recommend you use openssl (libcrpyto) to do this using the published openssl API's. Unless you are on a very resource constrained device which cannot afford to have openssl installed that is. The openssl API's are better documented, will let your application run on multiple different HW accelerated solutions including OCF, so it gives you a good plan going forward. You will need to load the cryptodev driver to use OCF with openssl. If openssl isn't an options let us know and I'll see what I can dig up in way of an example talking directly to OCF, Cheers, Davidm -- David McCullough, dav...@mc..., Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org |