From 360713c6896d18a95dd3ca541ea477bf44b98d0c Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Mar 2024 22:38:21 +0000 Subject: add sodium-plus js crypto library --- library/sodium-plus/browser.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 library/sodium-plus/browser.js (limited to 'library/sodium-plus/browser.js') diff --git a/library/sodium-plus/browser.js b/library/sodium-plus/browser.js new file mode 100644 index 000000000..8a413caf8 --- /dev/null +++ b/library/sodium-plus/browser.js @@ -0,0 +1,25 @@ +const { + CryptographyKey, + Ed25519PublicKey, + Ed25519SecretKey, + SodiumError, + SodiumPlus, + SodiumPolyfill, + SodiumUtil, + X25519PublicKey, + X25519SecretKey +} = require('./index'); + +// Load dependencies into window +(async function(){ + window.CryptographyKey = CryptographyKey; + window.Ed25519PublicKey = Ed25519PublicKey; + window.Ed25519SecretKey = Ed25519SecretKey; + window.SodiumError = SodiumError; + window.SodiumPlus = SodiumPlus; + window.SodiumPolyfill = SodiumPolyfill; + window.SodiumUtil = SodiumUtil; + window.X25519PublicKey = X25519PublicKey; + window.X25519SecretKey = X25519SecretKey; + window.sodium = await SodiumPlus.auto(); +})(); -- cgit v1.2.3