zeutro/openabe

OpenABE on ARMv6

PekeDevil opened this issue · 2 comments

I'm trying to build OpenABE on a Raspberry Zero. So far I have used OpenABE 1.0.0, but modifying '/src/Makefile' in order to build for ARM, according to this repo.

However, despite compiling, whenever I run make test, it results in the following:

[==========] Running 46 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 46 tests from libopenabe
[ RUN      ] libopenabe.PolicyTreeAndAttributeListParser
Driver::error string stream:1.12-13: syntax error, unexpected OR, expecting end of file
Check if isEqual throws an error correctly
[       OK ] libopenabe.PolicyTreeAndAttributeListParser (37 ms)
[ RUN      ] libopenabe.BasicPairingTests
Illegal instruction
Makefile:46: recipe for target 'test' failed

I have checked and it threw the error when running OpenABERNG rng. To make sure about what exactly was failing, I decided to run 'fuzzTest.sh' which resulted in the following messages, which actually provide more information:

 - Testing CP-ABE
./fuzzTest.sh: line 154:  5911 Illegal instruction     ./oabe_setup -s CP -p org1
 [+] Generate system parameters for CP:  FAILED with ERROR=132
functional key input: ONE|TWO|THREE
master public parameters not encoded correctly.
 [+] Generate key for alice:  FAILED with ERROR=255
functional key input: ONE|TWO|
master public parameters not encoded correctly.
 [+] Generate key for bob:  FAILED with ERROR=255
********************************************
input file: input.txt
encryption functional input: ((ONE and TWO) and THREE)
master public parameters not encoded properly.
 [+] Encrypt under a simple policy:  PASSED
********************************************
ciphertext: input.txt.cpabe
user's SK file: bobCPABE.key
master public parameters not encoded properly.
 [+] Decrypt using bob's key -- should fail:  FAILED with ERROR=255
********************************************
ciphertext: input.txt.cpabe
user's SK file: aliceCPABE.key
master public parameters not encoded properly.
 [+] Decrypt using alice's key -- should pass:  FAILED with ERROR=255

So it seems to be a problem with the setup file. However, I revised it, and there is no weird instructions in it. My best guess is that there must be a problem with RPI0 architecture, since everything seems to run properly on a Raspberry Pi 3. At some point, the library must be assuming ARMv7 instead of ARMv6.

Is there no solution for older architectures?

I finally managed to solve this thanks to the help provided on the relic-toolkit repo. I also combined it with IBM's modification. Just in case, in my fork, you can have the files I used to compile for RPI0-W (ARMv6).

Great! Can you please submit a PR instead @PekeDevil?