9 #ifndef M4RIE_CONVERSION_H
10 #define M4RIE_CONVERSION_H
31 #include <m4ri/m4ri.h>
32 #include <m4rie/mzed.h>
33 #include <m4rie/mzd_slice.h>
179 m4ri_die(
"mzed_mul_karatsuba: rows, columns and fields must match.\n");
182 m4ri_die(
"mzed_mul_karatsuba: rows and columns of returned matrix must match.\n");
199 m4ri_die(
"mzed_addmul_karatsuba: rows, columns and fields must match.\n");
201 m4ri_die(
"mzed_addmul_karatsuba: rows and columns of returned matrix must match.\n");
248 m4ri_die(
"mzed_mul_blm: rows, columns and fields must match.\n");
251 m4ri_die(
"mzed_mul_blm: rows and columns of returned matrix must match.\n");
268 m4ri_die(
"mzed_addmul_blm: rows, columns and fields must match.\n");
270 m4ri_die(
"mzed_addmul_blm: rows and columns of returned matrix must match.\n");
303 static const word x80008000 = 0x8000800080008000ULL;
304 static const word x80808080 = 0x8080808080808080ULL;
305 static const word x88888888 = 0x8888888888888888ULL;
306 static const word xaaaaaaaa = 0xaaaaaaaaaaaaaaaaULL;
307 static const word xcccccccc = 0xccccccccccccccccULL;
308 static const word xc0c0c0c0 = 0xc0c0c0c0c0c0c0c0ULL;
309 static const word xf0f0f0f0 = 0xf0f0f0f0f0f0f0f0ULL;
310 static const word xff00ff00 = 0xff00ff00ff00ff00ULL;
311 static const word xffff0000 = 0xffff0000ffff0000ULL;
312 static const word xffffffff = 0xffffffff00000000ULL;
313 static const word x__left04 = 0xf000000000000000ULL;
314 static const word x__left08 = 0xff00000000000000ULL;
315 static const word x__left16 = 0xffff000000000000ULL;
316 static const word x__left32 = 0xffffffff00000000ULL;
320 #endif //M4RIE_CONVERSION_H
mzd_slice_t * _mzed_slice2(mzd_slice_t *A, const mzed_t *Z)
Unpack the matrix Z over GF(2^2) into bitslice representation.
Definition: conversion.c:121
static void mzd_slice_rescale_row(mzd_slice_t *A, rci_t r, rci_t c, word x)
Recale the row r in A by X starting c.
Definition: conversion.h:286
static mzed_t * mzed_addmul_blm(mzed_t *C, const mzed_t *A, const mzed_t *B)
Compute C += A*B.
Definition: conversion.h:265
mzed_t * _mzed_cling8(mzed_t *A, const mzd_slice_t *Z)
Pack a bitslice matrix into a classical represenation over for 4 < e <= 8.
Definition: conversion_cling8.c:29
static void mzed_rescale_row(mzed_t *A, rci_t r, rci_t start_col, const word x)
Rescale the row r in A by X starting c.
Definition: mzed.h:549
const gf2e * finite_field
Definition: mzed.h:61
static void mzd_slice_free(mzd_slice_t *A)
Free a matrix created with mzd_slice_init().
Definition: mzd_slice.h:145
static mzed_t * mzed_mul_karatsuba(mzed_t *C, const mzed_t *A, const mzed_t *B)
Compute C = A*B.
Definition: conversion.h:177
Dense matrices over represented as packed matrices.
Definition: mzed.h:59
rci_t ncols
Definition: mzd_slice.h:59
rci_t nrows
Definition: mzed.h:62
mzed_t * _mzed_cling2(mzed_t *A, const mzd_slice_t *Z)
Pack a bitslice matrix into a classical represenation over GF(2^2).
Definition: conversion.c:181
mzd_slice_t * _mzed_slice4(mzd_slice_t *A, const mzed_t *Z)
Unpack the matrix Z over into bitslice representation.
Definition: conversion.c:214
void mzed_free(mzed_t *A)
Free a matrix created with mzed_init().
Definition: mzed.c:39
static mzed_t * _mzed_addmul_blm(mzed_t *C, const mzed_t *A, const mzed_t *B)
Compute C += A*B using Bilinear Maps over GF(2).
Definition: conversion.h:215
mzd_slice_t * _mzed_slice8(mzd_slice_t *A, const mzed_t *Z)
Unpack the matrix Z over into bitslice representation.
Definition: conversion_slice8.c:29
void mzed_set_ui(mzed_t *A, word value)
Return diagonal matrix with value on the diagonal.
Definition: mzed.c:245
static mzed_t * mzed_mul_blm(mzed_t *C, const mzed_t *A, const mzed_t *B)
Compute C = A*B.
Definition: conversion.h:246
rci_t ncols
Definition: mzed.h:63
mzed_t * mzed_cling(mzed_t *A, const mzd_slice_t *Z)
Pack a bitslice matrix into a packed represenation.
Definition: conversion.c:88
static void mzd_slice_free_window(mzd_slice_t *A)
Free a matrix window created with mzd_slice_init_window().
Definition: mzd_slice.h:502
mzed_t * mzed_add(mzed_t *C, const mzed_t *A, const mzed_t *B)
.
Definition: mzed.c:53
mzd_slice_t * _mzed_slice16(mzd_slice_t *A, const mzed_t *Z)
Unpack the matrix Z over into bitslice representation.
Definition: conversion_slice16.c:50
static mzd_slice_t * mzd_slice_init_window(const mzd_slice_t *A, const size_t lowr, const size_t lowc, const size_t highr, const size_t highc)
Create a window/view into the matrix M.
Definition: mzd_slice.h:480
static mzed_t * mzed_addmul_karatsuba(mzed_t *C, const mzed_t *A, const mzed_t *B)
Compute C += A*B.
Definition: conversion.h:196
static mzed_t * _mzed_addmul_karatsuba(mzed_t *C, const mzed_t *A, const mzed_t *B)
Compute C += A*B using Karatsuba multiplication of polynomials over GF(2).
Definition: conversion.h:148
static mzd_slice_t * _mzd_slice_addmul_karatsuba(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B)
using Karatsuba multiplication of polynomials over matrices over .
Definition: mzd_slice.h:624
Dense matrices over represented as slices of matrices over .
Definition: mzd_slice.h:56
mzed_t * _mzed_cling16(mzed_t *A, const mzd_slice_t *Z)
Pack a bitslice matrix into a classical represenation over for 8 < e <= 16.
Definition: conversion_cling16.c:28
mzd_slice_t * mzed_slice(mzd_slice_t *A, const mzed_t *Z)
Unpack the matrix Z into bitslice representation.
Definition: conversion.c:56
mzed_t * _mzed_cling4(mzed_t *A, const mzd_slice_t *Z)
Pack a bitslice matrix into a classical represenation over for 2 < e <= 4.
Definition: conversion.c:320
static mzd_slice_t * _mzd_slice_mul_blm(mzd_slice_t *C, const mzd_slice_t *A, const mzd_slice_t *B, blm_t *f)
using bilinear maps over matrices over .
Definition: mzd_slice.h:706