asherah 1.0.29 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,6 @@ export declare type AsherahConfig = {
|
|
|
28
28
|
sessionCache: boolean;
|
|
29
29
|
debugOutput: boolean;
|
|
30
30
|
};
|
|
31
|
-
export declare function
|
|
31
|
+
export declare function setup(config: AsherahConfig): void;
|
|
32
32
|
export declare function decrypt(partitionId: string, dataRowRecord: DataRowRecord): Buffer;
|
|
33
33
|
export declare function encrypt(partitionId: string, data: Buffer): DataRowRecord;
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.encrypt = exports.decrypt = exports.
|
|
3
|
+
exports.encrypt = exports.decrypt = exports.setup = void 0;
|
|
4
4
|
const cobhan_1 = require("cobhan");
|
|
5
5
|
const libasherah = (0, cobhan_1.load_platform_library)('node_modules/asherah/binaries', 'libasherah', {
|
|
6
6
|
'Encrypt': ['int32', ['pointer', 'pointer', 'pointer', 'pointer', 'pointer', 'pointer', 'pointer']],
|
|
7
7
|
'Decrypt': ['int32', ['pointer', 'pointer', 'pointer', 'int64', 'pointer', 'int64', 'pointer']],
|
|
8
8
|
'SetupJson': ['int32', ['pointer']]
|
|
9
9
|
});
|
|
10
|
-
function
|
|
10
|
+
function setup(config) {
|
|
11
11
|
const configJsonBuffer = (0, cobhan_1.string_to_cbuffer)(JSON.stringify(config));
|
|
12
12
|
const result = libasherah.SetupJson(configJsonBuffer);
|
|
13
13
|
if (result < 0) {
|
|
14
14
|
throw new Error('setupJson failed: ' + result);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
exports.
|
|
17
|
+
exports.setup = setup;
|
|
18
18
|
function decrypt(partitionId, dataRowRecord) {
|
|
19
19
|
const partitionIdBuffer = (0, cobhan_1.string_to_cbuffer)(partitionId);
|
|
20
20
|
const encryptedDataBuffer = (0, cobhan_1.buffer_to_cbuffer)(dataRowRecord.Data);
|