Skip to content

Commit

Permalink
fix issue Mbed-TLS#2020
Browse files Browse the repository at this point in the history
Fixed a bug that the little-endian Microblaze does not work when MBEDTLS_HAVE_ASM is defined.
  • Loading branch information
Kazuyuki Kimura committed May 31, 2021
1 parent f1eb425 commit 60fc9a9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions library/bn_mul.h
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,20 @@
"andi r7, r6, 0xffff \n\t" \
"bsrli r6, r6, 16 \n\t"

#define MULADDC_CORE \
#if(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
#define MULADDC_LHUI \
"lhui r9, r3, 0 \n\t" \
"addi r3, r3, 2 \n\t" \
"lhui r8, r3, 0 \n\t"
#else
#define MULADDC_LHUI \
"lhui r8, r3, 0 \n\t" \
"addi r3, r3, 2 \n\t" \
"lhui r9, r3, 0 \n\t" \
"lhui r9, r3, 0 \n\t"
#endif

#define MULADDC_CORE \
MULADDC_LHUI \
"addi r3, r3, 2 \n\t" \
"mul r10, r9, r6 \n\t" \
"mul r11, r8, r7 \n\t" \
Expand Down

0 comments on commit 60fc9a9

Please sign in to comment.