initial commit

This commit is contained in:
CaiHQ
2023-03-15 01:15:57 +08:00
commit 3ee7b5bfc7
34 changed files with 4856 additions and 0 deletions

16
types/crypto.d.ts vendored Normal file
View File

@@ -0,0 +1,16 @@
import type { AESKey } from '@daotl/cryptico';
import { RSAKey } from '@daotl/cryptico';
export declare function aesEncrypt(data: string, aesKey: AESKey): string;
export declare function rsaEncrypt(data: string, rsaKey: {
n: string;
e1: string;
}): string;
export declare function loadRSAKey(rsaKey: string): RSAKey;
export declare function encryptReq(reqContent: {
contractID: string;
}, pubKey: RSAKey): {
action: string | null;
contractID: string;
arg: string;
requester: string;
};