Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const TAG_LENGTH = 16;
const arch = process.arch === 'ia32';
const winLibraryPath = isDevEnv ? path.join(__dirname, '..', '..', 'library') : path.join(execPath, 'library');
const macLibraryPath = isDevEnv ? path.join(__dirname, '..', '..', '..', 'library') : path.join(execPath, '..', 'library');
const cryptoLibPath = isMac ?
path.join(macLibraryPath, 'cryptoLib.dylib') :
(arch ? path.join(winLibraryPath, 'libsymphonysearch-x86.dll') : path.join(winLibraryPath, 'libsymphonysearch-x64.dll'));
const library = new Library((cryptoLibPath), {
AESEncryptGCM: [types.int32, [
refType(types.uchar),
types.int32,
refType(types.uchar),
types.int32,
refType(types.uchar),
refType(types.uchar),
types.uint32,
refType(types.uchar),
refType(types.uchar),
types.uint32,
]],
AESDecryptGCM: [types.int32, [
refType(types.uchar),
types.int32,
refType(types.uchar),
types.int32,
refType(types.uchar),
types.uint32,
refType(types.uchar),