@@ -252,10 +252,9 @@ static WC_INLINE void poly1305_blocks_riscv64_16(Poly1305* ctx,
252252#ifdef WOLFSSL_RISCV_VECTOR
253253
254254#define MUL_RES_REDIS (l , h , t ) \
255- VSRL_VI(t, l, 26) \
256- VAND_VX(l, l, REG_A6) \
257- VSRL_VI(t, t, 26) \
255+ VSRL_VX(t, l, REG_A7) \
258256 VSLL_VI(h, h, 12) \
257+ VAND_VX(l, l, REG_A6) \
259258 VOR_VV(h, h, t)
260259
261260#endif
@@ -273,6 +272,7 @@ void poly1305_blocks_riscv64(Poly1305* ctx, const unsigned char *m,
273272 "li a4, 0xffffffc000000\n\t"
274273 "li a5, 0x3ffffff\n\t"
275274 "li a6, 0xfffffffffffff\n\t"
275+ "li a7, 52\n\t"
276276
277277 /* Load r and r^2 */
278278 "mv t0, %[r2]\n\t"
@@ -430,7 +430,7 @@ void poly1305_blocks_riscv64(Poly1305* ctx, const unsigned char *m,
430430 : [bytes ] "+ r " (bytes), [m] " + r " (m)
431431 : [r2 ] "r " (ctx->r2), [h] " r " (ctx->h)
432432 : " memory ", " t0 ", " t1 ", " t2 ", " t3 ", " t4 ", " t5 ", " t6 ",
433- " s3 ", " s4 ", " s5 ", " a4 ", " a5 ", " a6 "
433+ " s3 ", " s4 ", " s5 ", " a4 ", " a5 ", " a6 ", " a7 "
434434 );
435435#endif
436436 poly1305_blocks_riscv64_16 (ctx , m , bytes , 1 );
0 commit comments