Hello Team,
I am trying to use PKTE peripheral to calculate SHA hash, however I want to calculate it iteratively. eg 128 words. I want it to calculate in iteration of 64 words.
Could you please share me any example using PKTE peripheral which calculates hash in intermediate steps. The currrent example, just calculates the hash over entire buffer length.
Specifically, how to modify these variables in SHA calculations.
Thank you,
Regards
Hi Newton,
Thank you for your inquiry.
Could you please let us know which Sharc processor that you are using.
Best Regards,
Santhakumari.V
santha.vijay ADSP 21593
Hi Newton,
Unfortunately we are not having example code per your requirement.
But we have an example code(Baremetal) for Autonomous ring mode, Target command mode and Direct Host mode for ADSP-SC58x. Refer the below FAQs of PKTE module to do encryption, decryption and hashing operation in parallel for ADSP-SC58x/2158x.
ez.analog.com/.../adsp-sc58x-2158x-pkte-encryption-hashing---example-code
ez.analog.com/.../adsp-sc58x-2158x-pkte-hashing-decryption---example-code
ez.analog.com/.../adsp-sc58x-2158x-pkte-encryption---example-code
Please take these as a reference and modify it accordingly.
Also, SSLDD Driver APIs are available for this PKTE module. For more details please refer to the below help path
CrossCore® Embedded Studio 2.12.0 > System Run-Time Documentation > System Services and Device Drivers > ADSP-SC594 Family (SHARC+ Core) API Reference > Modules
For more information about PKTE peripheral, please refer ADSP-21593 processor hardware manual at the link below:
www.analog.com/.../adsp-2159x-sc591-592-594-hrm.pdf
Hope this helps.
Best Regards,
Santhakumari.V
Your example don't have much detail about how to calculate partial result of SHA and use those partial results to continue further. I went throught the HRM. However, I cant find out where can I enter the initial values for calculation.
Could you please specify the register or some reference?
Thank you,
Regards
Hi Newton,
Unfortunately we do not have readily available code as per your requirements.
But we hope the below ENote with associated codes would be helpful as a reference for your requirements
www.analog.com/.../EE386v01.pdf
www.analog.com/.../EE386v01.zip
Also in HRM you can refer page number 2654 / 3790 for Calculating SHA in Direct Host Mode from PKTE Programming Examples.
Hope this helps.
Best Regards,
Santhakumari.V
Hello santha.vijay
Do you have details about this HASHSRC
All the examples use value 3. Can you please guide me how to use the options 0 and 2?
1. How does the byte count impact the calculations?
2. More detail on both these mode.
Thank you
Hello santha.vijay
I tried to update the Inner digest registers; however, the values are different than expected. Could you please help me with it.
Thank you
Hi Newton,
Apologies for the delay in response. Please find the attached code (ADSP-SC594) where we were able to implement the block-based Hash protocol using Crypto Driver.
This will require one change in crypto driver. Details below:
Since this is assuming block-based operation, the intermediate digest needs to be picked up from the previous operation. This was getting zero initialized by the crypto API. By commenting it, we can preserve the settings in the PKTE register and use that for next operation.
Please make these changes in the crypto driver locally by making it a part of the project itself. We have also attached the modified file, based on CCES 2.11.1.
HASHSRC refers to the initial state of the Hash functions which is often non-zero. So as per register description, the HASH SRC can be chosen to be passed from SA records, or State registers or it can be algorithm specific which will be loaded on its own.
Hope this helps.
Best Regards,
Santhakumari.K
Hello santha.vijay
Could you please cascade this to your internal team, so that they can update the same.
Is it possible for you to suggest some timeline when these changes would be available?
Thank you,
Regards