diff --git a/packages/frontend/astro.config.mjs b/packages/frontend/astro.config.mjs index 79ca8e0..de0bad5 100644 --- a/packages/frontend/astro.config.mjs +++ b/packages/frontend/astro.config.mjs @@ -20,5 +20,13 @@ export default defineConfig({ }, }, plugins: [tsconfigPaths()], + build: { + rollupOptions: { + output: { + assetFileNames: "assets/[name].[ext]", // Ensure .wasm files are copied + }, + }, + }, + assetsInclude: ["**/*.wasm"], }, }); diff --git a/packages/frontend/bun.lockb b/packages/frontend/bun.lockb new file mode 100755 index 0000000..fa83ace Binary files /dev/null and b/packages/frontend/bun.lockb differ diff --git a/packages/frontend/package.json b/packages/frontend/package.json index d94c869..0a2c111 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -1,23 +1,25 @@ { - "name": "frontend", - "type": "module", - "version": "0.0.1", - "scripts": { - "dev": "astro dev", - "build": "astro build", - "preview": "astro preview", - "astro": "astro" - }, - "dependencies": { - "@astrojs/tailwind": "^6.0.2", - "astro": "^5.5.5", - "autoprefixer": "^10.4.21", - "pg": "^8.11.11", - "postcss": "^8.5.3", - "tailwindcss": "^3.0.24", - "vite-tsconfig-paths": "^5.1.4" - }, - "devDependencies": { - "@types/pg": "^8.11.11" - } + "name": "frontend", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/tailwind": "^6.0.2", + "argon2id": "^1.0.1", + "astro": "^5.5.5", + "autoprefixer": "^10.4.21", + "pg": "^8.11.11", + "postcss": "^8.5.3", + "tailwindcss": "^3.0.24", + "vite-tsconfig-paths": "^5.1.4" + }, + "devDependencies": { + "@rollup/plugin-wasm": "^6.2.2", + "@types/pg": "^8.11.11" + } } diff --git a/packages/frontend/public/no-simd.wasm b/packages/frontend/public/no-simd.wasm new file mode 100755 index 0000000..46aaf6d Binary files /dev/null and b/packages/frontend/public/no-simd.wasm differ diff --git a/packages/frontend/public/simd.wasm b/packages/frontend/public/simd.wasm new file mode 100755 index 0000000..fe5effa Binary files /dev/null and b/packages/frontend/public/simd.wasm differ diff --git a/packages/frontend/src/components/Argon2idTester.svelte b/packages/frontend/src/components/Argon2idTester.svelte new file mode 100644 index 0000000..6fee60f --- /dev/null +++ b/packages/frontend/src/components/Argon2idTester.svelte @@ -0,0 +1,230 @@ + + +
+

The Challenge

+ +
+ + +

Memory cost (KiB) in argon2id config.

+
+ +
+ + +

Number of passes in argon2id config.

+
+ +
+ + +

Higher difficulty requires more computation.

+
+ +
+ + +

The number of consecutive successes required to pass the verification.

+
+ + + + {#if errorMessage} +

{errorMessage}

+ {/if} + +

Total hashes calculated: {totalHashes}

+ + {#if solution} +
+

Solution Found!

+

+ The solution (challenge + nonce) is: + {solution} +

+ {#if solveTime} +

+ Time to solve: {solveTime} ms +

+ {/if} +
+ {/if} +
diff --git a/packages/frontend/src/pages/test.astro b/packages/frontend/src/pages/test.astro new file mode 100644 index 0000000..08524d0 --- /dev/null +++ b/packages/frontend/src/pages/test.astro @@ -0,0 +1,8 @@ +--- +import Argon2idTester from '@components/Argon2idTester.svelte'; +import Layout from '@layouts/Layout.astro'; +--- + + + + \ No newline at end of file