Skip to content

Lift TotalPeriodsKES to the type level in KESAlgorithm#637

Open
dancewithheart wants to merge 1 commit intoIntersectMBO:masterfrom
dancewithheart:364-totalperiodskes-typelevel
Open

Lift TotalPeriodsKES to the type level in KESAlgorithm#637
dancewithheart wants to merge 1 commit intoIntersectMBO:masterfrom
dancewithheart:364-totalperiodskes-typelevel

Conversation

@dancewithheart
Copy link

@dancewithheart dancewithheart commented Mar 24, 2026

Description

Fixes #364

This PR lifts the total number of supported KES periods to the type level by
adding:

type TotalPeriodsKES v :: Nat

to KESAlgorithm.

This is a small API change for downstream KESAlgorithm instances.

Changes

  • add TotalPeriodsKES as an associated type of KESAlgorithm
  • require KnownNat (TotalPeriodsKES v) in the KESAlgorithm superclass context
  • make totalPeriodsKES a default term-level reflection of TotalPeriodsKES
  • update KES instances to define TotalPeriodsKES at the type level
  • adjust affected instance contexts using generic KES CBOR helpers
  • add a test checking that totalPeriodsKES agrees with TotalPeriodsKES

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages.
    New section is never added with the code changes. (See RELEASING.md)
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated.
    If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • Self-reviewed the diff

@dancewithheart dancewithheart requested a review from lehins as a code owner March 24, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lift totalPeriodsKES to the type level

1 participant