nthparty / opaque

JavaScript implementation of the OPAQUE asymmetric PAKE protocol
https://www.npmjs.com/package/@nthparty/opaque
27 stars 4 forks source link

Split the client and server implementation into separate exports #4

Open stevendesu opened 3 years ago

stevendesu commented 3 years ago

My client-side code shouldn't need the server-side validation logic in it. It should be possible to say:

import { clientRegister, clientAuthenticate } from "@nthparty/opaque"; // ES6 / TypeScript

// or:

const clientRegister = require("@nthparty/opaque/clientRegister");
const clientAuthenticate = require("@nthparty/opaque/clientAuthenticate");

// alternatively:

const OPAQUE = require("@nthparty/opaque/client");
const clientRegister = OPAQUE.clientRegister;
const clientAuthenticate = OPAQUE.clientAuthenticate;

This way you only import what you need

yw662 commented 3 years ago

I totally agree that the client side and server side implementation should be splitted so that they don't need to include each other.