M4RIE  0.20111004
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Functions
conversion.h File Reference

Conversion between mzed_t and mzd_slice_t. More...

#include <m4ri/m4ri.h>
#include <m4rie/mzed.h>
#include <m4rie/mzd_slice.h>

Go to the source code of this file.

Functions

mzed_tmzed_cling (mzed_t *A, const mzd_slice_t *Z)
 Pack a bitslice matrix into a packed represenation. More...
 
mzd_slice_tmzed_slice (mzd_slice_t *A, const mzed_t *Z)
 Unpack the matrix Z into bitslice representation. More...
 
mzd_slice_t_mzed_slice2 (mzd_slice_t *A, const mzed_t *Z)
 Unpack the matrix Z over GF(2^2) into bitslice representation. More...
 
mzd_slice_t_mzed_slice4 (mzd_slice_t *A, const mzed_t *Z)
 Unpack the matrix Z over \(\mathbb{F}_{2^e}\) into bitslice representation. More...
 
mzd_slice_t_mzed_slice8 (mzd_slice_t *A, const mzed_t *Z)
 Unpack the matrix Z over \(\mathbb{F}_{2^e}\) into bitslice representation. More...
 
mzd_slice_t_mzed_slice16 (mzd_slice_t *A, const mzed_t *Z)
 Unpack the matrix Z over \(\mathbb{F}_{2^e}\) into bitslice representation. More...
 
mzed_t_mzed_cling2 (mzed_t *A, const mzd_slice_t *Z)
 Pack a bitslice matrix into a classical represenation over GF(2^2). More...
 
mzed_t_mzed_cling4 (mzed_t *A, const mzd_slice_t *Z)
 Pack a bitslice matrix into a classical represenation over \(\mathbb{F}_{2^e}\) for 2 < e <= 4. More...
 
mzed_t_mzed_cling8 (mzed_t *A, const mzd_slice_t *Z)
 Pack a bitslice matrix into a classical represenation over \(\mathbb{F}_{2^e}\) for 4 < e <= 8. More...
 
mzed_t_mzed_cling16 (mzed_t *A, const mzd_slice_t *Z)
 Pack a bitslice matrix into a classical represenation over \(\mathbb{F}_{2^e}\) for 8 < e <= 16. More...
 
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). More...
 
static mzed_tmzed_mul_karatsuba (mzed_t *C, const mzed_t *A, const mzed_t *B)
 Compute C = A*B. More...
 
static mzed_tmzed_addmul_karatsuba (mzed_t *C, const mzed_t *A, const mzed_t *B)
 Compute C += A*B. More...
 
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). More...
 
static mzed_tmzed_mul_blm (mzed_t *C, const mzed_t *A, const mzed_t *B)
 Compute C = A*B. More...
 
static mzed_tmzed_addmul_blm (mzed_t *C, const mzed_t *A, const mzed_t *B)
 Compute C += A*B. More...
 
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. More...
 

Detailed Description

Conversion between mzed_t and mzd_slice_t.

Author
Martin Albrecht marti.nosp@m.nral.nosp@m.brech.nosp@m.t@go.nosp@m.oglem.nosp@m.ail..nosp@m.com

Function Documentation

static mzed_t* _mzed_addmul_blm ( mzed_t C,
const mzed_t A,
const mzed_t B 
)
inlinestatic

Compute C += A*B using Bilinear Maps over GF(2).

Parameters
CPreallocated return matrix, may be NULL for automatic creation.
AInput matrix A.
BInput matrix B.
See also
_mzd_slice_addmul_blm
static mzed_t* _mzed_addmul_karatsuba ( mzed_t C,
const mzed_t A,
const mzed_t B 
)
inlinestatic

Compute C += A*B using Karatsuba multiplication of polynomials over GF(2).

Parameters
CPreallocated return matrix, may be NULL for automatic creation.
AInput matrix A.
BInput matrix B.
See also
_mzd_slice_addmul_karatsuba
mzed_t* _mzed_cling16 ( mzed_t A,
const mzd_slice_t Z 
)

Pack a bitslice matrix into a classical represenation over \(\mathbb{F}_{2^e}\) for 8 < e <= 16.

