1 | import { BoxKeyPair } from "tweetnacl";
|
2 | import { HAPEncryption } from "./eventedhttp";
|
3 |
|
4 |
|
5 |
|
6 | export declare function generateCurve25519KeyPair(): BoxKeyPair;
|
7 |
|
8 |
|
9 |
|
10 | export declare function generateCurve25519SharedSecKey(priKey: Uint8Array, pubKey: Uint8Array): Uint8Array;
|
11 |
|
12 |
|
13 |
|
14 | export declare function HKDF(hashAlg: string, salt: Buffer, ikm: Buffer, info: Buffer, size: number): Buffer;
|
15 |
|
16 |
|
17 |
|
18 | export declare function writeUInt64LE(number: number, buffer: Buffer, offset?: number): void;
|
19 |
|
20 |
|
21 |
|
22 | export declare function chacha20_poly1305_decryptAndVerify(key: Buffer, nonce: Buffer, aad: Buffer | null, ciphertext: Buffer, authTag: Buffer): Buffer;
|
23 |
|
24 |
|
25 |
|
26 | export interface EncryptedData {
|
27 | ciphertext: Buffer;
|
28 | authTag: Buffer;
|
29 | }
|
30 |
|
31 |
|
32 |
|
33 | export declare function chacha20_poly1305_encryptAndSeal(key: Buffer, nonce: Buffer, aad: Buffer | null, plaintext: Buffer): EncryptedData;
|
34 |
|
35 |
|
36 |
|
37 | export declare function layerEncrypt(data: Buffer, encryption: HAPEncryption): Buffer;
|
38 |
|
39 |
|
40 |
|
41 | export declare function layerDecrypt(packet: Buffer, encryption: HAPEncryption): Buffer;
|
42 |
|
\ | No newline at end of file |