-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1f2621
commit 3b46f26
Showing
8 changed files
with
532 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# WASM Library | ||
|
||
## Testing | ||
|
||
In order to test the code, run `cargo test -- --nocapture` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "rsa-encrypt", | ||
"version": "0.1.0", | ||
"files": [ | ||
"rsa_encrypt_bg.wasm", | ||
"rsa_encrypt.js", | ||
"rsa_encrypt.d.ts" | ||
], | ||
"module": "rsa_encrypt.js", | ||
"types": "rsa_encrypt.d.ts", | ||
"sideEffects": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @returns {string} | ||
*/ | ||
export function get_mnemonic(): string; | ||
/** | ||
* @param {string} phrase | ||
* @returns {string} | ||
*/ | ||
export function check_mnemonic(phrase: string): string; | ||
/** | ||
* @param {string} data | ||
* @returns {string} | ||
*/ | ||
export function encrypt_data(data: string): string; | ||
/** | ||
* @returns {string} | ||
*/ | ||
export function generate_keys(): string; | ||
|
||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; | ||
|
||
export interface InitOutput { | ||
readonly memory: WebAssembly.Memory; | ||
readonly get_mnemonic: (a: number) => void; | ||
readonly check_mnemonic: (a: number, b: number, c: number) => void; | ||
readonly encrypt_data: (a: number, b: number, c: number) => void; | ||
readonly generate_keys: (a: number) => void; | ||
readonly __wbindgen_add_to_stack_pointer: (a: number) => number; | ||
readonly __wbindgen_free: (a: number, b: number) => void; | ||
readonly __wbindgen_malloc: (a: number) => number; | ||
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number; | ||
readonly __wbindgen_exn_store: (a: number) => void; | ||
} | ||
|
||
export type SyncInitInput = BufferSource | WebAssembly.Module; | ||
/** | ||
* Instantiates the given `module`, which can either be bytes or | ||
* a precompiled `WebAssembly.Module`. | ||
* | ||
* @param {SyncInitInput} module | ||
* | ||
* @returns {InitOutput} | ||
*/ | ||
export function initSync(module: SyncInitInput): InitOutput; | ||
|
||
/** | ||
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and | ||
* for everything else, calls `WebAssembly.instantiate` directly. | ||
* | ||
* @param {InitInput | Promise<InitInput>} module_or_path | ||
* | ||
* @returns {Promise<InitOutput>} | ||
*/ | ||
export default function init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>; |
Oops, something went wrong.