M4RIE  0.20120613
 All Data Structures Files Functions Variables 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.
mzd_slice_tmzed_slice (mzd_slice_t *A, const mzed_t *Z)
 Unpack the matrix Z into bitslice representation.
mzd_slice_t_mzed_slice2 (mzd_slice_t *A, const mzed_t *Z)
 Unpack the matrix Z over GF(2^2) into bitslice representation.
mzd_slice_t_mzed_slice4 (mzd_slice_t *A, const mzed_t *Z)
 Unpack the matrix Z over GF(2^e) into bitslice representation.
mzd_slice_t_mzed_slice8 (mzd_slice_t *A, const mzed_t *Z)
 Unpack the matrix Z over GF(2^e) into bitslice representation.
mzed_t_mzed_cling2 (mzed_t *A, const mzd_slice_t *Z)
 Pack a bitslice matrix into a classical represenation 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 GF(2^e) for e in {3,4}.
mzed_t_mzed_cling8 (mzed_t *A, const mzd_slice_t *Z)
 Pack a bitslice matrix into a classical represenation over GF(2^e) for e in {5,6,7,8}.
static mzed_t_mzed_mul_karatsuba (mzed_t *C, const mzed_t *A, const mzed_t *B)
 Compute C += A*B using Karatsuba multiplication of polynomials over GF(2).
static mzed_tmzed_mul_karatsuba (mzed_t *C, const mzed_t *A, const mzed_t *B)
 Compute C = A*B.
static mzed_tmzed_addmul_karatsuba (mzed_t *C, const mzed_t *A, const mzed_t *B)
 Compute C += A*B.
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.

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

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 GF(2^e) for e in {3,4}.

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

Pack a bitslice matrix into a classical represenation over GF(2^e) for e in {5,6,7,8}.

Parameters
AMatrix over GF(2^e), must be zero
ZBitslice matrix over GF(2^e)
static mzed_t* _mzed_mul_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_mul_karatsuba
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 GF(2^e) into bitslice representation.

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

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

Parameters
AZero bitslice matrix over GF(2^e)
ZMatrix over GF(2^e)
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.
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