Skip to content

Commit

Permalink
Switch from const enum to var
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Feb 1, 2025
1 parent 32ba52a commit 670d8e3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/slh-dsa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ export const PARAMS: Record<string, SphincsOpts> = {
'256s': { W: 16, N: 32, H: 64, D: 8, K: 22, A: 14 },
} as const;

const enum AddressType {
WOTS,
WOTSPK,
HASHTREE,
FORSTREE,
FORSPK,
WOTSPRF,
FORSPRF,
}
const AddressType = {
WOTS: 0,
WOTSPK: 1,
HASHTREE: 2,
FORSTREE: 3,
FORSPK: 4,
WOTSPRF: 5,
FORSPRF: 6,
} as const;

/** Address, byte array of size ADDR_BYTES */
export type ADRS = Uint8Array;
Expand Down Expand Up @@ -172,7 +172,7 @@ function gen(opts: SphincsOpts, hashOpts: SphincsHashOpts): SphincsSigner {

const setAddr = (
opts: {
type?: AddressType;
type?: (typeof AddressType)[keyof typeof AddressType];
height?: number;
tree?: bigint;
index?: number;
Expand Down

0 comments on commit 670d8e3

Please sign in to comment.