
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
This is a native Node.js module (C/C++) that wraps James S. Plank's GF-Complete code
This is a native Node.js module (C/C++) that wraps James S. Plank's GF-Complete code
The main target of GF-complete is to enhance the multiplication of a region
of data (buffer) and a symbol of the Galois field. We introduce APIs to
facilitate the use of node-gf library:
Moreover, multi-threads can be enable in such operations so that each multiplication of a buffer with a symbol is performed in a thread.
GF-complete's source codes should be in the gf-complete directory of the
project. You can get GF-complete from different sources. By default, we choose
the source codes from
Jerasure Library
that is retrieved when the package is installed.
const NodeGF = require('node-gf');
const gf = new NodeGF(opts);
where [opts] is optional parameters for generating GF-complete
Available types of multiplication, division, region operations are the same as of the original GF-complete Library and shown as below.
node-gf | origin GF-complete |
|---|---|
| Multiplication | |
default | GF_MULT_DEFAULT |
shift | GF_MULT_SHIFT |
carray_free | GF_MULT_CARRY_FREE |
carry_free_gk | GF_MULT_CARRY_FREE_GK |
group | GF_MULT_GROUP |
bytwo_p | GF_MULT_BYTWO_p |
table | GF_MULT_TABLE |
log_table | GF_MULT_LOG_TABLE |
log_zero | GF_MULT_LOG_ZERO |
log_zero_ext | GF_MULT_LOG_ZERO_EXT |
split | GF_MULT_SPLIT_TABLE |
composite | GF_MULT_COMPOSITE |
| Division | |
default | GF_DIVIDE_DEFAULT |
matrix | GF_DIVIDE_MATRIX |
euclid | GF_DIVIDE_EUCLID |
| Region | |
default | GF_REGION_DEFAULT |
double | GF_REGION_DOUBLE_TABLE |
quad | GF_REGION_QUAD_TABLE |
lazy | GF_REGION_LAZY |
simd | GF_REGION_SIMD |
sse | GF_REGION_SSE |
noSimd | GF_REGION_NOSIMD |
noSse | GF_REGION_NOSSE |
altmap | GF_REGION_ALTMAP |
cauchy | GF_REGION_CAUCHY |
Note that not all combinations of multiplication/division/region types are correct. Please see manual for more details.
Without specific requirements, we recommend to generate GF-complete with the following options:
{
gfDim: 8,
multType: 'split',
divType: 'default',
regionType: 'default',
arg1: 4,
arg2: 8,
}
add(num1, num2)
multiply(num1, num2)
divide(num1, num2)
inverse(num)
multRegion(coef, src, dest, len, flag)
where
coef: a GF symbolsrc: the source bufferdest: the destination bufferlen: buffer length (bytes)flag: operation flag indicating that the result: stored in dest
(flag = 0) or XORed to actual dest (flag = 1)multRegionArr(coefs, src, dest, destsNb, len, flag, offset)
For multi-thread operations:
multRegionArrThreads(coefs, src, dest, destsNb, len, flag, offset)
where
coefs: array of GF symbolssrc: the source bufferdest: the destination buffersdestsNb: number of destination bufferslen: buffer length (bytes)flag: operation flag indicating that the result is stored in dest
(flag = 0) or XORed to actual dest (flag = 1)offset: offset of dest (bytes)multRegionMatrix(coefs, rowsNb, colsNb, src, dest, len, offset)
For multi-thread operations:
multRegionMatrixThreads(coefs, rowsNb, colsNb, src, dest, len, offset)
where
coefs: array of rowsNb x colsNb GF symbolsrowsNb: number of input regionscolsNb: number of output regionssrc: the source buffersdest: the destination bufferslen: buffer length (bytes)offset: offset of dest (bytes)multRegionMatrixContext(contextId, src, dest, len, offset)
For multi-thread operations:
multRegionMatrixThreadsContext(contextId, src, dest, len, offset)
where
contextId: identity of a contextsrc: the source buffersdest: the destination bufferslen: buffer length (bytes) (optional)offset: offset of dest (bytes) (optional)A context identity is return from
initContext(coefs, rowsNb, colsNb, len)
where
coefs: array of rowsNb x colsNb GF symbolsrowsNb: number of input regionscolsNb: number of output regionslen: buffer length (bytes)A context is deleted by
removeContext(contextId)
where
contextId: identity of a contextFAQs
This is a native Node.js module (C/C++) that wraps James S. Plank's GF-Complete code
The npm package node-gf receives a total of 11 weekly downloads. As such, node-gf popularity was classified as not popular.
We found that node-gf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.