-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconstruction of key is not working. #9
Comments
I have also had failures reconstructing the key but succeed reconstructing the key in the past. IIRC, reconstruction only succeeded when the micro sdcard was formatted with the "official" sd association formatter, found here: Linux: https://www.sdcard.org/downloads/sd-memory-card-formatter-for-linux/ It is strongly recommended to use that formatter in the adafruit sd breakout board docs, see here: https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial/formatting-notes regards, myndcryme |
@myndcryme Yes, I formatted it with the above-mentioned formatter only. Even though challenger data and helper data are generated and saved in sd card, I wasn't able to reconstruct the key |
Seems like you have done everything correctly so there must be an issue with the code. I have a guess of why it is failing so I'll take a look. |
@myndcryme thank you |
@jafeelv - Reconstruction is working for me, however I am having an issue with the PUF-encrypt step (I'll discuss another time). Are you seeing "error" in your output when performing reconstruction? What size micro SD are you using? If the card is too large the SDformatting tool above formats it as exFAT which will not work. |
@myndcryme Thanks for the reply. I'm using 16GB MicroSD and not showing "error". But, if there is problem with SDformatting tool or SD card size, will it be able to save helper data and challenger data into SD card? |
16GB formats FAT32 so that is not the problem. Just to be clear, no PUF key is displayed in the terminal, correct? |
@myndcryme no PUF key is displayed.. it shows only "Initializing SD card...initialization done." |
@jafeelv Bear with me, I am still working on identifying the cause but made good progress today. |
@myndcryme Sure. Thanks |
@jafeelv I figure once your sd card is initialized you get nothing more because the SD.open() call is failing. This has been happening to me not in reconstruction, but in puf-encrypt the SD.open() call inside readHelperDatafromMicroSD() fails to open the helper file. I think we are experiencing the same problem. This has been difficult to pin down because the problem appears to be within one of the SD dependencies, not this puf codebase. arduino-libraries/SD.h and related libs have some weird bugs. At some point my installation broke and I'm pretty sure it was because platformio auto updated my SD dependencies. I'm not 100% sure, but I think I know the bug responsible, which is currently labeled as an imperfection so I don't expect a fix and a workaround is needed. I found that inlining both the readHelperDatafromMicroSD() and readSRAMDatafromMicroSD() is a workaround. Don't allow the compiler to optimize the inline away with a simple inline. Add the following before both readHelper and readSRAM function definitions:
If it solves your issue then I am certain all installs are broken and I will have to do a pull request. |
@jafeelv Did it work? |
@myndcryme thank you sou much.. It worked.. |
It mostly works... but those preceeding zeros don't look right.
Give it a shot and let me know |
@myndcryme I'll try and update.. But some other errors came now from nowhere |
The compiler is telling you that you need to install the SD.h dependency - in your case, arduino-libraries/SD.h https://registry.platformio.org/libraries/arduino-libraries/SD/installation I don't know how you built and ran the reconstruction code without it being installed. |
@myndcryme I already installed it in platformio. I was able to run the reconstruction code. But after running PUF-encrypt, this happened. |
@myndcryme delay added. but, no changes for zeroes. |
@myndcryme Update: when I tried running PUF-encrypt, it worked. But PUF-decrypt is not showing any output |
Did you add the fixes to puf-decrypt? Reconstruction, puf-encrypt, puf-decrypt share much code, thus, behave similarly and all need to be patched. Also your serial connection is dropping information (bad connection, too fast or some param are incorrect?). |
@myndcryme it's working.. What to do with dropping information in serial connection? |
Glad you got it working. Since it is working, I probably wouldn't worry too much about the terminal emulator dropping a few characters. |
@jafeelv I merged PR#10 that corrects a buffer overrun condition that causes undefined behavior and crashes when calling the function |
After enrollment, challenge and helper data are generated. But not able to reconstruct the key.
The text was updated successfully, but these errors were encountered: