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 <pablo.de.lara.guarch@intel.com>
This commit is contained in:
Pablo de Lara 2024-01-12 16:46:39 +00:00 committed by Tomasz Kantecki
parent b8d5633e51
commit e0fd782974

View File

@ -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);