@abhedyam/wasm 1.0.32 → 1.0.33
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/README.md +12 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,22 +4,24 @@ WebAssembly bindings for **Abhedya**: Post-Quantum Sanskrit Cryptography.
|
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import init, { AbhedyaWasm } from "./abhedya_wasm.js";
|
|
7
|
+
import init, { AbhedyaWasm } from "@abhedyam/wasm";
|
|
9
8
|
|
|
10
9
|
async function run() {
|
|
11
|
-
|
|
10
|
+
await init();
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const abhedya = new AbhedyaWasm();
|
|
13
|
+
abhedya.keygen();
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const plain = new TextEncoder().encode("Hello World");
|
|
16
|
+
const encrypted = abhedya.encrypt(plain, false); // Standard Mode
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
console.log("Encrypted bytes:", encrypted);
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const decrypted = abhedya.decrypt(encrypted);
|
|
21
|
+
console.log("Decrypted:", new TextDecoder().decode(decrypted));
|
|
23
22
|
}
|
|
24
23
|
run();
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
|
|
25
27
|
```
|