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
I have attached the file here that is the HASH generator for the SHA sha.txt
Could you give me a suggestion for this code?
We are checking the hardware crypto accelerator using the /dev/crypto, and the code is working as expected for the lower file size.
If it is more than the 20/30MB file our system will hang because it cannot handle the large memory at a time. So we made changes in the code as below in the code sha1.txt
but in this code, we are not able to get the HASH value as we expected.
Can anyone suggest a different way to handle the whole data?
Activity
Ashok-d-attikatti commentedon Sep 18, 2024
Hello,
Any comment on this.?
Thanks,
Ashoka A D
cristian-stoica commentedon Sep 18, 2024
@Ashok-d-attikatti Have you looked at https://github.com/cryptodev-linux/cryptodev-linux/blob/master/examples/sha-copy.c ?
It seems to do what you want. In particular you should use COP_FLAG_UPDATE for intermediary chunks and COP_FLAG_FINAL at the end.
Ashok-d-attikatti commentedon Sep 18, 2024
Hello @cristian-stoica ,
I have used the COP_FLAG_UPDATE and COP_FLAG_FINAL flags while doing work around methods, but did not work as expected.
Ashok-d-attikatti commentedon Sep 19, 2024
Look at this example: https://github.com/cryptodev-linux/cryptodev-linux/blob/master/examples/sha-copy.c. This will not work for a file, and the data size is small as well. If we want a larger file size, would this work?