Hi Alex
I modified the Makefile so that I can compile the source codes of the pqm4 project in your project.
However, I have a new error with the macro. The error looks like this:
crypto_kem/kyber512/m4/macros.i:3:1: error: stray ‘#’ in program
3 | #ifndef MACROS_I
| ^
crypto_kem/kyber512/m4/macros.i:3:2: error: unknown type name ‘ifndef’
3 | #ifndef MACROS_I
| ^~~~~~
crypto_kem/kyber512/m4/macros.i:6:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘.’ token
6 | .macro load a, a0, a1, a2, a3, mem0, mem1, mem2, mem3
| ^
crypto_kem/kyber512/m4/macros.i:7:9: error: stray ‘’ in program
7 | ldr.w \a0, [\a, \mem0]
| ^
crypto_kem/kyber512/m4/macros.i:7:15: error: stray ‘’ in program
7 | ldr.w \a0, [\a, \mem0]
| ^
The macro file is:
/…/…/kyber768/m4/macros.i/
#ifndef MACROS_I
#define MACROS_I
.macro load a, a0, a1, a2, a3, mem0, mem1, mem2, mem3
ldr.w \a0, [\a, \mem0]
ldr.w \a1, [\a, \mem1]
ldr.w \a2, [\a, \mem2]
ldr.w \a3, [\a, \mem3]
.endm
.macro store a, a0, a1, a2, a3, mem0, mem1, mem2, mem3
str.w \a0, [\a, \mem0]
str.w \a1, [\a, \mem1]
str.w \a2, [\a, \mem2]
str.w \a3, [\a, \mem3]
.endm
.macro doublebarrett a, tmp, tmp2, q, barrettconst
smulbb \tmp, \a, \barrettconst
smultb \tmp2, \a, \barrettconst
asr \tmp, \tmp, #26
asr \tmp2, \tmp2, #26
smulbb \tmp, \tmp, \q
smulbb \tmp2, \tmp2, \q
pkhbt \tmp, \tmp, \tmp2, lsl#16
usub16 \a, \a, \tmp
.endm
.macro montgomery q, qinv, a, tmp
smulbt \tmp, \a, \qinv
smlabb \tmp, \q, \tmp, \a
.endm
.macro doublemontgomery a, tmp, tmp2, q, qinv, montconst
smulbb \tmp2, \a, \montconst
montgomery \q, \qinv, \tmp2, \tmp
smultb \a, \a, \montconst
montgomery \q, \qinv, \a, \tmp2
pkhtb \a, \tmp2, \tmp, asr#16
.endm
#endif /* MACROS_I */
Do you know what is the problem? Are there any additional tools that I need to add to the instalation of chipwhisperer to solve the problem?
Thank you very much.
Best regards,
Tuan