Parameters
AMatrix over \(\mathbb{F}_{2^e}\), must be zero
ZBitslice matrix over \(\mathbb{F}_{2^e}\)
mzed_t* _mzed_cling2 ( mzed_t A,
const mzd_slice_t Z 
)

Pack a bitslice matrix into a classical represenation over GF(2^2).

Elements in GF(2^2) can be represented as c_1*a + c_0 where a is a root of x^2 + x + 1. A1 contains the coefficients for c_1 while A0 contains the coefficients for c_0.

Parameters
AMatrix over GF(2^2), must be zero
ZBitslice matrix over GF(2^2)
mzed_t* _mzed_cling4 ( mzed_t A,
const mzd_slice_t Z 
)

Pack a bitslice matrix into a classical represenation over \(\mathbb{F}_{2^e}\) for 2 < e <= 4.

Parameters
AMatrix over \(\mathbb{F}_{2^e}\), must be zero
ZBitslice matrix over \(\mathbb{F}_{2^e}\)
mzed_t* _mzed_cling8 ( mzed_t A,
const mzd_slice_t Z 
)

Pack a bitslice matrix into a classical represenation over \(\mathbb{F}_{2^e}\) for 4 < e <= 8.

Parameters
AMatrix over \(\mathbb{F}_{2^e}\), must be zero
ZBitslice matrix over \(\mathbb{F}_{2^e}\)
mzd_slice_t* _mzed_slice16 ( mzd_slice_t A,
const mzed_t Z 
)

Unpack the matrix Z over \(\mathbb{F}_{2^e}\) into bitslice representation.

Parameters
AZero bitslice matrix over \(\mathbb{F}_{2^e}\)
ZMatrix over \(\mathbb{F}_{2^e}\)
mzd_slice_t* _mzed_slice2 ( mzd_slice_t A,
const mzed_t Z 
)

Unpack the matrix Z over GF(2^2) into bitslice representation.

Elements in GF(2^2) can be represented as x*a + y where a is a root of x^2 + x + 1. A0 contains the coefficients for x while A1 contains the coefficients for y.

Parameters
AZero bitslice matrix over GF(2^2)
ZMatrix over GF(2^2)
mzd_slice_t* _mzed_slice4 ( mzd_slice_t A,
const mzed_t Z 
)

Unpack the matrix Z over \(\mathbb{F}_{2^e}\) into bitslice representation.

Parameters
AZero bitslice matrix over \(\mathbb{F}_{2^e}\)
ZMatrix over \(\mathbb{F}_{2^e}\)
mzd_slice_t* _mzed_slice8 ( mzd_slice_t A,
const mzed_t Z 
)

Unpack the matrix Z over \(\mathbb{F}_{2^e}\) into bitslice representation.

Parameters
AZero bitslice matrix over \(\mathbb{F}_{2^e}\)
ZMatrix over \(\mathbb{F}_{2^e}\)
static mzed_t* mzed_addmul_blm ( mzed_t C,
const mzed_t A,
const mzed_t B 
)
inlinestatic

Compute C += A*B.

Parameters
CPreallocated return matrix.
AInput matrix A.
BInput matrix B.
Examples:
tests/test_multiplication.c.
static mzed_t* mzed_addmul_karatsuba ( mzed_t C,
const mzed_t A,
const mzed_t B 
)
inlinestatic

Compute C += A*B.

Parameters
CPreallocated return matrix.
AInput matrix A.
BInput matrix B.
Examples:
tests/test_multiplication.c.
static mzed_t* mzed_mul_blm ( mzed_t C,
const mzed_t A,
const mzed_t B 
)
inlinestatic

Compute C = A*B.

Parameters
CPreallocated return matrix, may be NULL for automatic creation.
AInput matrix A.
BInput matrix B.
See also
_mzd_slice_mul_blm
Examples:
tests/test_multiplication.c.
static mzed_t* mzed_mul_karatsuba ( mzed_t C,
const mzed_t A,
const mzed_t B 
)
inlinestatic

Compute C = A*B.

Parameters
CPreallocated return matrix, may be NULL for automatic creation.
AInput matrix A.
BInput matrix B.
See also
_mzd_slice_mul_karatsuba
Examples:
tests/test_multiplication.c.