-
-
Notifications
You must be signed in to change notification settings - Fork 6
Migrate fjs/crypto/vdf to .f.mjs #1486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2732787
Migrate fjs/crypto/vdf to .f.mjs, split Sloth type into types.ts
claude 994de3e
Add CHANGELOG entry for fjs/crypto/vdf migration (#1486)
claude 37df907
Migrate fjs/bnf/token_symbol to .f.mjs, split Encoding<T> into types.ts
claude 2931e58
Address Codex review: annotated const over inline cast, stale README ref
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /** | ||
| * Types for encoding multi-character token names as single BNF input symbols. | ||
| * | ||
| * @module | ||
| */ | ||
|
|
||
| import type { Nullable } from '../../types/nullable/types.ts' | ||
|
|
||
| /** | ||
| * A bidirectional map between a fixed alphabet of token names and the symbol | ||
| * range reserved for them. | ||
| */ | ||
| export type Encoding<T extends string> = { | ||
| /** | ||
| * The input symbol standing for `name`. | ||
| * | ||
| * The result is a bare symbol, the form a tokenizer emits. Wrap it in | ||
| * `oneEncode` to use it as a terminal of a grammar rule — a symbol and a | ||
| * `TerminalRange` are both plain numbers, so passing one where the other | ||
| * belongs is not a type error. | ||
| */ | ||
| readonly encode: (name: T) => number | ||
| /** | ||
| * The name a symbol stands for, or `null` when the symbol belongs to no | ||
| * registered name — a code point, `eof`, or a symbol past the end of the | ||
| * alphabet. | ||
| */ | ||
| readonly decode: (symbol: number) => Nullable<T> | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /** | ||
| * Types for the Sloth verifiable delay function. | ||
| * | ||
| * @module | ||
| */ | ||
|
|
||
| import type { Nullable } from '../../types/nullable/types.ts' | ||
|
|
||
| /** | ||
| * Sloth VDF over prime `modulus` (`p ≡ 3 (mod 4)`). | ||
| */ | ||
| export type Sloth = { | ||
| readonly p: bigint | ||
| readonly quadRes: (x: bigint) => boolean | ||
| readonly modSqrt: (x: bigint) => bigint | ||
| /** Sequential Sloth permutation; `null` when `steps < 0`. */ | ||
| readonly eval: (steps: bigint) => (x: bigint) => Nullable<bigint> | ||
| /** Fast verification of {@link Sloth.eval}; `false` when `steps < 0`. */ | ||
| readonly verify: (steps: bigint) => (x: bigint) => (y: bigint) => boolean | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this proof is renamed to
.f.mjs,fjs/crypto/vdf/README.md:28still directs readers toproof.f.ts. A repo-wide filename search confirms that path no longer exists in this directory, so the test-vector documentation should be updated to referenceproof.f.mjsas part of the rename.Useful? React with 👍 / 👎.