|
ABY Framework
1.0
Arithmetic Bool Yao Framework
|
Gray code implementation. More...
#include "typedefs.h"
Go to the source code of this file.
Classes | |
| struct | code |
| Gray codes. More... | |
Functions | |
| int | gray_code (int i, int l) |
| code * | build_code (int l) |
| void | destroy_code (code *codebook) |
Gray code implementation.
The Gray code is a binary numeral system where two successive values differ in only one digit.
| code* build_code | ( | int | l | ) |
Fills var ord and var inc with Gray code data for a Gray code of length
.
| ord | Will hold gray code data, must be preallocated with correct size |
| inc | Will hold some increment data, must be preallocated with correct size |
| l | Logarithm of length of Gray code. |
| void destroy_code | ( | code * | codebook | ) |
Frees memory from the global code book.
This function is called automatically when the shared library is unloaded.
| int gray_code | ( | int | i, |
| int | l | ||
| ) |
Returns the i-th gray code entry for a gray code of length
.
| i | The index in the Gray code table. |
| l | Length of the Gray code. |
1.8.8