From e0fd782974a0981e63fbc854e2c456d2889965ab Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Fri, 12 Jan 2024 16:46:39 +0000 Subject: [PATCH] erasure_code: use internal gf_vect_mul_base for ppc64le encoding gf_vect_mul_base is expected to work for all buffer sizes. However, this function is checking for size alignment to 32 bytes, to follow the other gf_vect_mul implementations. Therefore, another implementation for this function is included inside ppc64le folder to be used by the encoding functions. Signed-off-by: Pablo de Lara --- erasure_code/ppc64le/gf_vect_mul_vsx.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/erasure_code/ppc64le/gf_vect_mul_vsx.c b/erasure_code/ppc64le/gf_vect_mul_vsx.c index ce980cf..0f2f2f4 100644 --- a/erasure_code/ppc64le/gf_vect_mul_vsx.c +++ b/erasure_code/ppc64le/gf_vect_mul_vsx.c @@ -1,5 +1,19 @@ #include "ec_base_vsx.h" +/* + * Same as gf_vect_mul_base in "ec_base.h" but without the size restriction. + */ +static void _gf_vect_mul_base(int len, unsigned char *a, unsigned char *src, + unsigned char *dest) +{ + //2nd element of table array is ref value used to fill it in + unsigned char c = a[1]; + + while (len-- > 0) + *dest++ = gf_mul(c, *src++); + return 0; +} + void gf_vect_mul_vsx(int len, unsigned char *gftbl, unsigned char *src, unsigned char *dest) { unsigned char *s, *t0; @@ -19,8 +33,7 @@ void gf_vect_mul_vsx(int len, unsigned char *gftbl, unsigned char *src, unsigned head = len % 128; if (head != 0) { - // errors are ignored. - gf_vect_mul_base(head, gftbl, src, dest); + _gf_vect_mul_base(head, gftbl, src, dest); } vlo0 = EC_vec_xl(0, gftbl);