Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ history.

## Unreleased

- **BREAKING CHANGES:** `fjs/crypto/sha2` migrates from authored TypeScript
(`.f.ts`) to JSDoc-typed JavaScript (`.f.mjs`) under the stage-1
TypeScript-to-mjs migration — importers must use the `.f.mjs` specifier
[#1472](https://github.com/functionalscript/functionalscript/pull/1472)
- **BREAKING CHANGES:** `fjs/types/btree/set` and `fjs/types/btree/remove`
migrate from authored TypeScript (`.f.ts`) to JSDoc-typed JavaScript
(`.f.mjs`) under the stage-1 TypeScript-to-mjs migration — importers must use
Expand Down
2 changes: 1 addition & 1 deletion fjs/basen/cbase32/todo/178.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ and `cBase32ToVec = s => { const v = cBase32ToVec5x(s); return v === null ? null
- **Single primary consumer.** Today only `cbase32` round-trips this padding, so
this is the "single-consumer abstraction justified by clarity/separation"
case, not a 2-consumer DRY extraction. SHA-2's padding
(`crypto/sha2/module.f.ts:234`) looks similar but is *not* the same operation:
(`crypto/sha2/module.f.mjs:252`) looks similar but is *not* the same operation:
it appends a length field and relies on the fixed-width compress word's
implicit zero-extension rather than an explicit `padToMultiple`. Do **not**
try to force SHA-2 onto this helper.
Expand Down
2 changes: 1 addition & 1 deletion fjs/cas/cli/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @module
*/
import { sha256 } from '../../crypto/sha2/module.f.ts'
import { sha256 } from '../../crypto/sha2/module.f.mjs'
import { cBase32ToVec, vecToCBase32 } from '../../basen/cbase32/module.f.mjs'
import { forEachStep, pure, step } from '../../effects/module.f.ts'
import {
Expand Down
2 changes: 1 addition & 1 deletion fjs/cas/cli/proof.f.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { commands } from './module.f.ts'
import { computeSync, sha256 } from '../../crypto/sha2/module.f.ts'
import { computeSync, sha256 } from '../../crypto/sha2/module.f.mjs'
import { maxLength, vec, vec8 } from '../../types/bit_vec/module.f.mjs'
import { defaultNodeProgramOptions, emptyState, virtual } from '../../effects/node/virtual/module.f.ts'
import { type NodeProgramOptions } from '../../effects/node/module.f.ts'
Expand Down
2 changes: 1 addition & 1 deletion fjs/cas/evo/proof.f.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assert, assertEq } from '../../asserts/module.f.mjs'
import { pure } from '../../effects/module.f.ts'
import { fileCas, type Cas } from '../module.f.ts'
import { sha256 } from '../../crypto/sha2/module.f.ts'
import { sha256 } from '../../crypto/sha2/module.f.mjs'
import { emptyState, virtual } from '../../effects/node/virtual/module.f.ts'
import { vec, vec8, type Vec } from '../../types/bit_vec/module.f.mjs'
import { cBase32ToVec, vecToCBase32 } from '../../basen/cbase32/module.f.mjs'
Expand Down
2 changes: 1 addition & 1 deletion fjs/cas/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @module
*/
import { sha256, type Sha2, type State as Sha2State } from '../crypto/sha2/module.f.ts'
import { sha256, type Sha2, type State as Sha2State } from '../crypto/sha2/module.f.mjs'
import { join, normalize, parse } from '../path/module.f.ts'
import { empty, length, maxLength, maxLengthBytes, msb, vec, type Vec } from '../types/bit_vec/module.f.mjs'
import { cBase32ToVec, vecToCBase32 } from '../basen/cbase32/module.f.mjs'
Expand Down
2 changes: 1 addition & 1 deletion fjs/cas/proof.f.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { length, maxLength, msb, vec, vec8, type Vec } from '../types/bit_vec/module.f.mjs'
import { cBase32ToVec, vecToCBase32 } from '../basen/cbase32/module.f.mjs'
import { computeSync, sha256 } from '../crypto/sha2/module.f.ts'
import { computeSync, sha256 } from '../crypto/sha2/module.f.mjs'
import { fileCas, casAddFile, collectRead, type FileCasOperation, casUpload } from './module.f.ts'
import { match, pure, runPure, step, type Effect } from '../effects/module.f.ts'
import { mkdir, writeFile, rm, readFile, type ReadFile, type WriteFile, type Rm, type Mkdir, type IoResult, access } from '../effects/node/module.f.ts'
Expand Down
4 changes: 2 additions & 2 deletions fjs/crypto/hmac/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
* ```ts
* import { vec } from '../../types/bit_vec/module.f.ts'
* import { msbUtf8 } from '../../text/module.f.ts'
* import { sha256 } from '../sha2/module.f.ts'
* import { sha256 } from '../sha2/module.f.mjs'
*
* const r = hmac(sha256)(msbUtf8('key'))(msbUtf8('The quick brown fox jumps over the lazy dog'))
* if (r !== vec(256n)(0xf7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8n)) { throw r }
* ```
*/

import { length, type Vec, msb, vec, vec8, type Reduce, repeat } from '../../types/bit_vec/module.f.mjs'
import { computeSync, type Sha2 } from '../sha2/module.f.ts'
import { computeSync, type Sha2 } from '../sha2/module.f.mjs'

const { concat, xor } = msb

Expand Down
2 changes: 1 addition & 1 deletion fjs/crypto/hmac/proof.f.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { assertEq } from '../../asserts/module.f.mjs'
import { utf8 } from '../../text/module.f.ts'
import { uint, vec } from '../../types/bit_vec/module.f.mjs'
import { sha256, sha384, sha512 } from '../sha2/module.f.ts'
import { sha256, sha384, sha512 } from '../sha2/module.f.mjs'
import { hmac } from './module.f.ts'

export const proof = {
Expand Down
2 changes: 1 addition & 1 deletion fjs/crypto/pow/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { mask } from '../../types/bigint/module.f.mjs'
import { type Vec, uint } from '../../types/bit_vec/module.f.mjs'
import type { Nullable } from '../../types/nullable/module.f.mjs'
import { computeSync, sha256, type Sha2 } from '../sha2/module.f.ts'
import { computeSync, sha256, type Sha2 } from '../sha2/module.f.mjs'

const nBitsMantissa = mask(24n)
const mantissaSign = 0x00800000n
Expand Down
2 changes: 1 addition & 1 deletion fjs/crypto/pow/proof.f.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { utf8 } from '../../text/module.f.ts'
import { empty, uint } from '../../types/bit_vec/module.f.mjs'
import { computeSync, sha224, sha256 } from '../sha2/module.f.ts'
import { computeSync, sha224, sha256 } from '../sha2/module.f.mjs'
import { bitcoinPow, genesisNBits, genesisTarget, pow, sha256Pow, targetFromNBits } from './module.f.ts'
import { assert, assertEq, assertNotNullish } from '../../asserts/module.f.mjs'

Expand Down
Loading
Loading