mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
12 lines
384 B
TypeScript
12 lines
384 B
TypeScript
import ElGamal from 'elgamal';
|
|
|
|
(async () => {
|
|
const eg = await ElGamal.generateAsync();
|
|
|
|
const secret = 'The quick brown fox jumps over the lazy dog';
|
|
const encrypted = await eg.encryptAsync(secret); // $ExpectType EncryptedValue
|
|
const decrypted = await eg.decryptAsync(encrypted); // $ExpectType DecryptedValue
|
|
|
|
decrypted.toString(); // $ExpectType string
|
|
})();
|