Skip to content

Commit

Permalink
refactor: use const instead of var
Browse files Browse the repository at this point in the history
  • Loading branch information
csirianni committed Dec 10, 2023
1 parent 9a83291 commit 6358cab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/app/psi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function hashToPoint(input: string): Uint8Array {
* @param input the string to be encrypted
* @returns input with a secret key applied and the key's inverse
*/
export function applySeed(input: string, offset=0): [Uint8Array, Uint8Array] {
export function applySeed(input: string, offset = 0): [Uint8Array, Uint8Array] {
// generate random seed
const seed = sodium.crypto_core_ristretto255_scalar_random();
// get seed inverse
Expand All @@ -34,15 +34,15 @@ export function applySeed(input: string, offset=0): [Uint8Array, Uint8Array] {
seed,
point
);
var leakedSeededPassword = new Uint8Array(offset + seededPassword.length);
const leakedSeededPassword = new Uint8Array(offset + seededPassword.length);
leakedSeededPassword.set(leakedBytes, 0);
leakedSeededPassword.set(seededPassword, offset);
return [leakedSeededPassword, seedInverse];
}

function computeIntersection(
data: ServerResponse,
aInverse: Uint8Array,
aInverse: Uint8Array,
offset = 0
): boolean {
const userPassword = base64.parse(data.userPassword);
Expand Down

0 comments on commit 6358cab

Please sign in to comment.