neotoma 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/actions.js +2 -2
- package/dist/actions.js.map +1 -1
- package/dist/cli/bootstrap.js +0 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +158 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/crypto/auth.js +1 -1
- package/dist/crypto/auth.js.map +1 -1
- package/dist/mcp_ws_bridge.js +1 -1
- package/dist/mcp_ws_bridge.js.map +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/dist/services/field_converters.js +3 -3
- package/dist/services/field_converters.js.map +1 -1
- package/dist/services/field_validation.js +1 -1
- package/dist/services/field_validation.js.map +1 -1
- package/dist/services/mcp_auth.js +1 -1
- package/dist/services/mcp_auth.js.map +1 -1
- package/dist/services/mcp_oauth.js +1 -1
- package/dist/services/mcp_oauth.js.map +1 -1
- package/dist/services/parquet_reader.js +1 -1
- package/dist/services/parquet_reader.js.map +1 -1
- package/dist/services/public_key_registry.js +2 -2
- package/dist/services/public_key_registry.js.map +1 -1
- package/package.json +27 -7
- package/.claude/CLAUDE.md +0 -81
- package/.claude/rules/agent_constraints.md +0 -201
- package/.claude/rules/agent_instructions_sync_rules.md +0 -100
- package/.claude/rules/agent_test_execution.md +0 -358
- package/.claude/rules/autonomous_execution.md +0 -119
- package/.claude/rules/bug_fix_detection.md +0 -145
- package/.claude/rules/bug_learning.md +0 -154
- package/.claude/rules/checkpoint_management.md +0 -194
- package/.claude/rules/configuration_management.md +0 -159
- package/.claude/rules/content_style_enforcement.md +0 -141
- package/.claude/rules/dependency_installation.md +0 -148
- package/.claude/rules/document_loading_order.md +0 -197
- package/.claude/rules/documentation_rules.md +0 -169
- package/.claude/rules/downstream_doc_updates.md +0 -269
- package/.claude/rules/env_check.md +0 -55
- package/.claude/rules/environment_variables_1password.md +0 -315
- package/.claude/rules/environment_variables_env_file.md +0 -124
- package/.claude/rules/feature_unit_detection.md +0 -132
- package/.claude/rules/file_naming.md +0 -34
- package/.claude/rules/git_remote_sync.md +0 -242
- package/.claude/rules/instruction_documentation.md +0 -287
- package/.claude/rules/native_browser_debugging.md +0 -68
- package/.claude/rules/plan_execution_testing.md +0 -101
- package/.claude/rules/plan_format.md +0 -38
- package/.claude/rules/post_build_testing.md +0 -162
- package/.claude/rules/prefer_cli_tools.md +0 -233
- package/.claude/rules/readme_maintenance.md +0 -156
- package/.claude/rules/release_detection.md +0 -95
- package/.claude/rules/release_status_readme_update.md +0 -62
- package/.claude/rules/risk_management.md +0 -170
- package/.claude/rules/security.md +0 -168
- package/.claude/rules/social_media_conventions.md +0 -42
- package/.claude/rules/test_first_workflow.md +0 -344
- package/.claude/rules/worktree_env.md +0 -56
- package/.claude/settings.json +0 -5
- package/.claude/skills/commit.md +0 -762
- package/.claude/skills/create_feature_unit.md +0 -176
- package/.claude/skills/create_release.md +0 -428
- package/.claude/skills/fix_feature_bug.md +0 -93
- package/.claude/skills/pull.md +0 -314
- package/.claude/skills/setup_symlinks.md +0 -228
- package/.codex/config.toml +0 -92
- package/.cursor/commands/analyze.md +0 -574
- package/.cursor/commands/commit.md +0 -768
- package/.cursor/commands/create_feature_unit.md +0 -182
- package/.cursor/commands/create_prototype.md +0 -95
- package/.cursor/commands/create_release.md +0 -434
- package/.cursor/commands/create_rule.md +0 -296
- package/.cursor/commands/debug.md +0 -985
- package/.cursor/commands/final_review.md +0 -97
- package/.cursor/commands/fix_feature_bug.md +0 -99
- package/.cursor/commands/manage_error_debugging.md +0 -186
- package/.cursor/commands/migrate_plans.md +0 -499
- package/.cursor/commands/publish.md +0 -559
- package/.cursor/commands/pull.md +0 -320
- package/.cursor/commands/push.md +0 -259
- package/.cursor/commands/report.md +0 -1506
- package/.cursor/commands/report_error.md +0 -1505
- package/.cursor/commands/run_feature_workflow.md +0 -83
- package/.cursor/commands/setup_commands.md +0 -87
- package/.cursor/commands/setup_symlinks.md +0 -234
- package/.cursor/commands/sync_env_from_1password.md +0 -321
- package/.cursor/commands.json +0 -100
- package/.cursor/environment.json +0 -5
- package/.cursor/mcp.json.template +0 -16
- package/.cursor/plans/agent_skills_analysis_aac0f1b6.plan.md +0 -949
- package/.cursor/plans/agent_trust_framework_eb38ca7d.plan.md +0 -634
- package/.cursor/plans/all-storage-unstructured_provenance_df0b7a8f.plan.md +0 -112
- package/.cursor/plans/automated_error_debugging_cloud_agents.plan.md +0 -526
- package/.cursor/plans/automated_error_debugging_cursor_cli.plan.md +0 -599
- package/.cursor/plans/automated_error_debugging_localhost_clarified.plan.md +0 -510
- package/.cursor/plans/bug_report_and_contribution_client_guidance.plan.md +0 -143
- package/.cursor/plans/convert_1password_sync_to_mcp_343ca61c.plan.md +0 -282
- package/.cursor/plans/debug_pending_errors_command.plan.md +0 -531
- package/.cursor/plans/error_reporting_command_8868f27b.plan.md +0 -255
- package/.cursor/plans/mcp-cli-action-item-01-openapi-core.plan.md +0 -30
- package/.cursor/plans/mcp-cli-action-item-02-openapi-mcp-cli-mapping.plan.md +0 -18
- package/.cursor/plans/mcp-cli-action-item-03-cli-equivalent-logging.plan.md +0 -18
- package/.cursor/plans/mcp-cli-action-item-06-error-taxonomy.plan.md +0 -18
- package/.cursor/plans/mcp-cli-action-item-07-fixture-replay-graphs.plan.md +0 -18
- package/.cursor/plans/mcp-cli-action-item-08-cli-reference-executor.plan.md +0 -18
- package/.cursor/plans/mcp-cli-action-item-09-mcp-tools-atomic.plan.md +0 -18
- package/.cursor/plans/mcp-cli-action-item-10-canonical-walkthrough.plan.md +0 -18
- package/.cursor/plans/mcp-cli-action-item-11-fixtures-expected-outputs.plan.md +0 -18
- package/.cursor/plans/mcp-cli-action-item-12-failure-gallery.plan.md +0 -18
- package/.cursor/plans/mcp_source-path_documentation_5ce48609.plan.md +0 -83
- package/.cursor/plans/me_and_get_authenticated_user_response_updates.plan.md +0 -125
- package/.cursor/plans/multi-llm_provider_support_3fdeb361.plan.md +0 -120
- package/.cursor/plans/plan_migration_command_integrated.plan.md +0 -393
- package/.cursor/plans/schema_icon_enhancements_plan.md +0 -533
- package/.cursor/plans/site-react-tailwind-parity.plan.md +0 -82
- package/.cursor/plans/sources-first-ingestion-v8.plan.md +0 -0
- package/.cursor/plans/sources-first_ingestion_v10_baef2ba2.plan.md +0 -363
- package/.cursor/plans/test_coverage_gap_analysis_9cb70022.plan.md +0 -39
- package/.cursor/port_to_foundation_analysis.md +0 -217
- package/.cursor/rules/agent_constraints.mdc +0 -210
- package/.cursor/rules/autonomous_execution.mdc +0 -128
- package/.cursor/rules/configuration_management.mdc +0 -168
- package/.cursor/rules/cursor_rules_editing.mdc +0 -99
- package/.cursor/rules/cursor_rules_sync.mdc +0 -74
- package/.cursor/rules/cursor_rules_sync_requirement.mdc +0 -156
- package/.cursor/rules/developer_agent_instructions_sync_rules.mdc +0 -109
- package/.cursor/rules/document_loading_order.mdc +0 -206
- package/.cursor/rules/instruction_documentation.mdc +0 -296
- package/.cursor/rules/risk_management.mdc +0 -179
- package/.cursor/rules/security.mdc +0 -177
- package/.cursor/skipped_records/companies_skipped.json +0 -27
- package/.cursor/skipped_records/contacts_skipped.json +0 -23
- package/.cursor/skipped_records/goals_skipped.json +0 -7
- package/.cursor/skipped_records/people_skipped.json +0 -14
- package/.cursor/skipped_records/projects_skipped.json +0 -39
- package/.cursor/worktrees.json +0 -12
- package/.dockerignore +0 -9
- package/.env.example +0 -84
- package/.eslintrc.json +0 -11
- package/.github/workflows/deploy-pages-site.yml +0 -55
- package/.gitmodules +0 -12
- package/.husky/pre-commit +0 -42
- package/.mcp.json +0 -13
- package/.nvmrc +0 -1
- package/.prettierrc.json +0 -7
- package/.vscode/extensions.json +0 -5
- package/.vscode/settings.json +0 -47
- package/CONTRIBUTING.md +0 -23
- package/Dockerfile +0 -28
- package/SECURITY.md +0 -41
- package/components.json +0 -21
- package/cursor_rules_manifest.json +0 -28
- package/dist/__fixtures__/helpers.d.ts +0 -91
- package/dist/__fixtures__/helpers.d.ts.map +0 -1
- package/dist/__fixtures__/helpers.js +0 -384
- package/dist/__fixtures__/helpers.js.map +0 -1
- package/dist/__fixtures__/types.d.ts +0 -285
- package/dist/__fixtures__/types.d.ts.map +0 -1
- package/dist/__fixtures__/types.js +0 -7
- package/dist/__fixtures__/types.js.map +0 -1
- package/dist/__fixtures__/validation.d.ts +0 -45
- package/dist/__fixtures__/validation.d.ts.map +0 -1
- package/dist/__fixtures__/validation.js +0 -311
- package/dist/__fixtures__/validation.js.map +0 -1
- package/dist/config/plaid.d.ts +0 -21
- package/dist/config/plaid.d.ts.map +0 -1
- package/dist/config/plaid.js +0 -38
- package/dist/config/plaid.js.map +0 -1
- package/dist/events/event_emitter.d.ts +0 -24
- package/dist/events/event_emitter.d.ts.map +0 -1
- package/dist/events/event_emitter.js +0 -85
- package/dist/events/event_emitter.js.map +0 -1
- package/dist/events/event_log.d.ts +0 -23
- package/dist/events/event_log.d.ts.map +0 -1
- package/dist/events/event_log.js +0 -77
- package/dist/events/event_log.js.map +0 -1
- package/dist/events/event_schema.d.ts +0 -58
- package/dist/events/event_schema.d.ts.map +0 -1
- package/dist/events/event_schema.js +0 -43
- package/dist/events/event_schema.js.map +0 -1
- package/dist/events/event_validator.d.ts +0 -23
- package/dist/events/event_validator.d.ts.map +0 -1
- package/dist/events/event_validator.js +0 -90
- package/dist/events/event_validator.js.map +0 -1
- package/dist/events/index.d.ts +0 -9
- package/dist/events/index.d.ts.map +0 -1
- package/dist/events/index.js +0 -9
- package/dist/events/index.js.map +0 -1
- package/dist/events/replay.d.ts +0 -27
- package/dist/events/replay.d.ts.map +0 -1
- package/dist/events/replay.js +0 -62
- package/dist/events/replay.js.map +0 -1
- package/dist/hashing/hash_chain.d.ts +0 -31
- package/dist/hashing/hash_chain.d.ts.map +0 -1
- package/dist/hashing/hash_chain.js +0 -52
- package/dist/hashing/hash_chain.js.map +0 -1
- package/dist/integrations/plaid/client.d.ts +0 -53
- package/dist/integrations/plaid/client.d.ts.map +0 -1
- package/dist/integrations/plaid/client.js +0 -224
- package/dist/integrations/plaid/client.js.map +0 -1
- package/dist/integrations/plaid/normalizers.d.ts +0 -26
- package/dist/integrations/plaid/normalizers.d.ts.map +0 -1
- package/dist/integrations/plaid/normalizers.js +0 -166
- package/dist/integrations/plaid/normalizers.js.map +0 -1
- package/dist/integrations/providers/asana.d.ts +0 -9
- package/dist/integrations/providers/asana.d.ts.map +0 -1
- package/dist/integrations/providers/asana.js +0 -62
- package/dist/integrations/providers/asana.js.map +0 -1
- package/dist/integrations/providers/base.d.ts +0 -17
- package/dist/integrations/providers/base.d.ts.map +0 -1
- package/dist/integrations/providers/base.js +0 -64
- package/dist/integrations/providers/base.js.map +0 -1
- package/dist/integrations/providers/facebook.d.ts +0 -9
- package/dist/integrations/providers/facebook.d.ts.map +0 -1
- package/dist/integrations/providers/facebook.js +0 -58
- package/dist/integrations/providers/facebook.js.map +0 -1
- package/dist/integrations/providers/gmail.d.ts +0 -10
- package/dist/integrations/providers/gmail.d.ts.map +0 -1
- package/dist/integrations/providers/gmail.js +0 -67
- package/dist/integrations/providers/gmail.js.map +0 -1
- package/dist/integrations/providers/index.d.ts +0 -6
- package/dist/integrations/providers/index.d.ts.map +0 -1
- package/dist/integrations/providers/index.js +0 -25
- package/dist/integrations/providers/index.js.map +0 -1
- package/dist/integrations/providers/instagram.d.ts +0 -9
- package/dist/integrations/providers/instagram.d.ts.map +0 -1
- package/dist/integrations/providers/instagram.js +0 -47
- package/dist/integrations/providers/instagram.js.map +0 -1
- package/dist/integrations/providers/metadata.d.ts +0 -25
- package/dist/integrations/providers/metadata.d.ts.map +0 -1
- package/dist/integrations/providers/metadata.js +0 -407
- package/dist/integrations/providers/metadata.js.map +0 -1
- package/dist/integrations/providers/types.d.ts +0 -39
- package/dist/integrations/providers/types.d.ts.map +0 -1
- package/dist/integrations/providers/types.js +0 -2
- package/dist/integrations/providers/types.js.map +0 -1
- package/dist/integrations/providers/x.d.ts +0 -9
- package/dist/integrations/providers/x.d.ts.map +0 -1
- package/dist/integrations/providers/x.js +0 -78
- package/dist/integrations/providers/x.js.map +0 -1
- package/dist/reducers/record_reducer.d.ts +0 -25
- package/dist/reducers/record_reducer.d.ts.map +0 -1
- package/dist/reducers/record_reducer.js +0 -93
- package/dist/reducers/record_reducer.js.map +0 -1
- package/dist/reducers/reducer_registry.d.ts +0 -47
- package/dist/reducers/reducer_registry.d.ts.map +0 -1
- package/dist/reducers/reducer_registry.js +0 -82
- package/dist/reducers/reducer_registry.js.map +0 -1
- package/dist/repositories/db/event_repo.d.ts +0 -14
- package/dist/repositories/db/event_repo.d.ts.map +0 -1
- package/dist/repositories/db/event_repo.js +0 -67
- package/dist/repositories/db/event_repo.js.map +0 -1
- package/dist/repositories/db/state_repo.d.ts +0 -14
- package/dist/repositories/db/state_repo.d.ts.map +0 -1
- package/dist/repositories/db/state_repo.js +0 -61
- package/dist/repositories/db/state_repo.js.map +0 -1
- package/dist/repositories/file/event_repo.d.ts +0 -18
- package/dist/repositories/file/event_repo.d.ts.map +0 -1
- package/dist/repositories/file/event_repo.js +0 -148
- package/dist/repositories/file/event_repo.js.map +0 -1
- package/dist/repositories/file/state_repo.d.ts +0 -21
- package/dist/repositories/file/state_repo.d.ts.map +0 -1
- package/dist/repositories/file/state_repo.js +0 -89
- package/dist/repositories/file/state_repo.js.map +0 -1
- package/dist/repositories/sqlite/supabase_adapter.d.ts +0 -135
- package/dist/repositories/sqlite/supabase_adapter.d.ts.map +0 -1
- package/dist/repositories/sqlite/supabase_adapter.js +0 -810
- package/dist/repositories/sqlite/supabase_adapter.js.map +0 -1
- package/dist/services/connectors.d.ts +0 -89
- package/dist/services/connectors.d.ts.map +0 -1
- package/dist/services/connectors.js +0 -248
- package/dist/services/connectors.js.map +0 -1
- package/dist/services/event_generation.d.ts +0 -37
- package/dist/services/event_generation.d.ts.map +0 -1
- package/dist/services/event_generation.js +0 -236
- package/dist/services/event_generation.js.map +0 -1
- package/dist/services/extraction/rules.d.ts +0 -26
- package/dist/services/extraction/rules.d.ts.map +0 -1
- package/dist/services/extraction/rules.js +0 -691
- package/dist/services/extraction/rules.js.map +0 -1
- package/dist/services/file_analysis.d.ts +0 -38
- package/dist/services/file_analysis.d.ts.map +0 -1
- package/dist/services/file_analysis.js +0 -325
- package/dist/services/file_analysis.js.map +0 -1
- package/dist/services/graph_builder.d.ts +0 -51
- package/dist/services/graph_builder.d.ts.map +0 -1
- package/dist/services/graph_builder.js +0 -279
- package/dist/services/graph_builder.js.map +0 -1
- package/dist/services/importers.d.ts +0 -28
- package/dist/services/importers.d.ts.map +0 -1
- package/dist/services/importers.js +0 -174
- package/dist/services/importers.js.map +0 -1
- package/dist/services/observation_ingestion.d.ts +0 -26
- package/dist/services/observation_ingestion.d.ts.map +0 -1
- package/dist/services/observation_ingestion.js +0 -364
- package/dist/services/observation_ingestion.js.map +0 -1
- package/dist/services/payload_compiler.d.ts +0 -36
- package/dist/services/payload_compiler.d.ts.map +0 -1
- package/dist/services/payload_compiler.js +0 -121
- package/dist/services/payload_compiler.js.map +0 -1
- package/dist/services/payload_identity.d.ts +0 -35
- package/dist/services/payload_identity.d.ts.map +0 -1
- package/dist/services/payload_identity.js +0 -101
- package/dist/services/payload_identity.js.map +0 -1
- package/dist/services/payload_schema.d.ts +0 -104
- package/dist/services/payload_schema.d.ts.map +0 -1
- package/dist/services/payload_schema.js +0 -46
- package/dist/services/payload_schema.js.map +0 -1
- package/dist/services/plaid_sync.d.ts +0 -77
- package/dist/services/plaid_sync.d.ts.map +0 -1
- package/dist/services/plaid_sync.js +0 -273
- package/dist/services/plaid_sync.js.map +0 -1
- package/dist/services/record_comparison.d.ts +0 -29
- package/dist/services/record_comparison.d.ts.map +0 -1
- package/dist/services/record_comparison.js +0 -84
- package/dist/services/record_comparison.js.map +0 -1
- package/dist/services/records.d.ts +0 -31
- package/dist/services/records.d.ts.map +0 -1
- package/dist/services/records.js +0 -184
- package/dist/services/records.js.map +0 -1
- package/dist/services/search.d.ts +0 -15
- package/dist/services/search.d.ts.map +0 -1
- package/dist/services/search.js +0 -81
- package/dist/services/search.js.map +0 -1
- package/dist/services/summary.d.ts +0 -5
- package/dist/services/summary.d.ts.map +0 -1
- package/dist/services/summary.js +0 -118
- package/dist/services/summary.js.map +0 -1
- package/docs/NEOTOMA_MANIFEST.md +0 -152
- package/docs/api/rest_api.md +0 -466
- package/docs/architecture/agentic_portfolio_overview.md +0 -99
- package/docs/architecture/agentic_wallet_overview.md +0 -93
- package/docs/architecture/architectural_decisions.md +0 -462
- package/docs/architecture/architecture.md +0 -842
- package/docs/architecture/blockchain_readiness_assessment.md +0 -248
- package/docs/architecture/consistency.md +0 -539
- package/docs/architecture/conversational_ux_architecture.md +0 -240
- package/docs/architecture/determinism.md +0 -762
- package/docs/architecture/idempotence_pattern.md +0 -139
- package/docs/architecture/mcp_actions_assessment.md +0 -182
- package/docs/architecture/ner_vs_schema_first_extraction.md +0 -280
- package/docs/architecture/schema_expansion.md +0 -260
- package/docs/architecture/schema_handling.md +0 -209
- package/docs/architecture/source_material_model.md +0 -281
- package/docs/assets/neotoma_banner.png +0 -0
- package/docs/conventions/TEST_EXECUTION_IMPROVEMENTS.md +0 -205
- package/docs/conventions/always_on_rules_review.md +0 -66
- package/docs/conventions/code_conventions_implementation.md +0 -111
- package/docs/conventions/code_conventions_plan.md +0 -124
- package/docs/conventions/code_review_summary.md +0 -96
- package/docs/conventions/documentation_standards.md +0 -104
- package/docs/conventions/estimation_methodology.md +0 -146
- package/docs/conventions/file_naming_migration_status.md +0 -94
- package/docs/conventions/readme_generation_framework.md +0 -230
- package/docs/conventions/time_tracking_template.md +0 -60
- package/docs/conventions/writing_style_guide.md +0 -252
- package/docs/developer/agent_cli_configuration.md +0 -140
- package/docs/developer/agent_instructions_sync_rules.mdc +0 -97
- package/docs/developer/canonical_walkthrough.md +0 -137
- package/docs/developer/cli_agent_instructions.md +0 -141
- package/docs/developer/cli_overview.md +0 -207
- package/docs/developer/cli_reference.md +0 -518
- package/docs/developer/developer_preview_launch_checklist.md +0 -128
- package/docs/developer/developer_preview_storage.md +0 -35
- package/docs/developer/developer_release_manual_test_checklist.md +0 -209
- package/docs/developer/development_workflow.md +0 -308
- package/docs/developer/environment/CONNECTOR_SECRET_KEY_SETUP.md +0 -96
- package/docs/developer/environment/DEV_CONNECTOR_SECRET_KEY_EXPLANATION.md +0 -80
- package/docs/developer/environment/ENV_MAPPINGS_STATUS.md +0 -86
- package/docs/developer/environment/ENV_VAR_NAMING_STRATEGY.md +0 -145
- package/docs/developer/environment/MIGRATION_TO_SINGLE_VAR_NAMES.md +0 -89
- package/docs/developer/environment/QUICK_START_1PASSWORD.md +0 -126
- package/docs/developer/environment/README.md +0 -27
- package/docs/developer/environment/SETUP_ENV_MAPPINGS.md +0 -256
- package/docs/developer/environment_distinction_audit.md +0 -43
- package/docs/developer/fix_doc_inconsistencies_plan.md +0 -63
- package/docs/developer/getting_started.md +0 -100
- package/docs/developer/import_interpretation_debug.md +0 -69
- package/docs/developer/launchd_dev_servers.md +0 -51
- package/docs/developer/launchd_watch_build.md +0 -37
- package/docs/developer/mcp/instructions.md +0 -71
- package/docs/developer/mcp/invalid_connection_id_handling.md +0 -181
- package/docs/developer/mcp/tool_descriptions.yaml +0 -41
- package/docs/developer/mcp/unauthenticated.md +0 -30
- package/docs/developer/mcp_chatgpt_setup.md +0 -159
- package/docs/developer/mcp_claude_code_setup.md +0 -519
- package/docs/developer/mcp_https_testing.md +0 -178
- package/docs/developer/mcp_https_testing_status.md +0 -130
- package/docs/developer/mcp_https_tunnel_status.md +0 -147
- package/docs/developer/mcp_oauth_migration_guide.md +0 -196
- package/docs/developer/mcp_overview.md +0 -145
- package/docs/developer/mcp_server_examples_from_cursor_docs.md +0 -485
- package/docs/developer/observation_architecture_documentation_integration.md +0 -368
- package/docs/developer/release_orchestrator.md +0 -197
- package/docs/developer/repository_cleanup_plan.md +0 -87
- package/docs/developer/resolved_blockers.md +0 -49
- package/docs/developer/schema_initialization.md +0 -182
- package/docs/developer/secrets/README.md +0 -15
- package/docs/developer/secrets/secrets_architecture.md +0 -95
- package/docs/developer/secrets/secrets_manager_value.md +0 -53
- package/docs/developer/secrets/secrets_secure_approach.md +0 -103
- package/docs/developer/secrets/secrets_setup.md +0 -116
- package/docs/developer/shared_components_submodule_setup.md +0 -273
- package/docs/developer/spec_compliance_validation_system.md +0 -261
- package/docs/developer/test_coverage_gap_analysis_plan.md +0 -36
- package/docs/developer/tunnels.md +0 -327
- package/docs/developer/vite_troubleshooting.md +0 -111
- package/docs/doc_dependencies.yaml +0 -497
- package/docs/examples/schema_breaking_change_reconciliation.md +0 -515
- package/docs/feature_units/completed/FU-050/FU-050_spec.md +0 -341
- package/docs/feature_units/completed/FU-050/manifest.yaml +0 -330
- package/docs/feature_units/completed/FU-051/FU-051_spec.md +0 -173
- package/docs/feature_units/completed/FU-051/manifest.yaml +0 -229
- package/docs/feature_units/completed/FU-052/FU-052_spec.md +0 -158
- package/docs/feature_units/completed/FU-052/manifest.yaml +0 -188
- package/docs/feature_units/completed/FU-053/FU-053_spec.md +0 -144
- package/docs/feature_units/completed/FU-053/manifest.yaml +0 -145
- package/docs/feature_units/completed/FU-054/FU-054_spec.md +0 -144
- package/docs/feature_units/completed/FU-054/manifest.yaml +0 -139
- package/docs/feature_units/completed/FU-702/billing_spec.md +0 -413
- package/docs/feature_units/completed/FU-702/manifest.yaml +0 -418
- package/docs/feature_units/standards/DISCOVERY_CAGAN_ALIGNMENT.md +0 -214
- package/docs/feature_units/standards/creating_feature_units.md +0 -385
- package/docs/feature_units/standards/discovery_process.md +0 -821
- package/docs/feature_units/standards/error_protocol.md +0 -60
- package/docs/feature_units/standards/execution_instructions.md +0 -87
- package/docs/feature_units/standards/feature_unit_spec.md +0 -325
- package/docs/feature_units/standards/integration_test_execution.md +0 -127
- package/docs/feature_units/standards/manifest_template.yaml +0 -370
- package/docs/feature_units/standards/model_selection.md +0 -207
- package/docs/feature_units/standards/multi_agent_orchestration.md +0 -411
- package/docs/feature_units/standards/release_report_generation.md +0 -448
- package/docs/feature_units/standards/release_report_spec.md +0 -444
- package/docs/feature_units/standards/release_report_template.md +0 -76
- package/docs/feature_units/standards/spec_compliance_validation.md +0 -147
- package/docs/feature_units/standards/worker_agent_template.md +0 -191
- package/docs/foundation/ai_safety.md +0 -10
- package/docs/foundation/composability_analysis.md +0 -308
- package/docs/foundation/core_identity.md +0 -50
- package/docs/foundation/documentation_design_system.md +0 -505
- package/docs/foundation/entity_resolution.md +0 -34
- package/docs/foundation/layered_architecture.md +0 -99
- package/docs/foundation/mmry_comparison.md +0 -176
- package/docs/foundation/philosophy.md +0 -103
- package/docs/foundation/problem_statement.md +0 -41
- package/docs/foundation/product_positioning.md +0 -69
- package/docs/foundation/product_principles.md +0 -18
- package/docs/foundation/quality_requirements.md +0 -68
- package/docs/foundation/timeline_events.md +0 -19
- package/docs/foundation/user_workflows.md +0 -38
- package/docs/implementation/PARQUET_MCP_SERVER_FIXES.md +0 -373
- package/docs/implementation/PARQUET_SUPPORT_IMPLEMENTATION.md +0 -207
- package/docs/infrastructure/deployment.md +0 -372
- package/docs/legal/README.md +0 -51
- package/docs/legal/compliance.md +0 -854
- package/docs/legal/privacy_policy.md +0 -114
- package/docs/legal/privacy_policy_changelog.md +0 -49
- package/docs/legal/terms_of_service.md +0 -185
- package/docs/legal/terms_of_service_changelog.md +0 -62
- package/docs/migration/llm_extraction_removal.md +0 -387
- package/docs/migration/llm_interpretation_docs_update.md +0 -130
- package/docs/observability/logging.md +0 -50
- package/docs/observability/metrics_standard.md +0 -38
- package/docs/observability/tracing.md +0 -41
- package/docs/operations/debugging/README.md +0 -11
- package/docs/operations/debugging/error_debug_instructions.md +0 -55
- package/docs/operations/health_check.md +0 -73
- package/docs/operations/runbook.md +0 -88
- package/docs/prompts/llm_extraction_system_prompt.md +0 -31
- package/docs/proposals/IMPLEMENTATION_SUMMARY.md +0 -198
- package/docs/proposals/MIGRATION_REPORT.md +0 -65
- package/docs/proposals/PROPOSAL_TEMPLATE.md +0 -58
- package/docs/proposals/README.md +0 -57
- package/docs/proposals/agent-trust-framework.md +0 -621
- package/docs/proposals/conversation_turn_identity_reverts_forks.md +0 -144
- package/docs/proposals/document-v023-release.md +0 -898
- package/docs/proposals/iterative_chat_store_mcp_instructions.md +0 -155
- package/docs/proposals/llm_sampling_parameters_interpretation_config.md +0 -196
- package/docs/proposals/mcp-cli-action-items.md +0 -207
- package/docs/proposals/plan-migration-command-integrated-with-commit.md +0 -386
- package/docs/proposals/sources-first-ingestion-v10.md +0 -348
- package/docs/proposals/test-coverage-gap-analysis.md +0 -26
- package/docs/prototypes/PROTOTYPE_QUICKSTART.md +0 -56
- package/docs/prototypes/README.md +0 -74
- package/docs/reference/error_codes.md +0 -223
- package/docs/releases/archived/aspirational/README.md +0 -57
- package/docs/releases/archived/aspirational/v0.4.0/manifest.yaml +0 -94
- package/docs/releases/archived/aspirational/v0.4.0/release_plan.md +0 -51
- package/docs/releases/archived/aspirational/v0.5.0/manifest.yaml +0 -152
- package/docs/releases/archived/aspirational/v0.5.0/release_plan.md +0 -236
- package/docs/releases/archived/aspirational/v0.9.0/README.md +0 -78
- package/docs/releases/archived/aspirational/v0.9.0/manifest.yaml +0 -111
- package/docs/releases/archived/aspirational/v0.9.0/release_plan.md +0 -238
- package/docs/releases/archived/aspirational/v0.9.0/status.md +0 -89
- package/docs/releases/archived/aspirational/v1.0.0/UI_REFACTORING_PLAN.md +0 -239
- package/docs/releases/archived/aspirational/v1.0.0/acceptance_criteria.md +0 -88
- package/docs/releases/archived/aspirational/v1.0.0/approach_comparison.md +0 -558
- package/docs/releases/archived/aspirational/v1.0.0/architectural_impact_chat_ui.md +0 -195
- package/docs/releases/archived/aspirational/v1.0.0/blog_post_update_directives.md +0 -491
- package/docs/releases/archived/aspirational/v1.0.0/business_viability_discovery_plan.md +0 -135
- package/docs/releases/archived/aspirational/v1.0.0/compliance_reports/FU-100_compliance.md +0 -23
- package/docs/releases/archived/aspirational/v1.0.0/compliance_reports/FU-101_compliance.md +0 -23
- package/docs/releases/archived/aspirational/v1.0.0/compliance_reports/FU-102_compliance.md +0 -23
- package/docs/releases/archived/aspirational/v1.0.0/compliance_reports/FU-103_compliance.md +0 -23
- package/docs/releases/archived/aspirational/v1.0.0/compliance_reports/FU-105_compliance.md +0 -23
- package/docs/releases/archived/aspirational/v1.0.0/continuous_discovery_log.md +0 -77
- package/docs/releases/archived/aspirational/v1.0.0/continuous_discovery_plan.md +0 -145
- package/docs/releases/archived/aspirational/v1.0.0/cross_platform_signal_detection.md +0 -181
- package/docs/releases/archived/aspirational/v1.0.0/deployment_strategy.md +0 -115
- package/docs/releases/archived/aspirational/v1.0.0/discovery_checklist.md +0 -195
- package/docs/releases/archived/aspirational/v1.0.0/discovery_filtering_criteria.md +0 -197
- package/docs/releases/archived/aspirational/v1.0.0/discovery_filtering_keywords.md +0 -143
- package/docs/releases/archived/aspirational/v1.0.0/discovery_lead_sourcing_tools.md +0 -438
- package/docs/releases/archived/aspirational/v1.0.0/discovery_plan.md +0 -185
- package/docs/releases/archived/aspirational/v1.0.0/execution_schedule.md +0 -130
- package/docs/releases/archived/aspirational/v1.0.0/feasibility_validation_plan.md +0 -116
- package/docs/releases/archived/aspirational/v1.0.0/handle_registration.md +0 -263
- package/docs/releases/archived/aspirational/v1.0.0/implementation_logs/FU-100_implementation_log.md +0 -51
- package/docs/releases/archived/aspirational/v1.0.0/implementation_logs/FU-101_implementation_log.md +0 -51
- package/docs/releases/archived/aspirational/v1.0.0/implementation_logs/FU-102_implementation_log.md +0 -51
- package/docs/releases/archived/aspirational/v1.0.0/implementation_logs/FU-103_implementation_log.md +0 -51
- package/docs/releases/archived/aspirational/v1.0.0/implementation_logs/FU-105_implementation_log.md +0 -51
- package/docs/releases/archived/aspirational/v1.0.0/manifest.yaml +0 -160
- package/docs/releases/archived/aspirational/v1.0.0/marketing_agent_instructions.md +0 -209
- package/docs/releases/archived/aspirational/v1.0.0/marketing_automation_implementation.md +0 -996
- package/docs/releases/archived/aspirational/v1.0.0/marketing_automation_plan.md +0 -291
- package/docs/releases/archived/aspirational/v1.0.0/marketing_dogfooding_analysis.md +0 -295
- package/docs/releases/archived/aspirational/v1.0.0/marketing_metrics_plan.md +0 -120
- package/docs/releases/archived/aspirational/v1.0.0/marketing_plan.md +0 -280
- package/docs/releases/archived/aspirational/v1.0.0/marketing_segments_plan.md +0 -128
- package/docs/releases/archived/aspirational/v1.0.0/participant_recruitment_log.md +0 -392
- package/docs/releases/archived/aspirational/v1.0.0/post_launch_marketing_plan.md +0 -252
- package/docs/releases/archived/aspirational/v1.0.0/pre_launch_marketing_plan.md +0 -748
- package/docs/releases/archived/aspirational/v1.0.0/pre_mortem.md +0 -122
- package/docs/releases/archived/aspirational/v1.0.0/subscription_detection_strategy.md +0 -160
- package/docs/releases/archived/aspirational/v1.0.0/usability_discovery_plan.md +0 -115
- package/docs/releases/archived/aspirational/v1.0.0/value_discovery_plan.md +0 -279
- package/docs/releases/archived/aspirational/v1.0.0/visibility_timing_analysis.md +0 -402
- package/docs/releases/archived/aspirational/v2.0.0/status.md +0 -120
- package/docs/releases/archived/aspirational/v2.1.0/manifest.yaml +0 -469
- package/docs/releases/archived/aspirational/v2.2.0/manifest.yaml +0 -165
- package/docs/releases/archived/aspirational/v2.2.0/status.md +0 -283
- package/docs/releases/compliance_reports/all_fus_compliance_summary.md +0 -112
- package/docs/releases/in_progress/v0.2.0/agent_status.json +0 -420
- package/docs/releases/in_progress/v0.2.0/status.md +0 -90
- package/docs/releases/v0.1.0/agent_status.json +0 -242
- package/docs/releases/v0.1.0/agent_status.json.example +0 -76
- package/docs/releases/v0.1.0/compliance_reports/FU-000_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-002_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-050_compliance.md +0 -59
- package/docs/releases/v0.1.0/compliance_reports/FU-051_compliance.md +0 -39
- package/docs/releases/v0.1.0/compliance_reports/FU-052_compliance.md +0 -44
- package/docs/releases/v0.1.0/compliance_reports/FU-053_compliance.md +0 -25
- package/docs/releases/v0.1.0/compliance_reports/FU-054_compliance.md +0 -31
- package/docs/releases/v0.1.0/compliance_reports/FU-055_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-056_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-057_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-058_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-059_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-061_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-100_compliance.md +0 -97
- package/docs/releases/v0.1.0/compliance_reports/FU-104_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-200_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-201_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-202_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-203_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-204_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-205_compliance.md +0 -23
- package/docs/releases/v0.1.0/compliance_reports/FU-206_compliance.md +0 -23
- package/docs/releases/v0.1.0/execution_schedule.md +0 -174
- package/docs/releases/v0.1.0/fu_spec_status.md +0 -83
- package/docs/releases/v0.1.0/implementation_logs/FU-000_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-002_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-050_implementation_log.md +0 -111
- package/docs/releases/v0.1.0/implementation_logs/FU-051_implementation_log.md +0 -91
- package/docs/releases/v0.1.0/implementation_logs/FU-052_implementation_log.md +0 -81
- package/docs/releases/v0.1.0/implementation_logs/FU-053_implementation_log.md +0 -71
- package/docs/releases/v0.1.0/implementation_logs/FU-054_implementation_log.md +0 -71
- package/docs/releases/v0.1.0/implementation_logs/FU-055_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-056_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-057_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-058_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-059_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-061_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-100_implementation_log.md +0 -251
- package/docs/releases/v0.1.0/implementation_logs/FU-104_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-200_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-201_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-202_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-203_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-204_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-205_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/implementation_logs/FU-206_implementation_log.md +0 -51
- package/docs/releases/v0.1.0/integration_tests.md +0 -316
- package/docs/releases/v0.1.0/manifest.yaml +0 -291
- package/docs/releases/v0.1.0/mcp_actions_status.md +0 -101
- package/docs/releases/v0.1.0/release_plan.md +0 -196
- package/docs/releases/v0.1.0/status.md +0 -148
- package/docs/releases/v0.1.0/test_coverage_setup_notes.md +0 -39
- package/docs/releases/v0.1.1/manifest.yaml +0 -153
- package/docs/releases/v0.2.0/status.md +0 -167
- package/docs/releases/v0.2.1/acceptance_criteria.md +0 -200
- package/docs/releases/v0.2.1/execution_schedule.md +0 -114
- package/docs/releases/v0.2.1/feature_unit_overview.md +0 -246
- package/docs/releases/v0.2.1/integration_tests.md +0 -281
- package/docs/releases/v0.2.1/manifest.yaml +0 -141
- package/docs/releases/v0.2.1/release_plan.md +0 -211
- package/docs/releases/v0.2.1/status.md +0 -106
- package/docs/releases/v0.2.15/README.md +0 -79
- package/docs/releases/v0.2.15/migrations/01_add_source_graph_edges.sql +0 -109
- package/docs/releases/v0.2.15/migrations/02_drop_legacy_tables.sql +0 -130
- package/docs/releases/v0.2.2/execution_schedule.md +0 -123
- package/docs/releases/v0.2.2/integration_tests.md +0 -258
- package/docs/releases/v0.2.2/manifest.yaml +0 -108
- package/docs/releases/v0.2.2/release_plan.md +0 -246
- package/docs/releases/v0.2.2/status.md +0 -113
- package/docs/releases/v0.2.3/agent_skills_alignment.md +0 -738
- package/docs/releases/v0.2.3/enhancements_summary.md +0 -309
- package/docs/releases/v0.2.3/integration_guide.md +0 -3400
- package/docs/releases/v0.2.3/manifest.yaml +0 -212
- package/docs/releases/v0.2.3/mcp_actions.md +0 -491
- package/docs/releases/v0.2.3/plan_completion_review.md +0 -410
- package/docs/releases/v0.2.3/release_overview.md +0 -13
- package/docs/releases/v0.2.3/schema_extensions/agent_decision.md +0 -311
- package/docs/releases/v0.2.3/schema_extensions/agent_session.md +0 -464
- package/docs/releases/v0.2.3/schema_extensions/architectural_decision.md +0 -390
- package/docs/releases/v0.2.3/schema_extensions/codebase_entity.md +0 -404
- package/docs/releases/v0.2.3/schema_extensions/feature_unit.md +0 -307
- package/docs/releases/v0.2.3/schema_extensions/release.md +0 -338
- package/docs/releases/v0.2.3/schema_extensions/validation_result.md +0 -377
- package/docs/releases/v0.2.3/spec.md +0 -569
- package/docs/releases/v0.3.0/manifest.yaml +0 -77
- package/docs/releases/v0.3.0/migrations/01_add_source_graph_edges.sql +0 -110
- package/docs/releases/v0.3.0/migrations/02_drop_legacy_tables.sql +0 -131
- package/docs/releases/v0.3.0/status.md +0 -193
- package/docs/reports/AUTO_ENHANCEMENT_TEST_RESULTS.md +0 -51
- package/docs/reports/AUTO_ENHANCEMENT_TEST_SUMMARY.md +0 -64
- package/docs/reports/BIGINT_SERIALIZATION_DEBUG.md +0 -75
- package/docs/reports/BUG_LEARNING_PROTOCOL_ESTABLISHED.md +0 -179
- package/docs/reports/CONSOLE_LOG_MCP_PROTOCOL_FIX.md +0 -58
- package/docs/reports/CRYPTO_TRANSACTION_DISCREPANCY_RESOLUTION.md +0 -108
- package/docs/reports/CRYPTO_TRANSACTION_SIDE_BY_SIDE_COMPARISON.md +0 -165
- package/docs/reports/FAILING_TESTS_ANALYSIS.md +0 -140
- package/docs/reports/FAILING_TESTS_SUMMARY.md +0 -106
- package/docs/reports/FINAL_PARQUET_COMPARISON.md +0 -226
- package/docs/reports/FINAL_TEST_STATUS.md +0 -145
- package/docs/reports/LEGACY_REMOVAL_SUMMARY.md +0 -108
- package/docs/reports/MCP_ACTIONS_SUMMARY.md +0 -329
- package/docs/reports/MCP_ACTION_TEST_COVERAGE.md +0 -132
- package/docs/reports/MCP_SPEC_COMPARISON.md +0 -306
- package/docs/reports/MCP_SPEC_COMPARISON_UPDATED.md +0 -247
- package/docs/reports/MCP_SPEC_VOCABULARY_CONFORMANCE.md +0 -220
- package/docs/reports/MCP_TEST_SUITE_IMPLEMENTATION.md +0 -180
- package/docs/reports/MCP_TEST_SUITE_RESULTS.md +0 -182
- package/docs/reports/PARQUET_MCP_BUG_REPORT.md +0 -70
- package/docs/reports/PARQUET_MCP_STORAGE_COMPLETE.md +0 -214
- package/docs/reports/PARQUET_SAMPLE_FILES_CREATED.md +0 -49
- package/docs/reports/PARQUET_STORAGE_SUCCESS.md +0 -263
- package/docs/reports/PARQUET_VS_NEOTOMA_COMPARISON.md +0 -241
- package/docs/reports/REIMPORT_TASKS_BLOCKER.md +0 -50
- package/docs/reports/SAMPLE_FILE_STRUCTURE_UPDATE.md +0 -68
- package/docs/reports/SAMPLE_PARQUET_IMPORT_TEST_RESULTS.md +0 -91
- package/docs/reports/SCHEMA_ENHANCEMENT_STATUS.md +0 -84
- package/docs/reports/SCHEMA_ENHANCEMENT_TEST_RESULTS.md +0 -78
- package/docs/reports/TASK_RELOAD_BLOCKER.md +0 -40
- package/docs/reports/TEST_FIXES_SUMMARY.md +0 -96
- package/docs/reports/VOCABULARY_CONFORMANCE_REVIEW.md +0 -177
- package/docs/reports/WHY_TESTS_MISSED_BIGINT_ISSUE.md +0 -144
- package/docs/reports/beyond_rag_agent_memory_neotoma_architecture_report.md +0 -103
- package/docs/reports/dhh_clankers_with_claws_neotoma_report.md +0 -102
- package/docs/reports/dr_cintas_pageindex_structure_over_embeddings_report.md +0 -77
- package/docs/reports/failure_gallery.md +0 -97
- package/docs/reports/fixture_expansion_summary.md +0 -204
- package/docs/reports/mcp_action_names_review.md +0 -131
- package/docs/reports/mcp_cli_action_items_fidelity_report.md +0 -189
- package/docs/reports/neotoma_pdf_interpreted_as_note_investigation_2026_02_23.md +0 -89
- package/docs/reports/plan_execution_changes_report.md +0 -122
- package/docs/reports/schema_distinctions.md +0 -210
- package/docs/reports/schema_redundancy_analysis.md +0 -304
- package/docs/specs/FUNCTIONAL_REQUIREMENTS.md +0 -160
- package/docs/specs/GENERAL_REQUIREMENTS.md +0 -30
- package/docs/specs/ICP_PRIORITY_TIERS.md +0 -132
- package/docs/specs/ICP_PROFILES.md +0 -2345
- package/docs/specs/INTERNAL_MCP_RELEASE.md +0 -300
- package/docs/specs/MANIFEST_ALIGNMENT_SUMMARY.md +0 -162
- package/docs/specs/MCP_SPEC.md +0 -2275
- package/docs/specs/METRICS_REQUIREMENTS.md +0 -386
- package/docs/specs/MVP_EXECUTION_PLAN.md +0 -956
- package/docs/specs/MVP_FEATURE_UNITS.md +0 -1821
- package/docs/specs/MVP_OVERVIEW.md +0 -184
- package/docs/specs/NONFUNCTIONAL_REQUIREMENTS.md +0 -98
- package/docs/specs/ONBOARDING_SPEC.md +0 -591
- package/docs/specs/PARQUET_MCP_RESOURCES_SPEC.md +0 -328
- package/docs/specs/TEST_PLAN.md +0 -116
- package/docs/specs/UI_SPEC.md +0 -93
- package/docs/subsystems/accessibility.md +0 -48
- package/docs/subsystems/auth.md +0 -170
- package/docs/subsystems/deletion.md +0 -494
- package/docs/subsystems/entity_merge.md +0 -300
- package/docs/subsystems/errors.md +0 -82
- package/docs/subsystems/events.md +0 -50
- package/docs/subsystems/i18n.md +0 -42
- package/docs/subsystems/ingestion/ingestion.md +0 -772
- package/docs/subsystems/ingestion/state_machines.md +0 -49
- package/docs/subsystems/observation_architecture.md +0 -379
- package/docs/subsystems/privacy.md +0 -71
- package/docs/subsystems/record_types.md +0 -753
- package/docs/subsystems/reducer.md +0 -436
- package/docs/subsystems/relationships.md +0 -455
- package/docs/subsystems/schema.md +0 -1213
- package/docs/subsystems/schema_registry.md +0 -588
- package/docs/subsystems/schema_snapshots/.gitkeep +0 -6
- package/docs/subsystems/schema_snapshots/README.md +0 -209
- package/docs/subsystems/schema_snapshots/account/v1.0.json +0 -52
- package/docs/subsystems/schema_snapshots/address/v1.0.json +0 -79
- package/docs/subsystems/schema_snapshots/agent_message/v1.0.json +0 -96
- package/docs/subsystems/schema_snapshots/balance/v1.0.json +0 -64
- package/docs/subsystems/schema_snapshots/company/v1.0.json +0 -86
- package/docs/subsystems/schema_snapshots/contact/v1.0.json +0 -68
- package/docs/subsystems/schema_snapshots/contact/v1.1.json +0 -112
- package/docs/subsystems/schema_snapshots/contract/v1.0.json +0 -48
- package/docs/subsystems/schema_snapshots/conversation/v1.0.json +0 -102
- package/docs/subsystems/schema_snapshots/crypto_transaction/v1.0.json +0 -76
- package/docs/subsystems/schema_snapshots/email/v1.0.json +0 -87
- package/docs/subsystems/schema_snapshots/event/v1.0.json +0 -79
- package/docs/subsystems/schema_snapshots/exercise/v1.0.json +0 -72
- package/docs/subsystems/schema_snapshots/fixed_cost/v1.0.json +0 -112
- package/docs/subsystems/schema_snapshots/flow/v1.0.json +0 -84
- package/docs/subsystems/schema_snapshots/goal/v1.0.json +0 -71
- package/docs/subsystems/schema_snapshots/holding/v1.0.json +0 -75
- package/docs/subsystems/schema_snapshots/income/v1.0.json +0 -68
- package/docs/subsystems/schema_snapshots/liability/v1.0.json +0 -60
- package/docs/subsystems/schema_snapshots/location/v1.0.json +0 -79
- package/docs/subsystems/schema_snapshots/meal/v1.0.json +0 -68
- package/docs/subsystems/schema_snapshots/message/v1.0.json +0 -72
- package/docs/subsystems/schema_snapshots/note/v1.0.json +0 -64
- package/docs/subsystems/schema_snapshots/order/v1.0.json +0 -72
- package/docs/subsystems/schema_snapshots/person/v1.0.json +0 -86
- package/docs/subsystems/schema_snapshots/project/v1.0.json +0 -75
- package/docs/subsystems/schema_snapshots/property/v1.0.json +0 -64
- package/docs/subsystems/schema_snapshots/purchase/v1.0.json +0 -75
- package/docs/subsystems/schema_snapshots/relationship/v1.0.json +0 -63
- package/docs/subsystems/schema_snapshots/task/v1.0.json +0 -91
- package/docs/subsystems/schema_snapshots/tax_event/v1.0.json +0 -72
- package/docs/subsystems/schema_snapshots/tax_filing/v1.0.json +0 -83
- package/docs/subsystems/schema_snapshots/transaction/v1.0.json +0 -40
- package/docs/subsystems/schema_snapshots/transfer/v1.0.json +0 -76
- package/docs/subsystems/schema_snapshots/wallet/v1.0.json +0 -68
- package/docs/subsystems/search/search.md +0 -63
- package/docs/subsystems/sources.md +0 -493
- package/docs/subsystems/vector_ops.md +0 -72
- package/docs/templates/issue_template.md +0 -36
- package/docs/templates/pr_template.md +0 -74
- package/docs/testing/ROUTE_COVERAGE_MATRIX.md +0 -104
- package/docs/testing/WHY_PARTIAL_ROUTE_COVERAGE.md +0 -183
- package/docs/testing/automated_test_catalog.md +0 -353
- package/docs/testing/cli_command_coverage_review.md +0 -130
- package/docs/testing/fixtures_standard.md +0 -202
- package/docs/testing/test_coverage_audit_summary.md +0 -571
- package/docs/testing/testing_standard.md +0 -146
- package/docs/ui/DESIGN_SYSTEM_UPDATE_SUMMARY.md +0 -152
- package/docs/ui/SHADCN_INTEGRATION_COMPLETE.md +0 -255
- package/docs/ui/design_constraints_template.yaml +0 -228
- package/docs/ui/design_system/accessibility.md +0 -38
- package/docs/ui/design_system/authentication_components.md +0 -38
- package/docs/ui/design_system/billing_components.md +0 -36
- package/docs/ui/design_system/brand_alignment.md +0 -35
- package/docs/ui/design_system/color_palette.md +0 -95
- package/docs/ui/design_system/component_styles.md +0 -241
- package/docs/ui/design_system/dark_mode.md +0 -30
- package/docs/ui/design_system/empty_states.md +0 -47
- package/docs/ui/design_system/error_states.md +0 -35
- package/docs/ui/design_system/file_upload_components.md +0 -60
- package/docs/ui/design_system/future_considerations.md +0 -19
- package/docs/ui/design_system/iconography.md +0 -21
- package/docs/ui/design_system/icp_aesthetic_analysis.md +0 -35
- package/docs/ui/design_system/icp_preference_alignment.md +0 -33
- package/docs/ui/design_system/implementation_notes.md +0 -119
- package/docs/ui/design_system/loading_states.md +0 -40
- package/docs/ui/design_system/motion_and_animation.md +0 -45
- package/docs/ui/design_system/navigation_components.md +0 -63
- package/docs/ui/design_system/onboarding_components.md +0 -48
- package/docs/ui/design_system/responsive_design.md +0 -26
- package/docs/ui/design_system/search_components.md +0 -32
- package/docs/ui/design_system/settings_components.md +0 -29
- package/docs/ui/design_system/spacing_and_layout.md +0 -67
- package/docs/ui/design_system/style_guide.md +0 -395
- package/docs/ui/design_system/typography.md +0 -88
- package/docs/ui/design_system/visual_hierarchy.md +0 -64
- package/docs/ui/design_system.md +0 -124
- package/docs/ui/dsl_spec.md +0 -97
- package/docs/ui/patterns/dashboard.md +0 -58
- package/docs/ui/patterns/detail.md +0 -68
- package/docs/ui/patterns/list.md +0 -72
- package/docs/ui/patterns/navigation.md +0 -314
- package/docs/ui/patterns/settings.md +0 -52
- package/docs/ui/patterns/wizard.md +0 -53
- package/docs/ui/prototype_guide.md +0 -300
- package/docs/ui/shadcn_components.md +0 -189
- package/docs/ui/style_guide_updates.md +0 -74
- package/docs/vocabulary/canonical_terms.md +0 -318
- package/fly.toml +0 -29
- package/foundation/.cursor/rules/agent_constraints.mdc +0 -198
- package/foundation/.cursor/rules/agent_test_execution.mdc +0 -356
- package/foundation/.cursor/rules/autonomous_execution.mdc +0 -117
- package/foundation/.cursor/rules/behavioral_self_adaptation.mdc +0 -531
- package/foundation/.cursor/rules/bug_fix_detection.mdc +0 -142
- package/foundation/.cursor/rules/checkpoint_management.mdc +0 -191
- package/foundation/.cursor/rules/configuration_management.mdc +0 -156
- package/foundation/.cursor/rules/content_style_enforcement.mdc +0 -138
- package/foundation/.cursor/rules/dependency_installation.mdc +0 -146
- package/foundation/.cursor/rules/document_loading_order.mdc +0 -194
- package/foundation/.cursor/rules/documentation_rules.mdc +0 -166
- package/foundation/.cursor/rules/downstream_doc_updates.mdc +0 -266
- package/foundation/.cursor/rules/environment_variables_1password.mdc +0 -307
- package/foundation/.cursor/rules/environment_variables_env_file.mdc +0 -121
- package/foundation/.cursor/rules/feature_unit_detection.mdc +0 -129
- package/foundation/.cursor/rules/file_naming.mdc +0 -31
- package/foundation/.cursor/rules/git_remote_sync.mdc +0 -240
- package/foundation/.cursor/rules/instruction_documentation.mdc +0 -302
- package/foundation/.cursor/rules/native_browser_debugging.mdc +0 -65
- package/foundation/.cursor/rules/plan_execution_testing.mdc +0 -98
- package/foundation/.cursor/rules/post_build_testing.mdc +0 -159
- package/foundation/.cursor/rules/prefer_cli_tools.mdc +0 -234
- package/foundation/.cursor/rules/readme_maintenance.mdc +0 -153
- package/foundation/.cursor/rules/release_detection.mdc +0 -92
- package/foundation/.cursor/rules/release_status_readme_update.mdc +0 -64
- package/foundation/.cursor/rules/risk_management.mdc +0 -167
- package/foundation/.cursor/rules/security.mdc +0 -158
- package/foundation/.cursor/rules/test_first_workflow.mdc +0 -341
- package/foundation/.cursor/rules/worktree_env.mdc +0 -53
- package/foundation/.cursor/skills/analyze/SKILL.md +0 -566
- package/foundation/.cursor/skills/commit/SKILL.md +0 -782
- package/foundation/.cursor/skills/create-feature-unit/SKILL.md +0 -180
- package/foundation/.cursor/skills/create-prototype/SKILL.md +0 -91
- package/foundation/.cursor/skills/create-release/SKILL.md +0 -432
- package/foundation/.cursor/skills/create-rule/SKILL.md +0 -292
- package/foundation/.cursor/skills/debug/SKILL.md +0 -980
- package/foundation/.cursor/skills/final-review/SKILL.md +0 -93
- package/foundation/.cursor/skills/fix-feature-bug/SKILL.md +0 -100
- package/foundation/.cursor/skills/manage-error-debugging/SKILL.md +0 -182
- package/foundation/.cursor/skills/publish/SKILL.md +0 -554
- package/foundation/.cursor/skills/pull/SKILL.md +0 -315
- package/foundation/.cursor/skills/push/SKILL.md +0 -254
- package/foundation/.cursor/skills/report/SKILL.md +0 -1501
- package/foundation/.cursor/skills/report-error/SKILL.md +0 -1501
- package/foundation/.cursor/skills/run-feature-workflow/SKILL.md +0 -79
- package/foundation/.cursor/skills/setup-commands/SKILL.md +0 -28
- package/foundation/.cursor/skills/setup-cursor-copies/SKILL.md +0 -233
- package/foundation/.cursor/skills/sync-env-from-1password/SKILL.md +0 -302
- package/foundation/CONTRIBUTING.md +0 -202
- package/foundation/LICENSE +0 -22
- package/foundation/MIGRATION.md +0 -396
- package/foundation/README.md +0 -391
- package/foundation/agent_instructions/README.md +0 -559
- package/foundation/config/foundation-config.yaml +0 -498
- package/foundation/config/foundation_config.yaml +0 -475
- package/foundation/config/repo_adapters/personal.yaml +0 -40
- package/foundation/config/repo_adapters/template.yaml +0 -45
- package/foundation/conventions/code_conventions.md +0 -908
- package/foundation/conventions/documentation_standards.md +0 -459
- package/foundation/conventions/naming_patterns.yaml +0 -139
- package/foundation/conventions/testing_conventions.md +0 -374
- package/foundation/conventions/writing_style_guide.md +0 -221
- package/foundation/development/branch_strategy.md +0 -266
- package/foundation/development/feature_unit_workflow.md +0 -423
- package/foundation/development/pr_process.md +0 -385
- package/foundation/development/release_workflow.md +0 -2296
- package/foundation/development/templates/feature_unit_spec_template.md +0 -312
- package/foundation/development/templates/manifest_template_extended.yaml +0 -303
- package/foundation/development/templates/manifest_template_simple.yaml +0 -148
- package/foundation/development/workflow.md +0 -509
- package/foundation/development/worktree_setup.sh +0 -207
- package/foundation/scripts/README.md +0 -230
- package/foundation/scripts/__pycache__/op_sync_env_from_1password.cpython-314.pyc +0 -0
- package/foundation/scripts/install-foundation.sh +0 -232
- package/foundation/scripts/install_foundation.sh +0 -232
- package/foundation/scripts/op_sync_env_from_1password.py +0 -1007
- package/foundation/scripts/report_error_create_dirs.sh +0 -14
- package/foundation/scripts/report_error_generate_id.sh +0 -10
- package/foundation/scripts/report_error_update_queue.sh +0 -24
- package/foundation/scripts/report_error_validate_target.sh +0 -34
- package/foundation/scripts/report_error_wait_resolution.sh +0 -69
- package/foundation/scripts/validate_setup.sh +0 -147
- package/foundation/security/credential_management.md +0 -263
- package/foundation/security/pre_commit_audit.sh +0 -78
- package/foundation/security/security_rules.md +0 -163
- package/foundation/strategy/README.md +0 -279
- package/foundation/strategy/competitive_analysis_template.md +0 -271
- package/foundation/strategy/partnership_analysis_template.md +0 -423
- package/foundation/strategy/project_assessment_framework.md +0 -485
- package/foundation/strategy/relevance_analysis_template.md +0 -297
- package/foundation/tooling/README.md +0 -198
- package/foundation/validation/README.md +0 -120
- package/foundation-config.yaml +0 -543
- package/frontend/docs.html +0 -43
- package/frontend/frontend/.vite-prototype/deps/@noble_curves_ed25519__js.js +0 -2859
- package/frontend/frontend/.vite-prototype/deps/@noble_curves_ed25519__js.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/@noble_hashes_utils__js.js +0 -62
- package/frontend/frontend/.vite-prototype/deps/@noble_hashes_utils__js.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-dialog.js +0 -464
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-dialog.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-dropdown-menu.js +0 -1488
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-dropdown-menu.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-label.js +0 -84
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-label.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-scroll-area.js +0 -757
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-scroll-area.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-select.js +0 -1351
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-select.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-slot.js +0 -18
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-slot.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-toast.js +0 -675
- package/frontend/frontend/.vite-prototype/deps/@radix-ui_react-toast.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/@tanstack_react-table.js +0 -3254
- package/frontend/frontend/.vite-prototype/deps/@tanstack_react-table.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/_metadata.json +0 -187
- package/frontend/frontend/.vite-prototype/deps/chunk-557GXNYU.js +0 -23
- package/frontend/frontend/.vite-prototype/deps/chunk-557GXNYU.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-6FYWT56J.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-C7HFWHWH.js +0 -271
- package/frontend/frontend/.vite-prototype/deps/chunk-C7HFWHWH.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-CJDTXCAB.js +0 -49
- package/frontend/frontend/.vite-prototype/deps/chunk-CJDTXCAB.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-DC5AMYBS.js +0 -39
- package/frontend/frontend/.vite-prototype/deps/chunk-DC5AMYBS.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-F4FBYZZO.js +0 -2258
- package/frontend/frontend/.vite-prototype/deps/chunk-F4FBYZZO.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-GIBJ3MQP.js +0 -129
- package/frontend/frontend/.vite-prototype/deps/chunk-GIBJ3MQP.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-IMIZXM4S.js +0 -218
- package/frontend/frontend/.vite-prototype/deps/chunk-IMIZXM4S.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-K236IVZX.js +0 -21628
- package/frontend/frontend/.vite-prototype/deps/chunk-K236IVZX.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-LPO6FEV6.js +0 -21
- package/frontend/frontend/.vite-prototype/deps/chunk-LPO6FEV6.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-PZJDTVNM.js +0 -144
- package/frontend/frontend/.vite-prototype/deps/chunk-PZJDTVNM.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-RGYP7AMI.js +0 -1116
- package/frontend/frontend/.vite-prototype/deps/chunk-RGYP7AMI.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-SMVRXQSC.js +0 -928
- package/frontend/frontend/.vite-prototype/deps/chunk-SMVRXQSC.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-SPBFJIQZ.js +0 -49
- package/frontend/frontend/.vite-prototype/deps/chunk-SPBFJIQZ.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-UQF5EARV.js +0 -9
- package/frontend/frontend/.vite-prototype/deps/chunk-UQF5EARV.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-VEFHXNY4.js +0 -186
- package/frontend/frontend/.vite-prototype/deps/chunk-VEFHXNY4.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/chunk-Z55WIHBM.js +0 -349
- package/frontend/frontend/.vite-prototype/deps/chunk-Z55WIHBM.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/class-variance-authority.js +0 -51
- package/frontend/frontend/.vite-prototype/deps/class-variance-authority.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/clsx.js +0 -10
- package/frontend/frontend/.vite-prototype/deps/clsx.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/lucide-react.js +0 -31586
- package/frontend/frontend/.vite-prototype/deps/lucide-react.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/package.json +0 -3
- package/frontend/frontend/.vite-prototype/deps/papaparse.js +0 -431
- package/frontend/frontend/.vite-prototype/deps/papaparse.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/react-dom.js +0 -7
- package/frontend/frontend/.vite-prototype/deps/react-dom.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/react-dom_client.js +0 -39
- package/frontend/frontend/.vite-prototype/deps/react-dom_client.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/react.js +0 -6
- package/frontend/frontend/.vite-prototype/deps/react.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/react_jsx-dev-runtime.js +0 -913
- package/frontend/frontend/.vite-prototype/deps/react_jsx-dev-runtime.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/react_jsx-runtime.js +0 -7
- package/frontend/frontend/.vite-prototype/deps/react_jsx-runtime.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/sonner.js +0 -1139
- package/frontend/frontend/.vite-prototype/deps/sonner.js.map +0 -7
- package/frontend/frontend/.vite-prototype/deps/tailwind-merge.js +0 -2534
- package/frontend/frontend/.vite-prototype/deps/tailwind-merge.js.map +0 -7
- package/frontend/index.html +0 -38
- package/frontend/src/App.tsx +0 -15
- package/frontend/src/bridge/discovery.ts +0 -126
- package/frontend/src/bridge/index.ts +0 -9
- package/frontend/src/bridge/mcp.ts +0 -85
- package/frontend/src/bridge/types.ts +0 -24
- package/frontend/src/bridge/websocket.ts +0 -349
- package/frontend/src/components/AIAgentBridge.tsx +0 -75
- package/frontend/src/components/AboutPage.tsx +0 -102
- package/frontend/src/components/AppNavigationSidebar.tsx +0 -181
- package/frontend/src/components/AppSidebar.tsx +0 -206
- package/frontend/src/components/AuthErrorHandler.tsx +0 -23
- package/frontend/src/components/Dashboard.tsx +0 -303
- package/frontend/src/components/DashboardPage.tsx +0 -78
- package/frontend/src/components/EmptyPlaceholder.tsx +0 -58
- package/frontend/src/components/EntityDetail.tsx +0 -801
- package/frontend/src/components/EntityList.tsx +0 -409
- package/frontend/src/components/ErrorBoundary.tsx +0 -131
- package/frontend/src/components/FileUploadView.tsx +0 -246
- package/frontend/src/components/FloatingSettingsButton.tsx +0 -46
- package/frontend/src/components/Header.tsx +0 -43
- package/frontend/src/components/IntegrationsPage.tsx +0 -46
- package/frontend/src/components/InterpretationList.tsx +0 -246
- package/frontend/src/components/KeyManagementDialog.tsx +0 -227
- package/frontend/src/components/Layout.tsx +0 -67
- package/frontend/src/components/MCPChatGPTPage.tsx +0 -128
- package/frontend/src/components/MCPClaudePage.tsx +0 -112
- package/frontend/src/components/MCPCodeiumPage.tsx +0 -100
- package/frontend/src/components/MCPConfigurationPage.tsx +0 -624
- package/frontend/src/components/MCPConnectionDialog.tsx +0 -177
- package/frontend/src/components/MCPConnectionsList.tsx +0 -197
- package/frontend/src/components/MCPContinuePage.tsx +0 -90
- package/frontend/src/components/MCPCursorPage.tsx +0 -379
- package/frontend/src/components/MCPGeminiPage.tsx +0 -102
- package/frontend/src/components/MCPGitHubCopilotPage.tsx +0 -100
- package/frontend/src/components/MCPGrokPage.tsx +0 -99
- package/frontend/src/components/MCPJetBrainsPage.tsx +0 -107
- package/frontend/src/components/MCPManusPage.tsx +0 -104
- package/frontend/src/components/MCPSetupDialog.tsx +0 -268
- package/frontend/src/components/MCPVSCodePage.tsx +0 -100
- package/frontend/src/components/MCPWindsurfPage.tsx +0 -99
- package/frontend/src/components/MainApp.tsx +0 -19
- package/frontend/src/components/NotFound.tsx +0 -46
- package/frontend/src/components/OAuthPage.tsx +0 -426
- package/frontend/src/components/ObservationList.tsx +0 -277
- package/frontend/src/components/ProtectedRoute.tsx +0 -38
- package/frontend/src/components/QuickEntryPanel.tsx +0 -99
- package/frontend/src/components/RealtimeStatusIndicator.tsx +0 -32
- package/frontend/src/components/RecentActivityFeed.tsx +0 -198
- package/frontend/src/components/RelationshipDetail.tsx +0 -232
- package/frontend/src/components/RelationshipList.tsx +0 -269
- package/frontend/src/components/SchemaDetail.test.tsx +0 -53
- package/frontend/src/components/SchemaDetail.tsx +0 -230
- package/frontend/src/components/SchemaList.tsx +0 -228
- package/frontend/src/components/SearchResults.tsx +0 -318
- package/frontend/src/components/SeoHead.tsx +0 -40
- package/frontend/src/components/SitePage.tsx +0 -654
- package/frontend/src/components/SourceDetail.tsx +0 -382
- package/frontend/src/components/SourceTable.tsx +0 -243
- package/frontend/src/components/StyleGuide.md +0 -48
- package/frontend/src/components/StyleGuide.tsx +0 -2316
- package/frontend/src/components/TimelineView.tsx +0 -321
- package/frontend/src/components/UniversalSearch.tsx +0 -518
- package/frontend/src/components/design-system/BadgesPage.tsx +0 -47
- package/frontend/src/components/design-system/ButtonsPage.tsx +0 -67
- package/frontend/src/components/design-system/CardsPage.tsx +0 -31
- package/frontend/src/components/design-system/CollapsiblePage.tsx +0 -84
- package/frontend/src/components/design-system/ColorsPage.tsx +0 -125
- package/frontend/src/components/design-system/DesignSystemIndex.tsx +0 -73
- package/frontend/src/components/design-system/DesignSystemLayout.tsx +0 -22
- package/frontend/src/components/design-system/DesignSystemRouter.tsx +0 -43
- package/frontend/src/components/design-system/InputsPage.tsx +0 -40
- package/frontend/src/components/design-system/PageFormatsPage.tsx +0 -263
- package/frontend/src/components/design-system/ProgressPage.tsx +0 -54
- package/frontend/src/components/design-system/SkeletonPage.tsx +0 -68
- package/frontend/src/components/design-system/SpacingPage.tsx +0 -45
- package/frontend/src/components/design-system/StyleGuidePage.tsx +0 -313
- package/frontend/src/components/design-system/SwitchPage.tsx +0 -60
- package/frontend/src/components/design-system/TablesPage.tsx +0 -206
- package/frontend/src/components/design-system/TabsPage.tsx +0 -88
- package/frontend/src/components/design-system/TooltipPage.tsx +0 -94
- package/frontend/src/components/design-system/TypographyPage.tsx +0 -81
- package/frontend/src/components/icons/CursorIcon.tsx +0 -26
- package/frontend/src/components/quick-entry/ContactDialog.tsx +0 -177
- package/frontend/src/components/quick-entry/EventDialog.tsx +0 -204
- package/frontend/src/components/quick-entry/TaskDialog.tsx +0 -204
- package/frontend/src/components/quick-entry/TransactionDialog.tsx +0 -188
- package/frontend/src/components/ui/alert.tsx +0 -59
- package/frontend/src/components/ui/badge.tsx +0 -36
- package/frontend/src/components/ui/breadcrumb.tsx +0 -120
- package/frontend/src/components/ui/button.tsx +0 -56
- package/frontend/src/components/ui/card.tsx +0 -68
- package/frontend/src/components/ui/collapsible.tsx +0 -9
- package/frontend/src/components/ui/dialog.tsx +0 -81
- package/frontend/src/components/ui/dropdown-menu.tsx +0 -195
- package/frontend/src/components/ui/input-group.tsx +0 -26
- package/frontend/src/components/ui/input.tsx +0 -24
- package/frontend/src/components/ui/label.tsx +0 -19
- package/frontend/src/components/ui/progress.tsx +0 -26
- package/frontend/src/components/ui/scroll-area.tsx +0 -35
- package/frontend/src/components/ui/select.tsx +0 -173
- package/frontend/src/components/ui/separator.tsx +0 -31
- package/frontend/src/components/ui/sheet.tsx +0 -139
- package/frontend/src/components/ui/sidebar.tsx +0 -851
- package/frontend/src/components/ui/skeleton.tsx +0 -15
- package/frontend/src/components/ui/switch.tsx +0 -35
- package/frontend/src/components/ui/table-scroll-wrapper.tsx +0 -96
- package/frontend/src/components/ui/table.tsx +0 -127
- package/frontend/src/components/ui/tabs.tsx +0 -53
- package/frontend/src/components/ui/textarea.tsx +0 -23
- package/frontend/src/components/ui/toast.tsx +0 -122
- package/frontend/src/components/ui/toaster.tsx +0 -32
- package/frontend/src/components/ui/tooltip.tsx +0 -28
- package/frontend/src/components/ui/use-toast.ts +0 -194
- package/frontend/src/constants/integrations.ts +0 -51
- package/frontend/src/contexts/AuthContext.tsx +0 -205
- package/frontend/src/contexts/RealtimeContext.tsx +0 -119
- package/frontend/src/docs/DocumentationApp.tsx +0 -104
- package/frontend/src/docs/DocumentationDirectory.tsx +0 -159
- package/frontend/src/docs/DocumentationLayout.tsx +0 -31
- package/frontend/src/docs/DocumentationPage.tsx +0 -38
- package/frontend/src/docs/DocumentationSidebar.tsx +0 -15
- package/frontend/src/docs/MarkdownContent.tsx +0 -212
- package/frontend/src/docs/README.md +0 -198
- package/frontend/src/docs/main.tsx +0 -12
- package/frontend/src/hooks/use-mobile.tsx +0 -19
- package/frontend/src/hooks/useKeys.ts +0 -202
- package/frontend/src/hooks/useMCPConfig.ts +0 -175
- package/frontend/src/hooks/useRealtimeEntities.ts +0 -56
- package/frontend/src/hooks/useRealtimeObservations.ts +0 -56
- package/frontend/src/hooks/useRealtimeRelationships.ts +0 -56
- package/frontend/src/hooks/useRealtimeSources.ts +0 -53
- package/frontend/src/hooks/useRealtimeTimeline.ts +0 -53
- package/frontend/src/hooks/useSettings.ts +0 -95
- package/frontend/src/hooks/useStorageQuota.ts +0 -65
- package/frontend/src/hooks/useTheme.tsx +0 -42
- package/frontend/src/index.css +0 -247
- package/frontend/src/lib/api_client.ts +0 -8
- package/frontend/src/lib/auth.ts +0 -100
- package/frontend/src/lib/idempotency.ts +0 -25
- package/frontend/src/lib/utils.ts +0 -7
- package/frontend/src/main.tsx +0 -40
- package/frontend/src/sample-data/sets-medium.csv +0 -55
- package/frontend/src/sample-data/sets-medium.ts +0 -45
- package/frontend/src/shared/.eslintrc.json +0 -35
- package/frontend/src/shared/.github/README.md +0 -55
- package/frontend/src/shared/.github/workflows/ci.yml +0 -88
- package/frontend/src/shared/.github/workflows/release.yml +0 -34
- package/frontend/src/shared/.github/workflows/setup.yml +0 -56
- package/frontend/src/shared/README.md +0 -163
- package/frontend/src/shared/SETUP.md +0 -121
- package/frontend/src/shared/components.json +0 -20
- package/frontend/src/shared/package-lock.json +0 -4508
- package/frontend/src/shared/package.json +0 -78
- package/frontend/src/shared/src/components/AppSidebar.tsx +0 -77
- package/frontend/src/shared/src/components/ErrorBoundary.tsx +0 -87
- package/frontend/src/shared/src/components/Layout.tsx +0 -262
- package/frontend/src/shared/src/components/ui/breadcrumb.tsx +0 -115
- package/frontend/src/shared/src/components/ui/button.tsx +0 -56
- package/frontend/src/shared/src/components/ui/calendar.tsx +0 -211
- package/frontend/src/shared/src/components/ui/input.tsx +0 -22
- package/frontend/src/shared/src/components/ui/popover.tsx +0 -29
- package/frontend/src/shared/src/components/ui/separator.tsx +0 -29
- package/frontend/src/shared/src/components/ui/sheet.tsx +0 -140
- package/frontend/src/shared/src/components/ui/sidebar.tsx +0 -519
- package/frontend/src/shared/src/components/ui/skeleton.tsx +0 -15
- package/frontend/src/shared/src/components/ui/tooltip.tsx +0 -28
- package/frontend/src/shared/src/hooks/use-mobile.tsx +0 -19
- package/frontend/src/shared/src/index.css +0 -75
- package/frontend/src/shared/src/index.ts +0 -34
- package/frontend/src/shared/src/lib/utils.ts +0 -6
- package/frontend/src/shared/tailwind.config.mjs +0 -67
- package/frontend/src/shared/tsconfig.json +0 -29
- package/frontend/src/site/seo_metadata.ts +0 -133
- package/frontend/src/site/site_data.test.ts +0 -36
- package/frontend/src/site/site_data.ts +0 -575
- package/frontend/src/store/README.md +0 -10
- package/frontend/src/utils/api_access.ts +0 -24
- package/frontend/src/utils/csv.test.ts +0 -42
- package/frontend/src/utils/csv.ts +0 -45
- package/frontend/src/utils/csv_summary.ts +0 -139
- package/frontend/src/utils/debounce.ts +0 -24
- package/frontend/src/utils/entity_display.test.ts +0 -334
- package/frontend/src/utils/entity_display.ts +0 -23
- package/frontend/src/utils/entity_type_formatter.ts +0 -56
- package/frontend/src/utils/error_utils.ts +0 -137
- package/frontend/src/utils/property_keys.ts +0 -36
- package/frontend/src/utils/schema_icons.test.ts +0 -59
- package/frontend/src/utils/schema_icons.ts +0 -229
- package/frontend/src/utils/time.ts +0 -37
- package/frontend/src/vite-env.d.ts +0 -14
- package/frontend/tsconfig.json +0 -27
- package/frontend/tsconfig.node.json +0 -11
- package/mcp/web-scraper/README.md +0 -475
- package/mcp/web-scraper/SETUP.md +0 -150
- package/mcp/web-scraper/__init__.py +0 -3
- package/mcp/web-scraper/chatgpt_scraper_mcp_server.py +0 -435
- package/mcp/web-scraper/create_repo.sh +0 -50
- package/mcp/web-scraper/imports/spotify/playlist_3i0FY58V7n8XIUyWDm3AYA.json +0 -1052
- package/mcp/web-scraper/nytimes_article.json +0 -7
- package/mcp/web-scraper/plugins/__init__.py +0 -3
- package/mcp/web-scraper/plugins/chatgpt_scraper.py +0 -105
- package/mcp/web-scraper/plugins/metacast_scraper.py +0 -828
- package/mcp/web-scraper/plugins/nyt_podcast_scraper.py +0 -538
- package/mcp/web-scraper/plugins/spotify_scraper.py +0 -618
- package/mcp/web-scraper/plugins/twitter_scraper.py +0 -576
- package/mcp/web-scraper/plugins/url_body_fetcher.py +0 -172
- package/mcp/web-scraper/pytest.ini +0 -11
- package/mcp/web-scraper/requirements-test.txt +0 -6
- package/mcp/web-scraper/requirements.txt +0 -6
- package/mcp/web-scraper/run-web-scraper-mcp.sh +0 -38
- package/mcp/web-scraper/scrape_spotify_playlist.py +0 -77
- package/mcp/web-scraper/scraper.py +0 -819
- package/mcp/web-scraper/scraper_base.py +0 -88
- package/mcp/web-scraper/scraper_registry.py +0 -32
- package/mcp/web-scraper/scripts/scrape_tweet_and_verify_referenced.py +0 -65
- package/mcp/web-scraper/store_songs_to_parquet.py +0 -120
- package/mcp/web-scraper/tests/__init__.py +0 -0
- package/mcp/web-scraper/tests/conftest.py +0 -40
- package/mcp/web-scraper/tests/integration/__init__.py +0 -0
- package/mcp/web-scraper/tests/unit/__init__.py +0 -0
- package/mcp/web-scraper/tests/unit/test_source_detection.py +0 -60
- package/mcp/web-scraper/web_scraper_mcp_server.py +0 -639
- package/openapi.yaml +0 -2071
- package/playwright/fixtures/servers.ts +0 -180
- package/playwright/global_setup.ts +0 -3
- package/playwright/tests/auto-enhancement.spec.ts +0 -370
- package/playwright/tests/coverage-map.json +0 -135
- package/playwright/tests/design-system.spec.ts +0 -216
- package/playwright/tests/entity-detail.spec.ts +0 -268
- package/playwright/tests/entity-list.spec.ts +0 -266
- package/playwright/tests/floating-settings-button.spec.ts +0 -95
- package/playwright/tests/graph-integrity.spec.ts +0 -344
- package/playwright/tests/helpers.ts +0 -560
- package/playwright/tests/interpretations.spec.ts +0 -285
- package/playwright/tests/mcp-configuration.spec.ts +0 -208
- package/playwright/tests/mcp-relationships.spec.ts +0 -631
- package/playwright/tests/mcp-store-retrieve.spec.ts +0 -288
- package/playwright/tests/not-found.spec.ts +0 -30
- package/playwright/tests/oauth-flow.spec.ts +0 -790
- package/playwright/tests/observations.spec.ts +0 -295
- package/playwright/tests/relationship-detail.spec.ts +0 -305
- package/playwright/tests/relationships-list.spec.ts +0 -275
- package/playwright/tests/schema-detail.spec.ts +0 -300
- package/playwright/tests/schemas-list.spec.ts +0 -262
- package/playwright/tests/search-flow.spec.ts +0 -216
- package/playwright/tests/site-page.spec.ts +0 -23
- package/playwright/tests/source-detail.spec.ts +0 -300
- package/playwright/tests/sources-list.spec.ts +0 -254
- package/playwright/tests/upload-flow.spec.ts +0 -279
- package/playwright/tsconfig.json +0 -17
- package/playwright/types.d.ts +0 -14
- package/playwright/utils/servers.ts +0 -435
- package/playwright.config.ts +0 -77
- package/postcss.config.mjs +0 -7
- package/scripts/add_ngrok_mapping.py +0 -99
- package/scripts/add_required_observation_fields.js +0 -96
- package/scripts/add_required_source_fields.js +0 -95
- package/scripts/analyze-data-dir-schemas.js +0 -256
- package/scripts/analyze_data_dir_for_schemas.ts +0 -378
- package/scripts/analyze_low_confidence_fields.ts +0 -235
- package/scripts/analyze_schema_redundancies.ts +0 -228
- package/scripts/apply_documentation_rules.sh +0 -81
- package/scripts/apply_file_naming_convention.sh +0 -75
- package/scripts/backfill_entity_embeddings.ts +0 -95
- package/scripts/branch.js +0 -47
- package/scripts/build_github_pages_site.tsx +0 -65
- package/scripts/check-playwright-coverage.ts +0 -159
- package/scripts/check_agent_conversations.js +0 -72
- package/scripts/check_agent_status.js +0 -156
- package/scripts/check_auto_enhancement_status.ts +0 -215
- package/scripts/check_auto_test_schemas.ts +0 -43
- package/scripts/check_claude_sync.sh +0 -35
- package/scripts/check_raw_fragments.ts +0 -46
- package/scripts/check_remaining_eligibility.ts +0 -46
- package/scripts/check_remaining_fields.ts +0 -58
- package/scripts/check_sendgrid_credits.sh +0 -122
- package/scripts/check_sendgrid_email_logs.sh +0 -150
- package/scripts/check_snapshot_schema.ts +0 -18
- package/scripts/check_sources.ts +0 -34
- package/scripts/check_stale_snapshots.ts +0 -80
- package/scripts/cleanup-auto-test-schemas.ts +0 -80
- package/scripts/cleanup_test_schemas.ts +0 -275
- package/scripts/com.neotoma.dev-servers.plist.template +0 -27
- package/scripts/com.neotoma.watch-build.plist.template +0 -27
- package/scripts/complete_submodule_setup.sh +0 -101
- package/scripts/configure_sendgrid_dns.sh +0 -162
- package/scripts/copy-env-to-worktree.js +0 -109
- package/scripts/copy_pdf_worker_wrapper.js +0 -19
- package/scripts/create_sample_parquet_files.py +0 -120
- package/scripts/create_sample_parquet_files.ts +0 -146
- package/scripts/create_sample_parquet_files_mcp.ts +0 -196
- package/scripts/create_sample_parquet_files_simple.sh +0 -132
- package/scripts/cursor-worktree-init.sh +0 -24
- package/scripts/debug-ssl.sh +0 -86
- package/scripts/debug_pdf_extraction.ts +0 -69
- package/scripts/debug_vec_knn.ts +0 -69
- package/scripts/dev-proxy.js +0 -406
- package/scripts/dev-serve.js +0 -349
- package/scripts/disable-dns.sh +0 -47
- package/scripts/doctor.ts +0 -97
- package/scripts/export_schema_snapshots.ts +0 -253
- package/scripts/fix-ssl-cert.sh +0 -72
- package/scripts/fix_mcp_phase1_tests.sh +0 -51
- package/scripts/fix_observation_column_names.js +0 -51
- package/scripts/fix_observation_priority_ordering.js +0 -45
- package/scripts/fix_observation_properties_to_fields.js +0 -48
- package/scripts/fix_sqlite_schema_mismatch.js +0 -75
- package/scripts/generate-dev-cert.sh +0 -69
- package/scripts/generate_pdf_fixtures.ts +0 -330
- package/scripts/generate_schema_icons.ts +0 -216
- package/scripts/get_branch_ports.js +0 -56
- package/scripts/get_mcp_token.sh +0 -47
- package/scripts/get_secrets_for_agents.js +0 -45
- package/scripts/ingest_data_dir.ts +0 -215
- package/scripts/ingest_finances_data.ts +0 -255
- package/scripts/initialize-schemas.ts +0 -350
- package/scripts/install_launchd_dev_servers.js +0 -54
- package/scripts/install_launchd_watch_build.js +0 -53
- package/scripts/instruct_agents_credential_setup.js +0 -130
- package/scripts/instruct_agents_env_check.js +0 -99
- package/scripts/instruct_agents_run_tests_until_passing.js +0 -128
- package/scripts/kill_port.js +0 -174
- package/scripts/linters/sync_agent_instructions_pre_commit.sh +0 -34
- package/scripts/manage_error_debugging.sh +0 -228
- package/scripts/manually_queue_enhancements.ts +0 -156
- package/scripts/merge-dev.js +0 -319
- package/scripts/migrate_auto_enhanced_fields.ts +0 -83
- package/scripts/migrate_env_to_secrets.js +0 -69
- package/scripts/migrate_plans.ts +0 -870
- package/scripts/monitor_and_fix_snapshots.ts +0 -165
- package/scripts/move_docs_rules_to_cursor.js +0 -54
- package/scripts/move_docs_rules_to_cursor.sh +0 -24
- package/scripts/neotoma-npm-reserve/README.md +0 -8
- package/scripts/neotoma-npm-reserve/package.json +0 -10
- package/scripts/notify_agents_env_vars.js +0 -109
- package/scripts/notify_agents_setup_script.js +0 -148
- package/scripts/notify_running_agents_credentials.js +0 -177
- package/scripts/pdf_worker_polyfill.mjs +0 -27
- package/scripts/pick-port.js +0 -108
- package/scripts/postinstall.js +0 -84
- package/scripts/process_remaining_eligible.ts +0 -70
- package/scripts/prototypes/run-prototype.sh +0 -40
- package/scripts/prune-merged-branches.js +0 -115
- package/scripts/recompute_bob.ts +0 -64
- package/scripts/recompute_snapshots.ts +0 -72
- package/scripts/release_orchestrator.js +0 -1995
- package/scripts/remove_duplicate_source_fields.js +0 -61
- package/scripts/rename-branch-from-commit.js +0 -111
- package/scripts/respawn_agents_with_credentials.js +0 -358
- package/scripts/respawn_single_agent.js +0 -324
- package/scripts/run-dev-server-with-tunnel-url.sh +0 -16
- package/scripts/run-dev-task.js +0 -160
- package/scripts/run_dev_servers_launchd.sh +0 -14
- package/scripts/run_integration_tests.js +0 -523
- package/scripts/run_migrations.js +0 -55
- package/scripts/run_neotoma_mcp_stdio.sh +0 -11
- package/scripts/run_neotoma_mcp_stdio_dev_watch.sh +0 -10
- package/scripts/run_neotoma_mcp_stdio_prod.sh +0 -11
- package/scripts/run_neotoma_mcp_stdio_prod_watch.sh +0 -12
- package/scripts/run_watch_build_launchd.sh +0 -18
- package/scripts/scrape_nytimes_article.py +0 -182
- package/scripts/scrape_nytimes_simple.py +0 -152
- package/scripts/secrets_manager.js +0 -232
- package/scripts/send_agent_followup.js +0 -136
- package/scripts/setup-data-symlink.js +0 -88
- package/scripts/setup-dns.sh +0 -54
- package/scripts/setup-env-copy-hook.sh +0 -67
- package/scripts/setup-foundation-symlink.js +0 -45
- package/scripts/setup-https-tunnel.sh +0 -409
- package/scripts/setup-test-env.sh +0 -18
- package/scripts/setup_agent_credentials.sh +0 -27
- package/scripts/setup_agent_environment.sh +0 -39
- package/scripts/setup_claude_instructions.sh +0 -437
- package/scripts/setup_cloudflare_email_routing.sh +0 -158
- package/scripts/setup_shared_submodule.sh +0 -100
- package/scripts/simulate_npm_install.js +0 -70
- package/scripts/spec_compliance_patterns.js +0 -260
- package/scripts/sync-env-from-1password.sh +0 -100
- package/scripts/sync_mcp_configs.js +0 -106
- package/scripts/test-base64-store.ts +0 -53
- package/scripts/test-error-handling.ts +0 -44
- package/scripts/test-file-path-store.ts +0 -142
- package/scripts/test-raw-fragments-idempotence.ts +0 -157
- package/scripts/test-raw-fragments-insert.ts +0 -88
- package/scripts/test-store-response-structure.ts +0 -125
- package/scripts/test-store-structured-response.ts +0 -126
- package/scripts/test_agent_env_spawn.js +0 -82
- package/scripts/test_confidence.ts +0 -36
- package/scripts/test_dsnp_parquet_reading.ts +0 -72
- package/scripts/test_mcp_semantic_search.ts +0 -36
- package/scripts/test_parquet_ingestion.ts +0 -52
- package/scripts/test_raw_fragments_in_response.ts +0 -31
- package/scripts/test_sendgrid_smtp.sh +0 -45
- package/scripts/test_store_parquet_via_mcp.ts +0 -66
- package/scripts/trigger_error_debug_cli.js +0 -271
- package/scripts/unblock_agents.js +0 -208
- package/scripts/validate-coverage-map.ts +0 -187
- package/scripts/validate-doc-dependencies.js +0 -410
- package/scripts/validate_all_fu_compliance.js +0 -752
- package/scripts/validate_schema_sync.ts +0 -135
- package/scripts/validate_spec_compliance.js +0 -669
- package/scripts/watch_site.js +0 -68
- package/scripts/wipe-local-database.js +0 -191
- package/scripts/with_branch_ports.js +0 -496
- package/site_pages/.nojekyll +0 -0
- package/site_pages/FAVICON_CANDIDATES.md +0 -22
- package/site_pages/favicon-1-diamond.svg +0 -3
- package/site_pages/favicon-2-n-box.svg +0 -10
- package/site_pages/favicon-3-waves.svg +0 -3
- package/site_pages/favicon-4-n-minimal.svg +0 -3
- package/site_pages/favicon-5-bars.svg +0 -5
- package/site_pages/favicon.svg +0 -10
- package/site_pages/index.html +0 -40
- package/site_pages/robots.txt +0 -4
- package/site_pages/sitemap.xml +0 -5
- package/src/actions.ts +0 -4468
- package/src/cli/agent_instructions_scan.ts +0 -793
- package/src/cli/bootstrap.ts +0 -35
- package/src/cli/config.ts +0 -338
- package/src/cli/format.ts +0 -337
- package/src/cli/index.ts +0 -11417
- package/src/cli/init_abort.ts +0 -7
- package/src/cli/mcp_config_scan.ts +0 -1359
- package/src/cli/pack_rat.ts +0 -134
- package/src/config/record_types.ts +0 -562
- package/src/config.ts +0 -164
- package/src/crypto/agent_identity.ts +0 -46
- package/src/crypto/auth.ts +0 -110
- package/src/crypto/column_encryption.ts +0 -109
- package/src/crypto/crypto.test.ts +0 -311
- package/src/crypto/envelope.ts +0 -240
- package/src/crypto/export.ts +0 -131
- package/src/crypto/index.ts +0 -13
- package/src/crypto/key_derivation.ts +0 -176
- package/src/crypto/keys.ts +0 -85
- package/src/crypto/mcp_auth_token.ts +0 -35
- package/src/crypto/signature.ts +0 -50
- package/src/crypto/types.ts +0 -48
- package/src/db.ts +0 -66
- package/src/embeddings.ts +0 -76
- package/src/index.ts +0 -25
- package/src/mcp_ws_bridge.ts +0 -222
- package/src/middleware/encrypt_response.ts +0 -39
- package/src/normalize.ts +0 -351
- package/src/record_types.test.ts +0 -36
- package/src/reducers/index.ts +0 -5
- package/src/reducers/observation_reducer.ts +0 -458
- package/src/reducers/relationship_reducer.ts +0 -291
- package/src/repositories/db/capability_repo.ts +0 -29
- package/src/repositories/file/capability_repo.ts +0 -29
- package/src/repositories/index.ts +0 -7
- package/src/repositories/interfaces.ts +0 -112
- package/src/repositories/sqlite/__tests__/local_db_adapter.test.ts +0 -138
- package/src/repositories/sqlite/local_db_adapter.ts +0 -961
- package/src/repositories/sqlite/sqlite_client.ts +0 -378
- package/src/server.ts +0 -6157
- package/src/services/__tests__/csv_chunking.test.ts +0 -125
- package/src/services/__tests__/deletion.test.ts +0 -358
- package/src/services/__tests__/entity_semantic_search.test.ts +0 -45
- package/src/services/__tests__/local_auth.test.ts +0 -52
- package/src/services/__tests__/local_entity_embedding.test.ts +0 -108
- package/src/services/__tests__/mcp_oauth.test.ts +0 -407
- package/src/services/__tests__/oauth_key_gate.test.ts +0 -50
- package/src/services/__tests__/oauth_state.test.ts +0 -40
- package/src/services/__tests__/schema_icon_service.test.ts +0 -151
- package/src/services/auto_enhancement_processor.ts +0 -237
- package/src/services/capability_registry.ts +0 -202
- package/src/services/correction.ts +0 -87
- package/src/services/csv_chunking.ts +0 -128
- package/src/services/csv_row_extraction.ts +0 -124
- package/src/services/dashboard_stats.ts +0 -115
- package/src/services/deletion.ts +0 -482
- package/src/services/deletion_monitor.ts +0 -314
- package/src/services/encryption_service.ts +0 -110
- package/src/services/entity_merge.ts +0 -100
- package/src/services/entity_queries.ts +0 -518
- package/src/services/entity_resolution.ts +0 -367
- package/src/services/entity_semantic_search.ts +0 -64
- package/src/services/entity_snapshot_embedding.ts +0 -115
- package/src/services/field_canonicalization.ts +0 -393
- package/src/services/field_converters.ts +0 -173
- package/src/services/field_validation.ts +0 -173
- package/src/services/file_text_extraction.ts +0 -213
- package/src/services/finances_field_mapping.ts +0 -473
- package/src/services/gdpr_deletion.ts +0 -497
- package/src/services/interpretation.ts +0 -939
- package/src/services/llm_extraction.ts +0 -548
- package/src/services/local_auth.ts +0 -154
- package/src/services/local_entity_embedding.ts +0 -196
- package/src/services/mcp_auth.ts +0 -75
- package/src/services/mcp_oauth.ts +0 -1625
- package/src/services/mcp_oauth_errors.ts +0 -139
- package/src/services/oauth_key_gate.ts +0 -116
- package/src/services/oauth_state.ts +0 -70
- package/src/services/observation_identity.ts +0 -161
- package/src/services/observation_storage.ts +0 -162
- package/src/services/parquet_reader.ts +0 -375
- package/src/services/public_key_registry.ts +0 -103
- package/src/services/raw_fragments.ts +0 -217
- package/src/services/raw_storage.ts +0 -267
- package/src/services/relationships.ts +0 -495
- package/src/services/schema_definitions.ts +0 -2041
- package/src/services/schema_icon_service.ts +0 -260
- package/src/services/schema_inference.ts +0 -401
- package/src/services/schema_recommendation.ts +0 -1475
- package/src/services/schema_registry.ts +0 -1403
- package/src/services/snapshot_computation.ts +0 -92
- package/src/services/source_identity.ts +0 -22
- package/src/services/timeline_events.ts +0 -198
- package/src/shared/action_handlers/entity_handlers.ts +0 -115
- package/src/shared/action_schemas.test.ts +0 -59
- package/src/shared/action_schemas.ts +0 -317
- package/src/shared/api_client.ts +0 -86
- package/src/shared/contract_mappings.ts +0 -646
- package/src/shared/entity_display_name.ts +0 -64
- package/src/shared/local_transport.ts +0 -126
- package/src/shared/openapi_schema.ts +0 -175
- package/src/shared/openapi_types.ts +0 -2810
- package/src/shared/record_display_summary.ts +0 -133
- package/src/utils/__tests__/csv_summary.test.ts +0 -53
- package/src/utils/__tests__/lucide_icons.test.ts +0 -133
- package/src/utils/chat.test.ts +0 -42
- package/src/utils/chat.ts +0 -35
- package/src/utils/csv.test.ts +0 -41
- package/src/utils/csv.ts +0 -77
- package/src/utils/csv_summary.ts +0 -195
- package/src/utils/log_encrypt.ts +0 -144
- package/src/utils/logger.ts +0 -94
- package/src/utils/lucide_icons.ts +0 -279
- package/src/utils/property_keys.test.ts +0 -109
- package/src/utils/property_keys.ts +0 -66
- package/src/utils/property_sanitizer.test.ts +0 -105
- package/src/utils/property_sanitizer.ts +0 -135
- package/src/version_check.test.ts +0 -107
- package/src/version_check.ts +0 -58
- package/supabase/.temp/cli-latest +0 -0
- package/tailwind.config.mjs +0 -134
- package/tests/TEST_ACTION_MATRIX.md +0 -387
- package/tests/agent/mcp_instruction_behavior.test.ts +0 -72
- package/tests/agent/runner/agent_runner.ts +0 -27
- package/tests/agent/runner/claude_code_runner.ts +0 -128
- package/tests/agent/runner/cursor_cli_runner.ts +0 -7
- package/tests/cli/api_client_offline_fallback.test.ts +0 -89
- package/tests/cli/cli_admin_commands.test.ts +0 -268
- package/tests/cli/cli_api_commands.test.ts +0 -75
- package/tests/cli/cli_auth_commands.test.ts +0 -67
- package/tests/cli/cli_command_coverage_guard.test.ts +0 -50
- package/tests/cli/cli_correction_commands.test.ts +0 -277
- package/tests/cli/cli_direct_invocation_parity.test.ts +0 -46
- package/tests/cli/cli_entity_commands.test.ts +0 -324
- package/tests/cli/cli_entity_subcommands.test.ts +0 -422
- package/tests/cli/cli_infra_commands.test.ts +0 -475
- package/tests/cli/cli_mcp_commands.test.ts +0 -51
- package/tests/cli/cli_observation_commands.test.ts +0 -232
- package/tests/cli/cli_query_commands.test.ts +0 -369
- package/tests/cli/cli_relationship_commands.test.ts +0 -410
- package/tests/cli/cli_schema_commands.test.ts +0 -296
- package/tests/cli/cli_session_startup_ux.test.ts +0 -112
- package/tests/cli/cli_smoke.test.ts +0 -456
- package/tests/cli/cli_source_commands.test.ts +0 -214
- package/tests/cli/cli_stats_commands.test.ts +0 -51
- package/tests/cli/cli_store_commands.test.ts +0 -339
- package/tests/cli/cli_timeline_commands.test.ts +0 -294
- package/tests/cli/config.test.ts +0 -36
- package/tests/cli/config_api_discovery.test.ts +0 -91
- package/tests/cli/test_command_detection.test.ts +0 -128
- package/tests/cli/test_debug_tty.test.ts +0 -32
- package/tests/contract/contract_mapping.test.ts +0 -131
- package/tests/contract/contract_mcp_cli_parity.test.ts +0 -223
- package/tests/contract/openapi_schema.test.ts +0 -15
- package/tests/fixtures/README.md +0 -22
- package/tests/fixtures/agent_mcp/insurance_policy.txt +0 -5
- package/tests/fixtures/agent_mcp_cases.json +0 -137
- package/tests/fixtures/csv/sample_balances.csv +0 -7
- package/tests/fixtures/csv/sample_contacts.csv +0 -6
- package/tests/fixtures/csv/sample_crypto_transactions.csv +0 -6
- package/tests/fixtures/csv/sample_flows.csv +0 -7
- package/tests/fixtures/csv/sample_holdings.csv +0 -7
- package/tests/fixtures/csv/sample_income.csv +0 -7
- package/tests/fixtures/csv/sample_purchases.csv +0 -7
- package/tests/fixtures/csv/sample_tax_events.csv +0 -7
- package/tests/fixtures/csv/sample_transactions.csv +0 -7
- package/tests/fixtures/csv/sample_transfers.csv +0 -6
- package/tests/fixtures/expected/contact_snapshot.json +0 -19
- package/tests/fixtures/expected/transaction_snapshot.json +0 -21
- package/tests/fixtures/helpers.ts +0 -522
- package/tests/fixtures/json/account.json +0 -63
- package/tests/fixtures/json/argument.json +0 -39
- package/tests/fixtures/json/balance.json +0 -56
- package/tests/fixtures/json/belief.json +0 -44
- package/tests/fixtures/json/contact.json +0 -83
- package/tests/fixtures/json/contract.json +0 -62
- package/tests/fixtures/json/crypto_transaction.json +0 -67
- package/tests/fixtures/json/domain.json +0 -41
- package/tests/fixtures/json/emotion.json +0 -31
- package/tests/fixtures/json/fixed_cost.json +0 -75
- package/tests/fixtures/json/flow.json +0 -71
- package/tests/fixtures/json/habit.json +0 -54
- package/tests/fixtures/json/habit_completion.json +0 -31
- package/tests/fixtures/json/habit_objective.json +0 -40
- package/tests/fixtures/json/holding.json +0 -65
- package/tests/fixtures/json/income.json +0 -59
- package/tests/fixtures/json/liability.json +0 -50
- package/tests/fixtures/json/order.json +0 -62
- package/tests/fixtures/json/outcome.json +0 -56
- package/tests/fixtures/json/process.json +0 -43
- package/tests/fixtures/json/property.json +0 -52
- package/tests/fixtures/json/purchase.json +0 -66
- package/tests/fixtures/json/research.json +0 -53
- package/tests/fixtures/json/strategy.json +0 -68
- package/tests/fixtures/json/task_attachment.json +0 -62
- package/tests/fixtures/json/task_comment.json +0 -54
- package/tests/fixtures/json/task_dependency.json +0 -51
- package/tests/fixtures/json/task_story.json +0 -53
- package/tests/fixtures/json/tax_event.json +0 -60
- package/tests/fixtures/json/tax_filing.json +0 -61
- package/tests/fixtures/json/transaction.json +0 -62
- package/tests/fixtures/json/transfer.json +0 -60
- package/tests/fixtures/json/wallet.json +0 -51
- package/tests/fixtures/json/workout.json +0 -45
- package/tests/fixtures/pdf/sample-upload.txt +0 -2
- package/tests/fixtures/pdf/sample_bank_statement.md +0 -32
- package/tests/fixtures/pdf/sample_bank_statement.pdf +0 -0
- package/tests/fixtures/pdf/sample_contract.md +0 -27
- package/tests/fixtures/pdf/sample_contract.pdf +0 -0
- package/tests/fixtures/pdf/sample_exercise.md +0 -31
- package/tests/fixtures/pdf/sample_exercise.pdf +0 -0
- package/tests/fixtures/pdf/sample_holding_statement.md +0 -29
- package/tests/fixtures/pdf/sample_holding_statement.pdf +0 -0
- package/tests/fixtures/pdf/sample_invoice.md +0 -27
- package/tests/fixtures/pdf/sample_invoice.pdf +0 -108
- package/tests/fixtures/pdf/sample_meal.md +0 -28
- package/tests/fixtures/pdf/sample_meal.pdf +0 -111
- package/tests/fixtures/pdf/sample_note.md +0 -28
- package/tests/fixtures/pdf/sample_note.pdf +0 -0
- package/tests/fixtures/pdf/sample_receipt.md +0 -28
- package/tests/fixtures/pdf/sample_receipt.pdf +0 -0
- package/tests/fixtures/pdf/sample_research.md +0 -31
- package/tests/fixtures/pdf/sample_research.pdf +0 -0
- package/tests/fixtures/pdf/sample_tax_form.md +0 -38
- package/tests/fixtures/pdf/sample_tax_form.pdf +0 -0
- package/tests/fixtures/pdf/sample_transaction_receipt.md +0 -28
- package/tests/fixtures/pdf/sample_transaction_receipt.pdf +0 -0
- package/tests/fixtures/replay_graph.test.ts +0 -125
- package/tests/fixtures/sample_invoice.pdf +0 -1
- package/tests/fixtures/types.ts +0 -321
- package/tests/fixtures/validation.ts +0 -333
- package/tests/helpers/cleanup_helpers.ts +0 -550
- package/tests/helpers/create_test_parquet.ts +0 -187
- package/tests/helpers/cross_layer_helpers.ts +0 -130
- package/tests/helpers/mcp_action_helper.ts +0 -55
- package/tests/helpers/mcp_spec_validators.ts +0 -433
- package/tests/helpers/test_data_helpers.ts +0 -226
- package/tests/helpers/test_schema_helpers.ts +0 -264
- package/tests/integration/cli_to_mcp_entities.test.ts +0 -211
- package/tests/integration/cli_to_mcp_relationships.test.ts +0 -196
- package/tests/integration/cli_to_mcp_schemas.test.ts +0 -232
- package/tests/integration/cli_to_mcp_stats_snapshots.test.ts +0 -67
- package/tests/integration/cli_to_mcp_store.test.ts +0 -249
- package/tests/integration/dashboard_stats.test.ts +0 -180
- package/tests/integration/entity_queries.test.ts +0 -666
- package/tests/integration/field_converters.test.ts +0 -266
- package/tests/integration/fixture_mcp_store_replay.test.ts +0 -255
- package/tests/integration/gdpr_deletion.test.ts +0 -433
- package/tests/integration/llm_extraction.test.ts +0 -554
- package/tests/integration/mcp_actions_matrix.test.ts +0 -969
- package/tests/integration/mcp_auto_enhancement.test.ts +0 -659
- package/tests/integration/mcp_auto_schema_creation.test.ts +0 -658
- package/tests/integration/mcp_correction_variations.test.ts +0 -641
- package/tests/integration/mcp_entity_creation.test.ts +0 -333
- package/tests/integration/mcp_entity_variations.test.ts +0 -474
- package/tests/integration/mcp_graph_variations.test.ts +0 -380
- package/tests/integration/mcp_npm_check_update.test.ts +0 -54
- package/tests/integration/mcp_query_variations.test.ts +0 -392
- package/tests/integration/mcp_relationship_variations.test.ts +0 -433
- package/tests/integration/mcp_resource_variations.test.ts +0 -423
- package/tests/integration/mcp_resources.test.ts +0 -452
- package/tests/integration/mcp_schema_actions.test.ts +0 -673
- package/tests/integration/mcp_schema_variations.test.ts +0 -428
- package/tests/integration/mcp_store_parquet.test.ts +0 -466
- package/tests/integration/mcp_store_unstructured.test.ts +0 -413
- package/tests/integration/mcp_store_variations.test.ts +0 -452
- package/tests/integration/nonjson_csv_store_behavior.test.ts +0 -348
- package/tests/integration/nonjson_fixtures_mcp_replay.test.ts +0 -253
- package/tests/integration/observation_ingestion.test.ts +0 -362
- package/tests/integration/payload/payload_submission.test.ts +0 -296
- package/tests/integration/payload_compiler.test.ts +0 -347
- package/tests/integration/public_key_registry.test.ts +0 -204
- package/tests/integration/relationship_snapshots.test.ts +0 -235
- package/tests/integration/schema_recommendation_integration.test.ts +0 -418
- package/tests/integration/setup_v0.2.0_schemas.ts +0 -61
- package/tests/integration/v0.2.0_ingestion.test.ts +0 -527
- package/tests/services/auto_enhancement_converter_detection.test.ts +0 -663
- package/tests/services/auto_enhancement_processor.test.ts +0 -445
- package/tests/services/capability_registry.test.ts +0 -254
- package/tests/services/converter_detection_unit.test.ts +0 -168
- package/tests/services/encryption_service.test.ts +0 -147
- package/tests/services/entity_resolution.test.ts +0 -285
- package/tests/services/field_canonicalization.test.ts +0 -215
- package/tests/services/field_converters.test.ts +0 -211
- package/tests/services/field_validation.test.ts +0 -318
- package/tests/services/finances_field_mapping.test.ts +0 -245
- package/tests/services/interpretation.test.ts +0 -144
- package/tests/services/mcp_auth.test.ts +0 -34
- package/tests/services/observation_identity.test.ts +0 -154
- package/tests/services/payload_identity.test.ts +0 -325
- package/tests/services/payload_schema.test.ts +0 -282
- package/tests/services/raw_storage.test.ts +0 -546
- package/tests/services/schema_definitions.test.ts +0 -119
- package/tests/services/schema_recommendation.test.ts +0 -590
- package/tests/services/schema_registry_incremental.test.ts +0 -882
- package/tests/services/summary.test.ts +0 -26
- package/tests/unit/bigint_serialization.test.ts +0 -220
- package/tests/unit/observation_reducer_converters.test.ts +0 -430
- package/tests/unit/parquet_reader.test.ts +0 -155
- package/tests/unit/relationship_reducer.test.ts +0 -208
- package/tests/unit/schema_inference.test.ts +0 -358
- package/tests/unit/seo_metadata.test.ts +0 -52
- package/tsconfig.json +0 -22
- package/vite.config.ts +0 -165
- package/vitest.config.ts +0 -111
- package/vitest.global_setup.ts +0 -42
- package/vitest.setup.ts +0 -89
|
@@ -1,2859 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
abytes,
|
|
3
|
-
aexists,
|
|
4
|
-
anumber,
|
|
5
|
-
aoutput,
|
|
6
|
-
bytesToHex,
|
|
7
|
-
clean,
|
|
8
|
-
concatBytes,
|
|
9
|
-
createHasher,
|
|
10
|
-
createView,
|
|
11
|
-
hexToBytes,
|
|
12
|
-
isBytes,
|
|
13
|
-
oidNist,
|
|
14
|
-
randomBytes,
|
|
15
|
-
rotr
|
|
16
|
-
} from "./chunk-IMIZXM4S.js";
|
|
17
|
-
import {
|
|
18
|
-
__publicField
|
|
19
|
-
} from "./chunk-DC5AMYBS.js";
|
|
20
|
-
|
|
21
|
-
// node_modules/@noble/hashes/_md.js
|
|
22
|
-
function Chi(a, b, c) {
|
|
23
|
-
return a & b ^ ~a & c;
|
|
24
|
-
}
|
|
25
|
-
function Maj(a, b, c) {
|
|
26
|
-
return a & b ^ a & c ^ b & c;
|
|
27
|
-
}
|
|
28
|
-
var HashMD = class {
|
|
29
|
-
constructor(blockLen, outputLen, padOffset, isLE) {
|
|
30
|
-
__publicField(this, "blockLen");
|
|
31
|
-
__publicField(this, "outputLen");
|
|
32
|
-
__publicField(this, "padOffset");
|
|
33
|
-
__publicField(this, "isLE");
|
|
34
|
-
// For partial updates less than block size
|
|
35
|
-
__publicField(this, "buffer");
|
|
36
|
-
__publicField(this, "view");
|
|
37
|
-
__publicField(this, "finished", false);
|
|
38
|
-
__publicField(this, "length", 0);
|
|
39
|
-
__publicField(this, "pos", 0);
|
|
40
|
-
__publicField(this, "destroyed", false);
|
|
41
|
-
this.blockLen = blockLen;
|
|
42
|
-
this.outputLen = outputLen;
|
|
43
|
-
this.padOffset = padOffset;
|
|
44
|
-
this.isLE = isLE;
|
|
45
|
-
this.buffer = new Uint8Array(blockLen);
|
|
46
|
-
this.view = createView(this.buffer);
|
|
47
|
-
}
|
|
48
|
-
update(data) {
|
|
49
|
-
aexists(this);
|
|
50
|
-
abytes(data);
|
|
51
|
-
const { view, buffer, blockLen } = this;
|
|
52
|
-
const len = data.length;
|
|
53
|
-
for (let pos = 0; pos < len; ) {
|
|
54
|
-
const take = Math.min(blockLen - this.pos, len - pos);
|
|
55
|
-
if (take === blockLen) {
|
|
56
|
-
const dataView = createView(data);
|
|
57
|
-
for (; blockLen <= len - pos; pos += blockLen)
|
|
58
|
-
this.process(dataView, pos);
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
buffer.set(data.subarray(pos, pos + take), this.pos);
|
|
62
|
-
this.pos += take;
|
|
63
|
-
pos += take;
|
|
64
|
-
if (this.pos === blockLen) {
|
|
65
|
-
this.process(view, 0);
|
|
66
|
-
this.pos = 0;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
this.length += data.length;
|
|
70
|
-
this.roundClean();
|
|
71
|
-
return this;
|
|
72
|
-
}
|
|
73
|
-
digestInto(out) {
|
|
74
|
-
aexists(this);
|
|
75
|
-
aoutput(out, this);
|
|
76
|
-
this.finished = true;
|
|
77
|
-
const { buffer, view, blockLen, isLE } = this;
|
|
78
|
-
let { pos } = this;
|
|
79
|
-
buffer[pos++] = 128;
|
|
80
|
-
clean(this.buffer.subarray(pos));
|
|
81
|
-
if (this.padOffset > blockLen - pos) {
|
|
82
|
-
this.process(view, 0);
|
|
83
|
-
pos = 0;
|
|
84
|
-
}
|
|
85
|
-
for (let i = pos; i < blockLen; i++)
|
|
86
|
-
buffer[i] = 0;
|
|
87
|
-
view.setBigUint64(blockLen - 8, BigInt(this.length * 8), isLE);
|
|
88
|
-
this.process(view, 0);
|
|
89
|
-
const oview = createView(out);
|
|
90
|
-
const len = this.outputLen;
|
|
91
|
-
if (len % 4)
|
|
92
|
-
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
93
|
-
const outLen = len / 4;
|
|
94
|
-
const state = this.get();
|
|
95
|
-
if (outLen > state.length)
|
|
96
|
-
throw new Error("_sha2: outputLen bigger than state");
|
|
97
|
-
for (let i = 0; i < outLen; i++)
|
|
98
|
-
oview.setUint32(4 * i, state[i], isLE);
|
|
99
|
-
}
|
|
100
|
-
digest() {
|
|
101
|
-
const { buffer, outputLen } = this;
|
|
102
|
-
this.digestInto(buffer);
|
|
103
|
-
const res = buffer.slice(0, outputLen);
|
|
104
|
-
this.destroy();
|
|
105
|
-
return res;
|
|
106
|
-
}
|
|
107
|
-
_cloneInto(to) {
|
|
108
|
-
to || (to = new this.constructor());
|
|
109
|
-
to.set(...this.get());
|
|
110
|
-
const { blockLen, buffer, length, finished, destroyed, pos } = this;
|
|
111
|
-
to.destroyed = destroyed;
|
|
112
|
-
to.finished = finished;
|
|
113
|
-
to.length = length;
|
|
114
|
-
to.pos = pos;
|
|
115
|
-
if (length % blockLen)
|
|
116
|
-
to.buffer.set(buffer);
|
|
117
|
-
return to;
|
|
118
|
-
}
|
|
119
|
-
clone() {
|
|
120
|
-
return this._cloneInto();
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
var SHA256_IV = Uint32Array.from([
|
|
124
|
-
1779033703,
|
|
125
|
-
3144134277,
|
|
126
|
-
1013904242,
|
|
127
|
-
2773480762,
|
|
128
|
-
1359893119,
|
|
129
|
-
2600822924,
|
|
130
|
-
528734635,
|
|
131
|
-
1541459225
|
|
132
|
-
]);
|
|
133
|
-
var SHA224_IV = Uint32Array.from([
|
|
134
|
-
3238371032,
|
|
135
|
-
914150663,
|
|
136
|
-
812702999,
|
|
137
|
-
4144912697,
|
|
138
|
-
4290775857,
|
|
139
|
-
1750603025,
|
|
140
|
-
1694076839,
|
|
141
|
-
3204075428
|
|
142
|
-
]);
|
|
143
|
-
var SHA384_IV = Uint32Array.from([
|
|
144
|
-
3418070365,
|
|
145
|
-
3238371032,
|
|
146
|
-
1654270250,
|
|
147
|
-
914150663,
|
|
148
|
-
2438529370,
|
|
149
|
-
812702999,
|
|
150
|
-
355462360,
|
|
151
|
-
4144912697,
|
|
152
|
-
1731405415,
|
|
153
|
-
4290775857,
|
|
154
|
-
2394180231,
|
|
155
|
-
1750603025,
|
|
156
|
-
3675008525,
|
|
157
|
-
1694076839,
|
|
158
|
-
1203062813,
|
|
159
|
-
3204075428
|
|
160
|
-
]);
|
|
161
|
-
var SHA512_IV = Uint32Array.from([
|
|
162
|
-
1779033703,
|
|
163
|
-
4089235720,
|
|
164
|
-
3144134277,
|
|
165
|
-
2227873595,
|
|
166
|
-
1013904242,
|
|
167
|
-
4271175723,
|
|
168
|
-
2773480762,
|
|
169
|
-
1595750129,
|
|
170
|
-
1359893119,
|
|
171
|
-
2917565137,
|
|
172
|
-
2600822924,
|
|
173
|
-
725511199,
|
|
174
|
-
528734635,
|
|
175
|
-
4215389547,
|
|
176
|
-
1541459225,
|
|
177
|
-
327033209
|
|
178
|
-
]);
|
|
179
|
-
|
|
180
|
-
// node_modules/@noble/hashes/_u64.js
|
|
181
|
-
var U32_MASK64 = BigInt(2 ** 32 - 1);
|
|
182
|
-
var _32n = BigInt(32);
|
|
183
|
-
function fromBig(n, le = false) {
|
|
184
|
-
if (le)
|
|
185
|
-
return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) };
|
|
186
|
-
return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };
|
|
187
|
-
}
|
|
188
|
-
function split(lst, le = false) {
|
|
189
|
-
const len = lst.length;
|
|
190
|
-
let Ah = new Uint32Array(len);
|
|
191
|
-
let Al = new Uint32Array(len);
|
|
192
|
-
for (let i = 0; i < len; i++) {
|
|
193
|
-
const { h, l } = fromBig(lst[i], le);
|
|
194
|
-
[Ah[i], Al[i]] = [h, l];
|
|
195
|
-
}
|
|
196
|
-
return [Ah, Al];
|
|
197
|
-
}
|
|
198
|
-
var shrSH = (h, _l, s) => h >>> s;
|
|
199
|
-
var shrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
200
|
-
var rotrSH = (h, l, s) => h >>> s | l << 32 - s;
|
|
201
|
-
var rotrSL = (h, l, s) => h << 32 - s | l >>> s;
|
|
202
|
-
var rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32;
|
|
203
|
-
var rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s;
|
|
204
|
-
function add(Ah, Al, Bh, Bl) {
|
|
205
|
-
const l = (Al >>> 0) + (Bl >>> 0);
|
|
206
|
-
return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 };
|
|
207
|
-
}
|
|
208
|
-
var add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);
|
|
209
|
-
var add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0;
|
|
210
|
-
var add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);
|
|
211
|
-
var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0;
|
|
212
|
-
var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
|
213
|
-
var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
|
|
214
|
-
|
|
215
|
-
// node_modules/@noble/hashes/sha2.js
|
|
216
|
-
var SHA256_K = Uint32Array.from([
|
|
217
|
-
1116352408,
|
|
218
|
-
1899447441,
|
|
219
|
-
3049323471,
|
|
220
|
-
3921009573,
|
|
221
|
-
961987163,
|
|
222
|
-
1508970993,
|
|
223
|
-
2453635748,
|
|
224
|
-
2870763221,
|
|
225
|
-
3624381080,
|
|
226
|
-
310598401,
|
|
227
|
-
607225278,
|
|
228
|
-
1426881987,
|
|
229
|
-
1925078388,
|
|
230
|
-
2162078206,
|
|
231
|
-
2614888103,
|
|
232
|
-
3248222580,
|
|
233
|
-
3835390401,
|
|
234
|
-
4022224774,
|
|
235
|
-
264347078,
|
|
236
|
-
604807628,
|
|
237
|
-
770255983,
|
|
238
|
-
1249150122,
|
|
239
|
-
1555081692,
|
|
240
|
-
1996064986,
|
|
241
|
-
2554220882,
|
|
242
|
-
2821834349,
|
|
243
|
-
2952996808,
|
|
244
|
-
3210313671,
|
|
245
|
-
3336571891,
|
|
246
|
-
3584528711,
|
|
247
|
-
113926993,
|
|
248
|
-
338241895,
|
|
249
|
-
666307205,
|
|
250
|
-
773529912,
|
|
251
|
-
1294757372,
|
|
252
|
-
1396182291,
|
|
253
|
-
1695183700,
|
|
254
|
-
1986661051,
|
|
255
|
-
2177026350,
|
|
256
|
-
2456956037,
|
|
257
|
-
2730485921,
|
|
258
|
-
2820302411,
|
|
259
|
-
3259730800,
|
|
260
|
-
3345764771,
|
|
261
|
-
3516065817,
|
|
262
|
-
3600352804,
|
|
263
|
-
4094571909,
|
|
264
|
-
275423344,
|
|
265
|
-
430227734,
|
|
266
|
-
506948616,
|
|
267
|
-
659060556,
|
|
268
|
-
883997877,
|
|
269
|
-
958139571,
|
|
270
|
-
1322822218,
|
|
271
|
-
1537002063,
|
|
272
|
-
1747873779,
|
|
273
|
-
1955562222,
|
|
274
|
-
2024104815,
|
|
275
|
-
2227730452,
|
|
276
|
-
2361852424,
|
|
277
|
-
2428436474,
|
|
278
|
-
2756734187,
|
|
279
|
-
3204031479,
|
|
280
|
-
3329325298
|
|
281
|
-
]);
|
|
282
|
-
var SHA256_W = new Uint32Array(64);
|
|
283
|
-
var SHA2_32B = class extends HashMD {
|
|
284
|
-
constructor(outputLen) {
|
|
285
|
-
super(64, outputLen, 8, false);
|
|
286
|
-
}
|
|
287
|
-
get() {
|
|
288
|
-
const { A, B, C, D, E, F, G, H } = this;
|
|
289
|
-
return [A, B, C, D, E, F, G, H];
|
|
290
|
-
}
|
|
291
|
-
// prettier-ignore
|
|
292
|
-
set(A, B, C, D, E, F, G, H) {
|
|
293
|
-
this.A = A | 0;
|
|
294
|
-
this.B = B | 0;
|
|
295
|
-
this.C = C | 0;
|
|
296
|
-
this.D = D | 0;
|
|
297
|
-
this.E = E | 0;
|
|
298
|
-
this.F = F | 0;
|
|
299
|
-
this.G = G | 0;
|
|
300
|
-
this.H = H | 0;
|
|
301
|
-
}
|
|
302
|
-
process(view, offset) {
|
|
303
|
-
for (let i = 0; i < 16; i++, offset += 4)
|
|
304
|
-
SHA256_W[i] = view.getUint32(offset, false);
|
|
305
|
-
for (let i = 16; i < 64; i++) {
|
|
306
|
-
const W15 = SHA256_W[i - 15];
|
|
307
|
-
const W2 = SHA256_W[i - 2];
|
|
308
|
-
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
|
309
|
-
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
310
|
-
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
|
311
|
-
}
|
|
312
|
-
let { A, B, C, D, E, F, G, H } = this;
|
|
313
|
-
for (let i = 0; i < 64; i++) {
|
|
314
|
-
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
|
315
|
-
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
|
316
|
-
const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
|
|
317
|
-
const T2 = sigma0 + Maj(A, B, C) | 0;
|
|
318
|
-
H = G;
|
|
319
|
-
G = F;
|
|
320
|
-
F = E;
|
|
321
|
-
E = D + T1 | 0;
|
|
322
|
-
D = C;
|
|
323
|
-
C = B;
|
|
324
|
-
B = A;
|
|
325
|
-
A = T1 + T2 | 0;
|
|
326
|
-
}
|
|
327
|
-
A = A + this.A | 0;
|
|
328
|
-
B = B + this.B | 0;
|
|
329
|
-
C = C + this.C | 0;
|
|
330
|
-
D = D + this.D | 0;
|
|
331
|
-
E = E + this.E | 0;
|
|
332
|
-
F = F + this.F | 0;
|
|
333
|
-
G = G + this.G | 0;
|
|
334
|
-
H = H + this.H | 0;
|
|
335
|
-
this.set(A, B, C, D, E, F, G, H);
|
|
336
|
-
}
|
|
337
|
-
roundClean() {
|
|
338
|
-
clean(SHA256_W);
|
|
339
|
-
}
|
|
340
|
-
destroy() {
|
|
341
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
342
|
-
clean(this.buffer);
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
var _SHA256 = class extends SHA2_32B {
|
|
346
|
-
constructor() {
|
|
347
|
-
super(32);
|
|
348
|
-
// We cannot use array here since array allows indexing by variable
|
|
349
|
-
// which means optimizer/compiler cannot use registers.
|
|
350
|
-
__publicField(this, "A", SHA256_IV[0] | 0);
|
|
351
|
-
__publicField(this, "B", SHA256_IV[1] | 0);
|
|
352
|
-
__publicField(this, "C", SHA256_IV[2] | 0);
|
|
353
|
-
__publicField(this, "D", SHA256_IV[3] | 0);
|
|
354
|
-
__publicField(this, "E", SHA256_IV[4] | 0);
|
|
355
|
-
__publicField(this, "F", SHA256_IV[5] | 0);
|
|
356
|
-
__publicField(this, "G", SHA256_IV[6] | 0);
|
|
357
|
-
__publicField(this, "H", SHA256_IV[7] | 0);
|
|
358
|
-
}
|
|
359
|
-
};
|
|
360
|
-
var _SHA224 = class extends SHA2_32B {
|
|
361
|
-
constructor() {
|
|
362
|
-
super(28);
|
|
363
|
-
__publicField(this, "A", SHA224_IV[0] | 0);
|
|
364
|
-
__publicField(this, "B", SHA224_IV[1] | 0);
|
|
365
|
-
__publicField(this, "C", SHA224_IV[2] | 0);
|
|
366
|
-
__publicField(this, "D", SHA224_IV[3] | 0);
|
|
367
|
-
__publicField(this, "E", SHA224_IV[4] | 0);
|
|
368
|
-
__publicField(this, "F", SHA224_IV[5] | 0);
|
|
369
|
-
__publicField(this, "G", SHA224_IV[6] | 0);
|
|
370
|
-
__publicField(this, "H", SHA224_IV[7] | 0);
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
var K512 = (() => split([
|
|
374
|
-
"0x428a2f98d728ae22",
|
|
375
|
-
"0x7137449123ef65cd",
|
|
376
|
-
"0xb5c0fbcfec4d3b2f",
|
|
377
|
-
"0xe9b5dba58189dbbc",
|
|
378
|
-
"0x3956c25bf348b538",
|
|
379
|
-
"0x59f111f1b605d019",
|
|
380
|
-
"0x923f82a4af194f9b",
|
|
381
|
-
"0xab1c5ed5da6d8118",
|
|
382
|
-
"0xd807aa98a3030242",
|
|
383
|
-
"0x12835b0145706fbe",
|
|
384
|
-
"0x243185be4ee4b28c",
|
|
385
|
-
"0x550c7dc3d5ffb4e2",
|
|
386
|
-
"0x72be5d74f27b896f",
|
|
387
|
-
"0x80deb1fe3b1696b1",
|
|
388
|
-
"0x9bdc06a725c71235",
|
|
389
|
-
"0xc19bf174cf692694",
|
|
390
|
-
"0xe49b69c19ef14ad2",
|
|
391
|
-
"0xefbe4786384f25e3",
|
|
392
|
-
"0x0fc19dc68b8cd5b5",
|
|
393
|
-
"0x240ca1cc77ac9c65",
|
|
394
|
-
"0x2de92c6f592b0275",
|
|
395
|
-
"0x4a7484aa6ea6e483",
|
|
396
|
-
"0x5cb0a9dcbd41fbd4",
|
|
397
|
-
"0x76f988da831153b5",
|
|
398
|
-
"0x983e5152ee66dfab",
|
|
399
|
-
"0xa831c66d2db43210",
|
|
400
|
-
"0xb00327c898fb213f",
|
|
401
|
-
"0xbf597fc7beef0ee4",
|
|
402
|
-
"0xc6e00bf33da88fc2",
|
|
403
|
-
"0xd5a79147930aa725",
|
|
404
|
-
"0x06ca6351e003826f",
|
|
405
|
-
"0x142929670a0e6e70",
|
|
406
|
-
"0x27b70a8546d22ffc",
|
|
407
|
-
"0x2e1b21385c26c926",
|
|
408
|
-
"0x4d2c6dfc5ac42aed",
|
|
409
|
-
"0x53380d139d95b3df",
|
|
410
|
-
"0x650a73548baf63de",
|
|
411
|
-
"0x766a0abb3c77b2a8",
|
|
412
|
-
"0x81c2c92e47edaee6",
|
|
413
|
-
"0x92722c851482353b",
|
|
414
|
-
"0xa2bfe8a14cf10364",
|
|
415
|
-
"0xa81a664bbc423001",
|
|
416
|
-
"0xc24b8b70d0f89791",
|
|
417
|
-
"0xc76c51a30654be30",
|
|
418
|
-
"0xd192e819d6ef5218",
|
|
419
|
-
"0xd69906245565a910",
|
|
420
|
-
"0xf40e35855771202a",
|
|
421
|
-
"0x106aa07032bbd1b8",
|
|
422
|
-
"0x19a4c116b8d2d0c8",
|
|
423
|
-
"0x1e376c085141ab53",
|
|
424
|
-
"0x2748774cdf8eeb99",
|
|
425
|
-
"0x34b0bcb5e19b48a8",
|
|
426
|
-
"0x391c0cb3c5c95a63",
|
|
427
|
-
"0x4ed8aa4ae3418acb",
|
|
428
|
-
"0x5b9cca4f7763e373",
|
|
429
|
-
"0x682e6ff3d6b2b8a3",
|
|
430
|
-
"0x748f82ee5defb2fc",
|
|
431
|
-
"0x78a5636f43172f60",
|
|
432
|
-
"0x84c87814a1f0ab72",
|
|
433
|
-
"0x8cc702081a6439ec",
|
|
434
|
-
"0x90befffa23631e28",
|
|
435
|
-
"0xa4506cebde82bde9",
|
|
436
|
-
"0xbef9a3f7b2c67915",
|
|
437
|
-
"0xc67178f2e372532b",
|
|
438
|
-
"0xca273eceea26619c",
|
|
439
|
-
"0xd186b8c721c0c207",
|
|
440
|
-
"0xeada7dd6cde0eb1e",
|
|
441
|
-
"0xf57d4f7fee6ed178",
|
|
442
|
-
"0x06f067aa72176fba",
|
|
443
|
-
"0x0a637dc5a2c898a6",
|
|
444
|
-
"0x113f9804bef90dae",
|
|
445
|
-
"0x1b710b35131c471b",
|
|
446
|
-
"0x28db77f523047d84",
|
|
447
|
-
"0x32caab7b40c72493",
|
|
448
|
-
"0x3c9ebe0a15c9bebc",
|
|
449
|
-
"0x431d67c49c100d4c",
|
|
450
|
-
"0x4cc5d4becb3e42b6",
|
|
451
|
-
"0x597f299cfc657e2a",
|
|
452
|
-
"0x5fcb6fab3ad6faec",
|
|
453
|
-
"0x6c44198c4a475817"
|
|
454
|
-
].map((n) => BigInt(n))))();
|
|
455
|
-
var SHA512_Kh = (() => K512[0])();
|
|
456
|
-
var SHA512_Kl = (() => K512[1])();
|
|
457
|
-
var SHA512_W_H = new Uint32Array(80);
|
|
458
|
-
var SHA512_W_L = new Uint32Array(80);
|
|
459
|
-
var SHA2_64B = class extends HashMD {
|
|
460
|
-
constructor(outputLen) {
|
|
461
|
-
super(128, outputLen, 16, false);
|
|
462
|
-
}
|
|
463
|
-
// prettier-ignore
|
|
464
|
-
get() {
|
|
465
|
-
const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
|
466
|
-
return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];
|
|
467
|
-
}
|
|
468
|
-
// prettier-ignore
|
|
469
|
-
set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {
|
|
470
|
-
this.Ah = Ah | 0;
|
|
471
|
-
this.Al = Al | 0;
|
|
472
|
-
this.Bh = Bh | 0;
|
|
473
|
-
this.Bl = Bl | 0;
|
|
474
|
-
this.Ch = Ch | 0;
|
|
475
|
-
this.Cl = Cl | 0;
|
|
476
|
-
this.Dh = Dh | 0;
|
|
477
|
-
this.Dl = Dl | 0;
|
|
478
|
-
this.Eh = Eh | 0;
|
|
479
|
-
this.El = El | 0;
|
|
480
|
-
this.Fh = Fh | 0;
|
|
481
|
-
this.Fl = Fl | 0;
|
|
482
|
-
this.Gh = Gh | 0;
|
|
483
|
-
this.Gl = Gl | 0;
|
|
484
|
-
this.Hh = Hh | 0;
|
|
485
|
-
this.Hl = Hl | 0;
|
|
486
|
-
}
|
|
487
|
-
process(view, offset) {
|
|
488
|
-
for (let i = 0; i < 16; i++, offset += 4) {
|
|
489
|
-
SHA512_W_H[i] = view.getUint32(offset);
|
|
490
|
-
SHA512_W_L[i] = view.getUint32(offset += 4);
|
|
491
|
-
}
|
|
492
|
-
for (let i = 16; i < 80; i++) {
|
|
493
|
-
const W15h = SHA512_W_H[i - 15] | 0;
|
|
494
|
-
const W15l = SHA512_W_L[i - 15] | 0;
|
|
495
|
-
const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7);
|
|
496
|
-
const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7);
|
|
497
|
-
const W2h = SHA512_W_H[i - 2] | 0;
|
|
498
|
-
const W2l = SHA512_W_L[i - 2] | 0;
|
|
499
|
-
const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6);
|
|
500
|
-
const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6);
|
|
501
|
-
const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);
|
|
502
|
-
const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);
|
|
503
|
-
SHA512_W_H[i] = SUMh | 0;
|
|
504
|
-
SHA512_W_L[i] = SUMl | 0;
|
|
505
|
-
}
|
|
506
|
-
let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;
|
|
507
|
-
for (let i = 0; i < 80; i++) {
|
|
508
|
-
const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41);
|
|
509
|
-
const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41);
|
|
510
|
-
const CHIh = Eh & Fh ^ ~Eh & Gh;
|
|
511
|
-
const CHIl = El & Fl ^ ~El & Gl;
|
|
512
|
-
const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);
|
|
513
|
-
const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);
|
|
514
|
-
const T1l = T1ll | 0;
|
|
515
|
-
const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39);
|
|
516
|
-
const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39);
|
|
517
|
-
const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch;
|
|
518
|
-
const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl;
|
|
519
|
-
Hh = Gh | 0;
|
|
520
|
-
Hl = Gl | 0;
|
|
521
|
-
Gh = Fh | 0;
|
|
522
|
-
Gl = Fl | 0;
|
|
523
|
-
Fh = Eh | 0;
|
|
524
|
-
Fl = El | 0;
|
|
525
|
-
({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));
|
|
526
|
-
Dh = Ch | 0;
|
|
527
|
-
Dl = Cl | 0;
|
|
528
|
-
Ch = Bh | 0;
|
|
529
|
-
Cl = Bl | 0;
|
|
530
|
-
Bh = Ah | 0;
|
|
531
|
-
Bl = Al | 0;
|
|
532
|
-
const All = add3L(T1l, sigma0l, MAJl);
|
|
533
|
-
Ah = add3H(All, T1h, sigma0h, MAJh);
|
|
534
|
-
Al = All | 0;
|
|
535
|
-
}
|
|
536
|
-
({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));
|
|
537
|
-
({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));
|
|
538
|
-
({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));
|
|
539
|
-
({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));
|
|
540
|
-
({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));
|
|
541
|
-
({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));
|
|
542
|
-
({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));
|
|
543
|
-
({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));
|
|
544
|
-
this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);
|
|
545
|
-
}
|
|
546
|
-
roundClean() {
|
|
547
|
-
clean(SHA512_W_H, SHA512_W_L);
|
|
548
|
-
}
|
|
549
|
-
destroy() {
|
|
550
|
-
clean(this.buffer);
|
|
551
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
552
|
-
}
|
|
553
|
-
};
|
|
554
|
-
var _SHA512 = class extends SHA2_64B {
|
|
555
|
-
constructor() {
|
|
556
|
-
super(64);
|
|
557
|
-
__publicField(this, "Ah", SHA512_IV[0] | 0);
|
|
558
|
-
__publicField(this, "Al", SHA512_IV[1] | 0);
|
|
559
|
-
__publicField(this, "Bh", SHA512_IV[2] | 0);
|
|
560
|
-
__publicField(this, "Bl", SHA512_IV[3] | 0);
|
|
561
|
-
__publicField(this, "Ch", SHA512_IV[4] | 0);
|
|
562
|
-
__publicField(this, "Cl", SHA512_IV[5] | 0);
|
|
563
|
-
__publicField(this, "Dh", SHA512_IV[6] | 0);
|
|
564
|
-
__publicField(this, "Dl", SHA512_IV[7] | 0);
|
|
565
|
-
__publicField(this, "Eh", SHA512_IV[8] | 0);
|
|
566
|
-
__publicField(this, "El", SHA512_IV[9] | 0);
|
|
567
|
-
__publicField(this, "Fh", SHA512_IV[10] | 0);
|
|
568
|
-
__publicField(this, "Fl", SHA512_IV[11] | 0);
|
|
569
|
-
__publicField(this, "Gh", SHA512_IV[12] | 0);
|
|
570
|
-
__publicField(this, "Gl", SHA512_IV[13] | 0);
|
|
571
|
-
__publicField(this, "Hh", SHA512_IV[14] | 0);
|
|
572
|
-
__publicField(this, "Hl", SHA512_IV[15] | 0);
|
|
573
|
-
}
|
|
574
|
-
};
|
|
575
|
-
var _SHA384 = class extends SHA2_64B {
|
|
576
|
-
constructor() {
|
|
577
|
-
super(48);
|
|
578
|
-
__publicField(this, "Ah", SHA384_IV[0] | 0);
|
|
579
|
-
__publicField(this, "Al", SHA384_IV[1] | 0);
|
|
580
|
-
__publicField(this, "Bh", SHA384_IV[2] | 0);
|
|
581
|
-
__publicField(this, "Bl", SHA384_IV[3] | 0);
|
|
582
|
-
__publicField(this, "Ch", SHA384_IV[4] | 0);
|
|
583
|
-
__publicField(this, "Cl", SHA384_IV[5] | 0);
|
|
584
|
-
__publicField(this, "Dh", SHA384_IV[6] | 0);
|
|
585
|
-
__publicField(this, "Dl", SHA384_IV[7] | 0);
|
|
586
|
-
__publicField(this, "Eh", SHA384_IV[8] | 0);
|
|
587
|
-
__publicField(this, "El", SHA384_IV[9] | 0);
|
|
588
|
-
__publicField(this, "Fh", SHA384_IV[10] | 0);
|
|
589
|
-
__publicField(this, "Fl", SHA384_IV[11] | 0);
|
|
590
|
-
__publicField(this, "Gh", SHA384_IV[12] | 0);
|
|
591
|
-
__publicField(this, "Gl", SHA384_IV[13] | 0);
|
|
592
|
-
__publicField(this, "Hh", SHA384_IV[14] | 0);
|
|
593
|
-
__publicField(this, "Hl", SHA384_IV[15] | 0);
|
|
594
|
-
}
|
|
595
|
-
};
|
|
596
|
-
var T224_IV = Uint32Array.from([
|
|
597
|
-
2352822216,
|
|
598
|
-
424955298,
|
|
599
|
-
1944164710,
|
|
600
|
-
2312950998,
|
|
601
|
-
502970286,
|
|
602
|
-
855612546,
|
|
603
|
-
1738396948,
|
|
604
|
-
1479516111,
|
|
605
|
-
258812777,
|
|
606
|
-
2077511080,
|
|
607
|
-
2011393907,
|
|
608
|
-
79989058,
|
|
609
|
-
1067287976,
|
|
610
|
-
1780299464,
|
|
611
|
-
286451373,
|
|
612
|
-
2446758561
|
|
613
|
-
]);
|
|
614
|
-
var T256_IV = Uint32Array.from([
|
|
615
|
-
573645204,
|
|
616
|
-
4230739756,
|
|
617
|
-
2673172387,
|
|
618
|
-
3360449730,
|
|
619
|
-
596883563,
|
|
620
|
-
1867755857,
|
|
621
|
-
2520282905,
|
|
622
|
-
1497426621,
|
|
623
|
-
2519219938,
|
|
624
|
-
2827943907,
|
|
625
|
-
3193839141,
|
|
626
|
-
1401305490,
|
|
627
|
-
721525244,
|
|
628
|
-
746961066,
|
|
629
|
-
246885852,
|
|
630
|
-
2177182882
|
|
631
|
-
]);
|
|
632
|
-
var _SHA512_224 = class extends SHA2_64B {
|
|
633
|
-
constructor() {
|
|
634
|
-
super(28);
|
|
635
|
-
__publicField(this, "Ah", T224_IV[0] | 0);
|
|
636
|
-
__publicField(this, "Al", T224_IV[1] | 0);
|
|
637
|
-
__publicField(this, "Bh", T224_IV[2] | 0);
|
|
638
|
-
__publicField(this, "Bl", T224_IV[3] | 0);
|
|
639
|
-
__publicField(this, "Ch", T224_IV[4] | 0);
|
|
640
|
-
__publicField(this, "Cl", T224_IV[5] | 0);
|
|
641
|
-
__publicField(this, "Dh", T224_IV[6] | 0);
|
|
642
|
-
__publicField(this, "Dl", T224_IV[7] | 0);
|
|
643
|
-
__publicField(this, "Eh", T224_IV[8] | 0);
|
|
644
|
-
__publicField(this, "El", T224_IV[9] | 0);
|
|
645
|
-
__publicField(this, "Fh", T224_IV[10] | 0);
|
|
646
|
-
__publicField(this, "Fl", T224_IV[11] | 0);
|
|
647
|
-
__publicField(this, "Gh", T224_IV[12] | 0);
|
|
648
|
-
__publicField(this, "Gl", T224_IV[13] | 0);
|
|
649
|
-
__publicField(this, "Hh", T224_IV[14] | 0);
|
|
650
|
-
__publicField(this, "Hl", T224_IV[15] | 0);
|
|
651
|
-
}
|
|
652
|
-
};
|
|
653
|
-
var _SHA512_256 = class extends SHA2_64B {
|
|
654
|
-
constructor() {
|
|
655
|
-
super(32);
|
|
656
|
-
__publicField(this, "Ah", T256_IV[0] | 0);
|
|
657
|
-
__publicField(this, "Al", T256_IV[1] | 0);
|
|
658
|
-
__publicField(this, "Bh", T256_IV[2] | 0);
|
|
659
|
-
__publicField(this, "Bl", T256_IV[3] | 0);
|
|
660
|
-
__publicField(this, "Ch", T256_IV[4] | 0);
|
|
661
|
-
__publicField(this, "Cl", T256_IV[5] | 0);
|
|
662
|
-
__publicField(this, "Dh", T256_IV[6] | 0);
|
|
663
|
-
__publicField(this, "Dl", T256_IV[7] | 0);
|
|
664
|
-
__publicField(this, "Eh", T256_IV[8] | 0);
|
|
665
|
-
__publicField(this, "El", T256_IV[9] | 0);
|
|
666
|
-
__publicField(this, "Fh", T256_IV[10] | 0);
|
|
667
|
-
__publicField(this, "Fl", T256_IV[11] | 0);
|
|
668
|
-
__publicField(this, "Gh", T256_IV[12] | 0);
|
|
669
|
-
__publicField(this, "Gl", T256_IV[13] | 0);
|
|
670
|
-
__publicField(this, "Hh", T256_IV[14] | 0);
|
|
671
|
-
__publicField(this, "Hl", T256_IV[15] | 0);
|
|
672
|
-
}
|
|
673
|
-
};
|
|
674
|
-
var sha256 = createHasher(
|
|
675
|
-
() => new _SHA256(),
|
|
676
|
-
oidNist(1)
|
|
677
|
-
);
|
|
678
|
-
var sha224 = createHasher(
|
|
679
|
-
() => new _SHA224(),
|
|
680
|
-
oidNist(4)
|
|
681
|
-
);
|
|
682
|
-
var sha512 = createHasher(
|
|
683
|
-
() => new _SHA512(),
|
|
684
|
-
oidNist(3)
|
|
685
|
-
);
|
|
686
|
-
var sha384 = createHasher(
|
|
687
|
-
() => new _SHA384(),
|
|
688
|
-
oidNist(2)
|
|
689
|
-
);
|
|
690
|
-
var sha512_256 = createHasher(
|
|
691
|
-
() => new _SHA512_256(),
|
|
692
|
-
oidNist(6)
|
|
693
|
-
);
|
|
694
|
-
var sha512_224 = createHasher(
|
|
695
|
-
() => new _SHA512_224(),
|
|
696
|
-
oidNist(5)
|
|
697
|
-
);
|
|
698
|
-
|
|
699
|
-
// node_modules/@noble/curves/utils.js
|
|
700
|
-
var _0n = BigInt(0);
|
|
701
|
-
var _1n = BigInt(1);
|
|
702
|
-
function abool(value, title = "") {
|
|
703
|
-
if (typeof value !== "boolean") {
|
|
704
|
-
const prefix = title && `"${title}" `;
|
|
705
|
-
throw new Error(prefix + "expected boolean, got type=" + typeof value);
|
|
706
|
-
}
|
|
707
|
-
return value;
|
|
708
|
-
}
|
|
709
|
-
function abignumber(n) {
|
|
710
|
-
if (typeof n === "bigint") {
|
|
711
|
-
if (!isPosBig(n))
|
|
712
|
-
throw new Error("positive bigint expected, got " + n);
|
|
713
|
-
} else
|
|
714
|
-
anumber(n);
|
|
715
|
-
return n;
|
|
716
|
-
}
|
|
717
|
-
function asafenumber(value, title = "") {
|
|
718
|
-
if (!Number.isSafeInteger(value)) {
|
|
719
|
-
const prefix = title && `"${title}" `;
|
|
720
|
-
throw new Error(prefix + "expected safe integer, got type=" + typeof value);
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
function hexToNumber(hex) {
|
|
724
|
-
if (typeof hex !== "string")
|
|
725
|
-
throw new Error("hex string expected, got " + typeof hex);
|
|
726
|
-
return hex === "" ? _0n : BigInt("0x" + hex);
|
|
727
|
-
}
|
|
728
|
-
function bytesToNumberBE(bytes) {
|
|
729
|
-
return hexToNumber(bytesToHex(bytes));
|
|
730
|
-
}
|
|
731
|
-
function bytesToNumberLE(bytes) {
|
|
732
|
-
return hexToNumber(bytesToHex(copyBytes(abytes(bytes)).reverse()));
|
|
733
|
-
}
|
|
734
|
-
function numberToBytesBE(n, len) {
|
|
735
|
-
anumber(len);
|
|
736
|
-
n = abignumber(n);
|
|
737
|
-
const res = hexToBytes(n.toString(16).padStart(len * 2, "0"));
|
|
738
|
-
if (res.length !== len)
|
|
739
|
-
throw new Error("number too large");
|
|
740
|
-
return res;
|
|
741
|
-
}
|
|
742
|
-
function numberToBytesLE(n, len) {
|
|
743
|
-
return numberToBytesBE(n, len).reverse();
|
|
744
|
-
}
|
|
745
|
-
function equalBytes(a, b) {
|
|
746
|
-
if (a.length !== b.length)
|
|
747
|
-
return false;
|
|
748
|
-
let diff = 0;
|
|
749
|
-
for (let i = 0; i < a.length; i++)
|
|
750
|
-
diff |= a[i] ^ b[i];
|
|
751
|
-
return diff === 0;
|
|
752
|
-
}
|
|
753
|
-
function copyBytes(bytes) {
|
|
754
|
-
return Uint8Array.from(bytes);
|
|
755
|
-
}
|
|
756
|
-
function asciiToBytes(ascii) {
|
|
757
|
-
return Uint8Array.from(ascii, (c, i) => {
|
|
758
|
-
const charCode = c.charCodeAt(0);
|
|
759
|
-
if (c.length !== 1 || charCode > 127) {
|
|
760
|
-
throw new Error(`string contains non-ASCII character "${ascii[i]}" with code ${charCode} at position ${i}`);
|
|
761
|
-
}
|
|
762
|
-
return charCode;
|
|
763
|
-
});
|
|
764
|
-
}
|
|
765
|
-
var isPosBig = (n) => typeof n === "bigint" && _0n <= n;
|
|
766
|
-
function inRange(n, min, max) {
|
|
767
|
-
return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;
|
|
768
|
-
}
|
|
769
|
-
function aInRange(title, n, min, max) {
|
|
770
|
-
if (!inRange(n, min, max))
|
|
771
|
-
throw new Error("expected valid " + title + ": " + min + " <= n < " + max + ", got " + n);
|
|
772
|
-
}
|
|
773
|
-
function bitLen(n) {
|
|
774
|
-
let len;
|
|
775
|
-
for (len = 0; n > _0n; n >>= _1n, len += 1)
|
|
776
|
-
;
|
|
777
|
-
return len;
|
|
778
|
-
}
|
|
779
|
-
var bitMask = (n) => (_1n << BigInt(n)) - _1n;
|
|
780
|
-
function validateObject(object, fields = {}, optFields = {}) {
|
|
781
|
-
if (!object || typeof object !== "object")
|
|
782
|
-
throw new Error("expected valid options object");
|
|
783
|
-
function checkField(fieldName, expectedType, isOpt) {
|
|
784
|
-
const val = object[fieldName];
|
|
785
|
-
if (isOpt && val === void 0)
|
|
786
|
-
return;
|
|
787
|
-
const current = typeof val;
|
|
788
|
-
if (current !== expectedType || val === null)
|
|
789
|
-
throw new Error(`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`);
|
|
790
|
-
}
|
|
791
|
-
const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));
|
|
792
|
-
iter(fields, false);
|
|
793
|
-
iter(optFields, true);
|
|
794
|
-
}
|
|
795
|
-
var notImplemented = () => {
|
|
796
|
-
throw new Error("not implemented");
|
|
797
|
-
};
|
|
798
|
-
function memoized(fn) {
|
|
799
|
-
const map = /* @__PURE__ */ new WeakMap();
|
|
800
|
-
return (arg, ...args) => {
|
|
801
|
-
const val = map.get(arg);
|
|
802
|
-
if (val !== void 0)
|
|
803
|
-
return val;
|
|
804
|
-
const computed = fn(arg, ...args);
|
|
805
|
-
map.set(arg, computed);
|
|
806
|
-
return computed;
|
|
807
|
-
};
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
// node_modules/@noble/curves/abstract/modular.js
|
|
811
|
-
var _0n2 = BigInt(0);
|
|
812
|
-
var _1n2 = BigInt(1);
|
|
813
|
-
var _2n = BigInt(2);
|
|
814
|
-
var _3n = BigInt(3);
|
|
815
|
-
var _4n = BigInt(4);
|
|
816
|
-
var _5n = BigInt(5);
|
|
817
|
-
var _7n = BigInt(7);
|
|
818
|
-
var _8n = BigInt(8);
|
|
819
|
-
var _9n = BigInt(9);
|
|
820
|
-
var _16n = BigInt(16);
|
|
821
|
-
function mod(a, b) {
|
|
822
|
-
const result = a % b;
|
|
823
|
-
return result >= _0n2 ? result : b + result;
|
|
824
|
-
}
|
|
825
|
-
function pow2(x, power, modulo) {
|
|
826
|
-
let res = x;
|
|
827
|
-
while (power-- > _0n2) {
|
|
828
|
-
res *= res;
|
|
829
|
-
res %= modulo;
|
|
830
|
-
}
|
|
831
|
-
return res;
|
|
832
|
-
}
|
|
833
|
-
function invert(number, modulo) {
|
|
834
|
-
if (number === _0n2)
|
|
835
|
-
throw new Error("invert: expected non-zero number");
|
|
836
|
-
if (modulo <= _0n2)
|
|
837
|
-
throw new Error("invert: expected positive modulus, got " + modulo);
|
|
838
|
-
let a = mod(number, modulo);
|
|
839
|
-
let b = modulo;
|
|
840
|
-
let x = _0n2, y = _1n2, u = _1n2, v = _0n2;
|
|
841
|
-
while (a !== _0n2) {
|
|
842
|
-
const q = b / a;
|
|
843
|
-
const r = b % a;
|
|
844
|
-
const m = x - u * q;
|
|
845
|
-
const n = y - v * q;
|
|
846
|
-
b = a, a = r, x = u, y = v, u = m, v = n;
|
|
847
|
-
}
|
|
848
|
-
const gcd = b;
|
|
849
|
-
if (gcd !== _1n2)
|
|
850
|
-
throw new Error("invert: does not exist");
|
|
851
|
-
return mod(x, modulo);
|
|
852
|
-
}
|
|
853
|
-
function assertIsSquare(Fp2, root, n) {
|
|
854
|
-
if (!Fp2.eql(Fp2.sqr(root), n))
|
|
855
|
-
throw new Error("Cannot find square root");
|
|
856
|
-
}
|
|
857
|
-
function sqrt3mod4(Fp2, n) {
|
|
858
|
-
const p1div4 = (Fp2.ORDER + _1n2) / _4n;
|
|
859
|
-
const root = Fp2.pow(n, p1div4);
|
|
860
|
-
assertIsSquare(Fp2, root, n);
|
|
861
|
-
return root;
|
|
862
|
-
}
|
|
863
|
-
function sqrt5mod8(Fp2, n) {
|
|
864
|
-
const p5div8 = (Fp2.ORDER - _5n) / _8n;
|
|
865
|
-
const n2 = Fp2.mul(n, _2n);
|
|
866
|
-
const v = Fp2.pow(n2, p5div8);
|
|
867
|
-
const nv = Fp2.mul(n, v);
|
|
868
|
-
const i = Fp2.mul(Fp2.mul(nv, _2n), v);
|
|
869
|
-
const root = Fp2.mul(nv, Fp2.sub(i, Fp2.ONE));
|
|
870
|
-
assertIsSquare(Fp2, root, n);
|
|
871
|
-
return root;
|
|
872
|
-
}
|
|
873
|
-
function sqrt9mod16(P) {
|
|
874
|
-
const Fp_ = Field(P);
|
|
875
|
-
const tn = tonelliShanks(P);
|
|
876
|
-
const c1 = tn(Fp_, Fp_.neg(Fp_.ONE));
|
|
877
|
-
const c2 = tn(Fp_, c1);
|
|
878
|
-
const c3 = tn(Fp_, Fp_.neg(c1));
|
|
879
|
-
const c4 = (P + _7n) / _16n;
|
|
880
|
-
return (Fp2, n) => {
|
|
881
|
-
let tv1 = Fp2.pow(n, c4);
|
|
882
|
-
let tv2 = Fp2.mul(tv1, c1);
|
|
883
|
-
const tv3 = Fp2.mul(tv1, c2);
|
|
884
|
-
const tv4 = Fp2.mul(tv1, c3);
|
|
885
|
-
const e1 = Fp2.eql(Fp2.sqr(tv2), n);
|
|
886
|
-
const e2 = Fp2.eql(Fp2.sqr(tv3), n);
|
|
887
|
-
tv1 = Fp2.cmov(tv1, tv2, e1);
|
|
888
|
-
tv2 = Fp2.cmov(tv4, tv3, e2);
|
|
889
|
-
const e3 = Fp2.eql(Fp2.sqr(tv2), n);
|
|
890
|
-
const root = Fp2.cmov(tv1, tv2, e3);
|
|
891
|
-
assertIsSquare(Fp2, root, n);
|
|
892
|
-
return root;
|
|
893
|
-
};
|
|
894
|
-
}
|
|
895
|
-
function tonelliShanks(P) {
|
|
896
|
-
if (P < _3n)
|
|
897
|
-
throw new Error("sqrt is not defined for small field");
|
|
898
|
-
let Q = P - _1n2;
|
|
899
|
-
let S = 0;
|
|
900
|
-
while (Q % _2n === _0n2) {
|
|
901
|
-
Q /= _2n;
|
|
902
|
-
S++;
|
|
903
|
-
}
|
|
904
|
-
let Z = _2n;
|
|
905
|
-
const _Fp = Field(P);
|
|
906
|
-
while (FpLegendre(_Fp, Z) === 1) {
|
|
907
|
-
if (Z++ > 1e3)
|
|
908
|
-
throw new Error("Cannot find square root: probably non-prime P");
|
|
909
|
-
}
|
|
910
|
-
if (S === 1)
|
|
911
|
-
return sqrt3mod4;
|
|
912
|
-
let cc = _Fp.pow(Z, Q);
|
|
913
|
-
const Q1div2 = (Q + _1n2) / _2n;
|
|
914
|
-
return function tonelliSlow(Fp2, n) {
|
|
915
|
-
if (Fp2.is0(n))
|
|
916
|
-
return n;
|
|
917
|
-
if (FpLegendre(Fp2, n) !== 1)
|
|
918
|
-
throw new Error("Cannot find square root");
|
|
919
|
-
let M = S;
|
|
920
|
-
let c = Fp2.mul(Fp2.ONE, cc);
|
|
921
|
-
let t = Fp2.pow(n, Q);
|
|
922
|
-
let R = Fp2.pow(n, Q1div2);
|
|
923
|
-
while (!Fp2.eql(t, Fp2.ONE)) {
|
|
924
|
-
if (Fp2.is0(t))
|
|
925
|
-
return Fp2.ZERO;
|
|
926
|
-
let i = 1;
|
|
927
|
-
let t_tmp = Fp2.sqr(t);
|
|
928
|
-
while (!Fp2.eql(t_tmp, Fp2.ONE)) {
|
|
929
|
-
i++;
|
|
930
|
-
t_tmp = Fp2.sqr(t_tmp);
|
|
931
|
-
if (i === M)
|
|
932
|
-
throw new Error("Cannot find square root");
|
|
933
|
-
}
|
|
934
|
-
const exponent = _1n2 << BigInt(M - i - 1);
|
|
935
|
-
const b = Fp2.pow(c, exponent);
|
|
936
|
-
M = i;
|
|
937
|
-
c = Fp2.sqr(b);
|
|
938
|
-
t = Fp2.mul(t, c);
|
|
939
|
-
R = Fp2.mul(R, b);
|
|
940
|
-
}
|
|
941
|
-
return R;
|
|
942
|
-
};
|
|
943
|
-
}
|
|
944
|
-
function FpSqrt(P) {
|
|
945
|
-
if (P % _4n === _3n)
|
|
946
|
-
return sqrt3mod4;
|
|
947
|
-
if (P % _8n === _5n)
|
|
948
|
-
return sqrt5mod8;
|
|
949
|
-
if (P % _16n === _9n)
|
|
950
|
-
return sqrt9mod16(P);
|
|
951
|
-
return tonelliShanks(P);
|
|
952
|
-
}
|
|
953
|
-
var isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n2) === _1n2;
|
|
954
|
-
var FIELD_FIELDS = [
|
|
955
|
-
"create",
|
|
956
|
-
"isValid",
|
|
957
|
-
"is0",
|
|
958
|
-
"neg",
|
|
959
|
-
"inv",
|
|
960
|
-
"sqrt",
|
|
961
|
-
"sqr",
|
|
962
|
-
"eql",
|
|
963
|
-
"add",
|
|
964
|
-
"sub",
|
|
965
|
-
"mul",
|
|
966
|
-
"pow",
|
|
967
|
-
"div",
|
|
968
|
-
"addN",
|
|
969
|
-
"subN",
|
|
970
|
-
"mulN",
|
|
971
|
-
"sqrN"
|
|
972
|
-
];
|
|
973
|
-
function validateField(field) {
|
|
974
|
-
const initial = {
|
|
975
|
-
ORDER: "bigint",
|
|
976
|
-
BYTES: "number",
|
|
977
|
-
BITS: "number"
|
|
978
|
-
};
|
|
979
|
-
const opts = FIELD_FIELDS.reduce((map, val) => {
|
|
980
|
-
map[val] = "function";
|
|
981
|
-
return map;
|
|
982
|
-
}, initial);
|
|
983
|
-
validateObject(field, opts);
|
|
984
|
-
return field;
|
|
985
|
-
}
|
|
986
|
-
function FpPow(Fp2, num, power) {
|
|
987
|
-
if (power < _0n2)
|
|
988
|
-
throw new Error("invalid exponent, negatives unsupported");
|
|
989
|
-
if (power === _0n2)
|
|
990
|
-
return Fp2.ONE;
|
|
991
|
-
if (power === _1n2)
|
|
992
|
-
return num;
|
|
993
|
-
let p = Fp2.ONE;
|
|
994
|
-
let d = num;
|
|
995
|
-
while (power > _0n2) {
|
|
996
|
-
if (power & _1n2)
|
|
997
|
-
p = Fp2.mul(p, d);
|
|
998
|
-
d = Fp2.sqr(d);
|
|
999
|
-
power >>= _1n2;
|
|
1000
|
-
}
|
|
1001
|
-
return p;
|
|
1002
|
-
}
|
|
1003
|
-
function FpInvertBatch(Fp2, nums, passZero = false) {
|
|
1004
|
-
const inverted = new Array(nums.length).fill(passZero ? Fp2.ZERO : void 0);
|
|
1005
|
-
const multipliedAcc = nums.reduce((acc, num, i) => {
|
|
1006
|
-
if (Fp2.is0(num))
|
|
1007
|
-
return acc;
|
|
1008
|
-
inverted[i] = acc;
|
|
1009
|
-
return Fp2.mul(acc, num);
|
|
1010
|
-
}, Fp2.ONE);
|
|
1011
|
-
const invertedAcc = Fp2.inv(multipliedAcc);
|
|
1012
|
-
nums.reduceRight((acc, num, i) => {
|
|
1013
|
-
if (Fp2.is0(num))
|
|
1014
|
-
return acc;
|
|
1015
|
-
inverted[i] = Fp2.mul(acc, inverted[i]);
|
|
1016
|
-
return Fp2.mul(acc, num);
|
|
1017
|
-
}, invertedAcc);
|
|
1018
|
-
return inverted;
|
|
1019
|
-
}
|
|
1020
|
-
function FpLegendre(Fp2, n) {
|
|
1021
|
-
const p1mod2 = (Fp2.ORDER - _1n2) / _2n;
|
|
1022
|
-
const powered = Fp2.pow(n, p1mod2);
|
|
1023
|
-
const yes = Fp2.eql(powered, Fp2.ONE);
|
|
1024
|
-
const zero = Fp2.eql(powered, Fp2.ZERO);
|
|
1025
|
-
const no = Fp2.eql(powered, Fp2.neg(Fp2.ONE));
|
|
1026
|
-
if (!yes && !zero && !no)
|
|
1027
|
-
throw new Error("invalid Legendre symbol result");
|
|
1028
|
-
return yes ? 1 : zero ? 0 : -1;
|
|
1029
|
-
}
|
|
1030
|
-
function nLength(n, nBitLength) {
|
|
1031
|
-
if (nBitLength !== void 0)
|
|
1032
|
-
anumber(nBitLength);
|
|
1033
|
-
const _nBitLength = nBitLength !== void 0 ? nBitLength : n.toString(2).length;
|
|
1034
|
-
const nByteLength = Math.ceil(_nBitLength / 8);
|
|
1035
|
-
return { nBitLength: _nBitLength, nByteLength };
|
|
1036
|
-
}
|
|
1037
|
-
var _Field = class {
|
|
1038
|
-
constructor(ORDER, opts = {}) {
|
|
1039
|
-
__publicField(this, "ORDER");
|
|
1040
|
-
__publicField(this, "BITS");
|
|
1041
|
-
__publicField(this, "BYTES");
|
|
1042
|
-
__publicField(this, "isLE");
|
|
1043
|
-
__publicField(this, "ZERO", _0n2);
|
|
1044
|
-
__publicField(this, "ONE", _1n2);
|
|
1045
|
-
__publicField(this, "_lengths");
|
|
1046
|
-
__publicField(this, "_sqrt");
|
|
1047
|
-
// cached sqrt
|
|
1048
|
-
__publicField(this, "_mod");
|
|
1049
|
-
var _a;
|
|
1050
|
-
if (ORDER <= _0n2)
|
|
1051
|
-
throw new Error("invalid field: expected ORDER > 0, got " + ORDER);
|
|
1052
|
-
let _nbitLength = void 0;
|
|
1053
|
-
this.isLE = false;
|
|
1054
|
-
if (opts != null && typeof opts === "object") {
|
|
1055
|
-
if (typeof opts.BITS === "number")
|
|
1056
|
-
_nbitLength = opts.BITS;
|
|
1057
|
-
if (typeof opts.sqrt === "function")
|
|
1058
|
-
this.sqrt = opts.sqrt;
|
|
1059
|
-
if (typeof opts.isLE === "boolean")
|
|
1060
|
-
this.isLE = opts.isLE;
|
|
1061
|
-
if (opts.allowedLengths)
|
|
1062
|
-
this._lengths = (_a = opts.allowedLengths) == null ? void 0 : _a.slice();
|
|
1063
|
-
if (typeof opts.modFromBytes === "boolean")
|
|
1064
|
-
this._mod = opts.modFromBytes;
|
|
1065
|
-
}
|
|
1066
|
-
const { nBitLength, nByteLength } = nLength(ORDER, _nbitLength);
|
|
1067
|
-
if (nByteLength > 2048)
|
|
1068
|
-
throw new Error("invalid field: expected ORDER of <= 2048 bytes");
|
|
1069
|
-
this.ORDER = ORDER;
|
|
1070
|
-
this.BITS = nBitLength;
|
|
1071
|
-
this.BYTES = nByteLength;
|
|
1072
|
-
this._sqrt = void 0;
|
|
1073
|
-
Object.preventExtensions(this);
|
|
1074
|
-
}
|
|
1075
|
-
create(num) {
|
|
1076
|
-
return mod(num, this.ORDER);
|
|
1077
|
-
}
|
|
1078
|
-
isValid(num) {
|
|
1079
|
-
if (typeof num !== "bigint")
|
|
1080
|
-
throw new Error("invalid field element: expected bigint, got " + typeof num);
|
|
1081
|
-
return _0n2 <= num && num < this.ORDER;
|
|
1082
|
-
}
|
|
1083
|
-
is0(num) {
|
|
1084
|
-
return num === _0n2;
|
|
1085
|
-
}
|
|
1086
|
-
// is valid and invertible
|
|
1087
|
-
isValidNot0(num) {
|
|
1088
|
-
return !this.is0(num) && this.isValid(num);
|
|
1089
|
-
}
|
|
1090
|
-
isOdd(num) {
|
|
1091
|
-
return (num & _1n2) === _1n2;
|
|
1092
|
-
}
|
|
1093
|
-
neg(num) {
|
|
1094
|
-
return mod(-num, this.ORDER);
|
|
1095
|
-
}
|
|
1096
|
-
eql(lhs, rhs) {
|
|
1097
|
-
return lhs === rhs;
|
|
1098
|
-
}
|
|
1099
|
-
sqr(num) {
|
|
1100
|
-
return mod(num * num, this.ORDER);
|
|
1101
|
-
}
|
|
1102
|
-
add(lhs, rhs) {
|
|
1103
|
-
return mod(lhs + rhs, this.ORDER);
|
|
1104
|
-
}
|
|
1105
|
-
sub(lhs, rhs) {
|
|
1106
|
-
return mod(lhs - rhs, this.ORDER);
|
|
1107
|
-
}
|
|
1108
|
-
mul(lhs, rhs) {
|
|
1109
|
-
return mod(lhs * rhs, this.ORDER);
|
|
1110
|
-
}
|
|
1111
|
-
pow(num, power) {
|
|
1112
|
-
return FpPow(this, num, power);
|
|
1113
|
-
}
|
|
1114
|
-
div(lhs, rhs) {
|
|
1115
|
-
return mod(lhs * invert(rhs, this.ORDER), this.ORDER);
|
|
1116
|
-
}
|
|
1117
|
-
// Same as above, but doesn't normalize
|
|
1118
|
-
sqrN(num) {
|
|
1119
|
-
return num * num;
|
|
1120
|
-
}
|
|
1121
|
-
addN(lhs, rhs) {
|
|
1122
|
-
return lhs + rhs;
|
|
1123
|
-
}
|
|
1124
|
-
subN(lhs, rhs) {
|
|
1125
|
-
return lhs - rhs;
|
|
1126
|
-
}
|
|
1127
|
-
mulN(lhs, rhs) {
|
|
1128
|
-
return lhs * rhs;
|
|
1129
|
-
}
|
|
1130
|
-
inv(num) {
|
|
1131
|
-
return invert(num, this.ORDER);
|
|
1132
|
-
}
|
|
1133
|
-
sqrt(num) {
|
|
1134
|
-
if (!this._sqrt)
|
|
1135
|
-
this._sqrt = FpSqrt(this.ORDER);
|
|
1136
|
-
return this._sqrt(this, num);
|
|
1137
|
-
}
|
|
1138
|
-
toBytes(num) {
|
|
1139
|
-
return this.isLE ? numberToBytesLE(num, this.BYTES) : numberToBytesBE(num, this.BYTES);
|
|
1140
|
-
}
|
|
1141
|
-
fromBytes(bytes, skipValidation = false) {
|
|
1142
|
-
abytes(bytes);
|
|
1143
|
-
const { _lengths: allowedLengths, BYTES, isLE, ORDER, _mod: modFromBytes } = this;
|
|
1144
|
-
if (allowedLengths) {
|
|
1145
|
-
if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) {
|
|
1146
|
-
throw new Error("Field.fromBytes: expected " + allowedLengths + " bytes, got " + bytes.length);
|
|
1147
|
-
}
|
|
1148
|
-
const padded = new Uint8Array(BYTES);
|
|
1149
|
-
padded.set(bytes, isLE ? 0 : padded.length - bytes.length);
|
|
1150
|
-
bytes = padded;
|
|
1151
|
-
}
|
|
1152
|
-
if (bytes.length !== BYTES)
|
|
1153
|
-
throw new Error("Field.fromBytes: expected " + BYTES + " bytes, got " + bytes.length);
|
|
1154
|
-
let scalar = isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);
|
|
1155
|
-
if (modFromBytes)
|
|
1156
|
-
scalar = mod(scalar, ORDER);
|
|
1157
|
-
if (!skipValidation) {
|
|
1158
|
-
if (!this.isValid(scalar))
|
|
1159
|
-
throw new Error("invalid field element: outside of range 0..ORDER");
|
|
1160
|
-
}
|
|
1161
|
-
return scalar;
|
|
1162
|
-
}
|
|
1163
|
-
// TODO: we don't need it here, move out to separate fn
|
|
1164
|
-
invertBatch(lst) {
|
|
1165
|
-
return FpInvertBatch(this, lst);
|
|
1166
|
-
}
|
|
1167
|
-
// We can't move this out because Fp6, Fp12 implement it
|
|
1168
|
-
// and it's unclear what to return in there.
|
|
1169
|
-
cmov(a, b, condition) {
|
|
1170
|
-
return condition ? b : a;
|
|
1171
|
-
}
|
|
1172
|
-
};
|
|
1173
|
-
function Field(ORDER, opts = {}) {
|
|
1174
|
-
return new _Field(ORDER, opts);
|
|
1175
|
-
}
|
|
1176
|
-
function FpSqrtEven(Fp2, elm) {
|
|
1177
|
-
if (!Fp2.isOdd)
|
|
1178
|
-
throw new Error("Field doesn't have isOdd");
|
|
1179
|
-
const root = Fp2.sqrt(elm);
|
|
1180
|
-
return Fp2.isOdd(root) ? Fp2.neg(root) : root;
|
|
1181
|
-
}
|
|
1182
|
-
function getFieldBytesLength(fieldOrder) {
|
|
1183
|
-
if (typeof fieldOrder !== "bigint")
|
|
1184
|
-
throw new Error("field order must be bigint");
|
|
1185
|
-
const bitLength = fieldOrder.toString(2).length;
|
|
1186
|
-
return Math.ceil(bitLength / 8);
|
|
1187
|
-
}
|
|
1188
|
-
function getMinHashLength(fieldOrder) {
|
|
1189
|
-
const length = getFieldBytesLength(fieldOrder);
|
|
1190
|
-
return length + Math.ceil(length / 2);
|
|
1191
|
-
}
|
|
1192
|
-
function mapHashToField(key, fieldOrder, isLE = false) {
|
|
1193
|
-
abytes(key);
|
|
1194
|
-
const len = key.length;
|
|
1195
|
-
const fieldLen = getFieldBytesLength(fieldOrder);
|
|
1196
|
-
const minLen = getMinHashLength(fieldOrder);
|
|
1197
|
-
if (len < 16 || len < minLen || len > 1024)
|
|
1198
|
-
throw new Error("expected " + minLen + "-1024 bytes of input, got " + len);
|
|
1199
|
-
const num = isLE ? bytesToNumberLE(key) : bytesToNumberBE(key);
|
|
1200
|
-
const reduced = mod(num, fieldOrder - _1n2) + _1n2;
|
|
1201
|
-
return isLE ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen);
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
// node_modules/@noble/curves/abstract/curve.js
|
|
1205
|
-
var _0n3 = BigInt(0);
|
|
1206
|
-
var _1n3 = BigInt(1);
|
|
1207
|
-
function negateCt(condition, item) {
|
|
1208
|
-
const neg = item.negate();
|
|
1209
|
-
return condition ? neg : item;
|
|
1210
|
-
}
|
|
1211
|
-
function normalizeZ(c, points) {
|
|
1212
|
-
const invertedZs = FpInvertBatch(c.Fp, points.map((p) => p.Z));
|
|
1213
|
-
return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i])));
|
|
1214
|
-
}
|
|
1215
|
-
function validateW(W, bits) {
|
|
1216
|
-
if (!Number.isSafeInteger(W) || W <= 0 || W > bits)
|
|
1217
|
-
throw new Error("invalid window size, expected [1.." + bits + "], got W=" + W);
|
|
1218
|
-
}
|
|
1219
|
-
function calcWOpts(W, scalarBits) {
|
|
1220
|
-
validateW(W, scalarBits);
|
|
1221
|
-
const windows = Math.ceil(scalarBits / W) + 1;
|
|
1222
|
-
const windowSize = 2 ** (W - 1);
|
|
1223
|
-
const maxNumber = 2 ** W;
|
|
1224
|
-
const mask = bitMask(W);
|
|
1225
|
-
const shiftBy = BigInt(W);
|
|
1226
|
-
return { windows, windowSize, mask, maxNumber, shiftBy };
|
|
1227
|
-
}
|
|
1228
|
-
function calcOffsets(n, window, wOpts) {
|
|
1229
|
-
const { windowSize, mask, maxNumber, shiftBy } = wOpts;
|
|
1230
|
-
let wbits = Number(n & mask);
|
|
1231
|
-
let nextN = n >> shiftBy;
|
|
1232
|
-
if (wbits > windowSize) {
|
|
1233
|
-
wbits -= maxNumber;
|
|
1234
|
-
nextN += _1n3;
|
|
1235
|
-
}
|
|
1236
|
-
const offsetStart = window * windowSize;
|
|
1237
|
-
const offset = offsetStart + Math.abs(wbits) - 1;
|
|
1238
|
-
const isZero = wbits === 0;
|
|
1239
|
-
const isNeg = wbits < 0;
|
|
1240
|
-
const isNegF = window % 2 !== 0;
|
|
1241
|
-
const offsetF = offsetStart;
|
|
1242
|
-
return { nextN, offset, isZero, isNeg, isNegF, offsetF };
|
|
1243
|
-
}
|
|
1244
|
-
function validateMSMPoints(points, c) {
|
|
1245
|
-
if (!Array.isArray(points))
|
|
1246
|
-
throw new Error("array expected");
|
|
1247
|
-
points.forEach((p, i) => {
|
|
1248
|
-
if (!(p instanceof c))
|
|
1249
|
-
throw new Error("invalid point at index " + i);
|
|
1250
|
-
});
|
|
1251
|
-
}
|
|
1252
|
-
function validateMSMScalars(scalars, field) {
|
|
1253
|
-
if (!Array.isArray(scalars))
|
|
1254
|
-
throw new Error("array of scalars expected");
|
|
1255
|
-
scalars.forEach((s, i) => {
|
|
1256
|
-
if (!field.isValid(s))
|
|
1257
|
-
throw new Error("invalid scalar at index " + i);
|
|
1258
|
-
});
|
|
1259
|
-
}
|
|
1260
|
-
var pointPrecomputes = /* @__PURE__ */ new WeakMap();
|
|
1261
|
-
var pointWindowSizes = /* @__PURE__ */ new WeakMap();
|
|
1262
|
-
function getW(P) {
|
|
1263
|
-
return pointWindowSizes.get(P) || 1;
|
|
1264
|
-
}
|
|
1265
|
-
function assert0(n) {
|
|
1266
|
-
if (n !== _0n3)
|
|
1267
|
-
throw new Error("invalid wNAF");
|
|
1268
|
-
}
|
|
1269
|
-
var wNAF = class {
|
|
1270
|
-
// Parametrized with a given Point class (not individual point)
|
|
1271
|
-
constructor(Point, bits) {
|
|
1272
|
-
__publicField(this, "BASE");
|
|
1273
|
-
__publicField(this, "ZERO");
|
|
1274
|
-
__publicField(this, "Fn");
|
|
1275
|
-
__publicField(this, "bits");
|
|
1276
|
-
this.BASE = Point.BASE;
|
|
1277
|
-
this.ZERO = Point.ZERO;
|
|
1278
|
-
this.Fn = Point.Fn;
|
|
1279
|
-
this.bits = bits;
|
|
1280
|
-
}
|
|
1281
|
-
// non-const time multiplication ladder
|
|
1282
|
-
_unsafeLadder(elm, n, p = this.ZERO) {
|
|
1283
|
-
let d = elm;
|
|
1284
|
-
while (n > _0n3) {
|
|
1285
|
-
if (n & _1n3)
|
|
1286
|
-
p = p.add(d);
|
|
1287
|
-
d = d.double();
|
|
1288
|
-
n >>= _1n3;
|
|
1289
|
-
}
|
|
1290
|
-
return p;
|
|
1291
|
-
}
|
|
1292
|
-
/**
|
|
1293
|
-
* Creates a wNAF precomputation window. Used for caching.
|
|
1294
|
-
* Default window size is set by `utils.precompute()` and is equal to 8.
|
|
1295
|
-
* Number of precomputed points depends on the curve size:
|
|
1296
|
-
* 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:
|
|
1297
|
-
* - 𝑊 is the window size
|
|
1298
|
-
* - 𝑛 is the bitlength of the curve order.
|
|
1299
|
-
* For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.
|
|
1300
|
-
* @param point Point instance
|
|
1301
|
-
* @param W window size
|
|
1302
|
-
* @returns precomputed point tables flattened to a single array
|
|
1303
|
-
*/
|
|
1304
|
-
precomputeWindow(point, W) {
|
|
1305
|
-
const { windows, windowSize } = calcWOpts(W, this.bits);
|
|
1306
|
-
const points = [];
|
|
1307
|
-
let p = point;
|
|
1308
|
-
let base = p;
|
|
1309
|
-
for (let window = 0; window < windows; window++) {
|
|
1310
|
-
base = p;
|
|
1311
|
-
points.push(base);
|
|
1312
|
-
for (let i = 1; i < windowSize; i++) {
|
|
1313
|
-
base = base.add(p);
|
|
1314
|
-
points.push(base);
|
|
1315
|
-
}
|
|
1316
|
-
p = base.double();
|
|
1317
|
-
}
|
|
1318
|
-
return points;
|
|
1319
|
-
}
|
|
1320
|
-
/**
|
|
1321
|
-
* Implements ec multiplication using precomputed tables and w-ary non-adjacent form.
|
|
1322
|
-
* More compact implementation:
|
|
1323
|
-
* https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541
|
|
1324
|
-
* @returns real and fake (for const-time) points
|
|
1325
|
-
*/
|
|
1326
|
-
wNAF(W, precomputes, n) {
|
|
1327
|
-
if (!this.Fn.isValid(n))
|
|
1328
|
-
throw new Error("invalid scalar");
|
|
1329
|
-
let p = this.ZERO;
|
|
1330
|
-
let f = this.BASE;
|
|
1331
|
-
const wo = calcWOpts(W, this.bits);
|
|
1332
|
-
for (let window = 0; window < wo.windows; window++) {
|
|
1333
|
-
const { nextN, offset, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window, wo);
|
|
1334
|
-
n = nextN;
|
|
1335
|
-
if (isZero) {
|
|
1336
|
-
f = f.add(negateCt(isNegF, precomputes[offsetF]));
|
|
1337
|
-
} else {
|
|
1338
|
-
p = p.add(negateCt(isNeg, precomputes[offset]));
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
assert0(n);
|
|
1342
|
-
return { p, f };
|
|
1343
|
-
}
|
|
1344
|
-
/**
|
|
1345
|
-
* Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form.
|
|
1346
|
-
* @param acc accumulator point to add result of multiplication
|
|
1347
|
-
* @returns point
|
|
1348
|
-
*/
|
|
1349
|
-
wNAFUnsafe(W, precomputes, n, acc = this.ZERO) {
|
|
1350
|
-
const wo = calcWOpts(W, this.bits);
|
|
1351
|
-
for (let window = 0; window < wo.windows; window++) {
|
|
1352
|
-
if (n === _0n3)
|
|
1353
|
-
break;
|
|
1354
|
-
const { nextN, offset, isZero, isNeg } = calcOffsets(n, window, wo);
|
|
1355
|
-
n = nextN;
|
|
1356
|
-
if (isZero) {
|
|
1357
|
-
continue;
|
|
1358
|
-
} else {
|
|
1359
|
-
const item = precomputes[offset];
|
|
1360
|
-
acc = acc.add(isNeg ? item.negate() : item);
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
assert0(n);
|
|
1364
|
-
return acc;
|
|
1365
|
-
}
|
|
1366
|
-
getPrecomputes(W, point, transform) {
|
|
1367
|
-
let comp = pointPrecomputes.get(point);
|
|
1368
|
-
if (!comp) {
|
|
1369
|
-
comp = this.precomputeWindow(point, W);
|
|
1370
|
-
if (W !== 1) {
|
|
1371
|
-
if (typeof transform === "function")
|
|
1372
|
-
comp = transform(comp);
|
|
1373
|
-
pointPrecomputes.set(point, comp);
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
return comp;
|
|
1377
|
-
}
|
|
1378
|
-
cached(point, scalar, transform) {
|
|
1379
|
-
const W = getW(point);
|
|
1380
|
-
return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar);
|
|
1381
|
-
}
|
|
1382
|
-
unsafe(point, scalar, transform, prev) {
|
|
1383
|
-
const W = getW(point);
|
|
1384
|
-
if (W === 1)
|
|
1385
|
-
return this._unsafeLadder(point, scalar, prev);
|
|
1386
|
-
return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev);
|
|
1387
|
-
}
|
|
1388
|
-
// We calculate precomputes for elliptic curve point multiplication
|
|
1389
|
-
// using windowed method. This specifies window size and
|
|
1390
|
-
// stores precomputed values. Usually only base point would be precomputed.
|
|
1391
|
-
createCache(P, W) {
|
|
1392
|
-
validateW(W, this.bits);
|
|
1393
|
-
pointWindowSizes.set(P, W);
|
|
1394
|
-
pointPrecomputes.delete(P);
|
|
1395
|
-
}
|
|
1396
|
-
hasCache(elm) {
|
|
1397
|
-
return getW(elm) !== 1;
|
|
1398
|
-
}
|
|
1399
|
-
};
|
|
1400
|
-
function pippenger(c, points, scalars) {
|
|
1401
|
-
const fieldN = c.Fn;
|
|
1402
|
-
validateMSMPoints(points, c);
|
|
1403
|
-
validateMSMScalars(scalars, fieldN);
|
|
1404
|
-
const plength = points.length;
|
|
1405
|
-
const slength = scalars.length;
|
|
1406
|
-
if (plength !== slength)
|
|
1407
|
-
throw new Error("arrays of points and scalars must have equal length");
|
|
1408
|
-
const zero = c.ZERO;
|
|
1409
|
-
const wbits = bitLen(BigInt(plength));
|
|
1410
|
-
let windowSize = 1;
|
|
1411
|
-
if (wbits > 12)
|
|
1412
|
-
windowSize = wbits - 3;
|
|
1413
|
-
else if (wbits > 4)
|
|
1414
|
-
windowSize = wbits - 2;
|
|
1415
|
-
else if (wbits > 0)
|
|
1416
|
-
windowSize = 2;
|
|
1417
|
-
const MASK = bitMask(windowSize);
|
|
1418
|
-
const buckets = new Array(Number(MASK) + 1).fill(zero);
|
|
1419
|
-
const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize;
|
|
1420
|
-
let sum = zero;
|
|
1421
|
-
for (let i = lastBits; i >= 0; i -= windowSize) {
|
|
1422
|
-
buckets.fill(zero);
|
|
1423
|
-
for (let j = 0; j < slength; j++) {
|
|
1424
|
-
const scalar = scalars[j];
|
|
1425
|
-
const wbits2 = Number(scalar >> BigInt(i) & MASK);
|
|
1426
|
-
buckets[wbits2] = buckets[wbits2].add(points[j]);
|
|
1427
|
-
}
|
|
1428
|
-
let resI = zero;
|
|
1429
|
-
for (let j = buckets.length - 1, sumI = zero; j > 0; j--) {
|
|
1430
|
-
sumI = sumI.add(buckets[j]);
|
|
1431
|
-
resI = resI.add(sumI);
|
|
1432
|
-
}
|
|
1433
|
-
sum = sum.add(resI);
|
|
1434
|
-
if (i !== 0)
|
|
1435
|
-
for (let j = 0; j < windowSize; j++)
|
|
1436
|
-
sum = sum.double();
|
|
1437
|
-
}
|
|
1438
|
-
return sum;
|
|
1439
|
-
}
|
|
1440
|
-
function createField(order, field, isLE) {
|
|
1441
|
-
if (field) {
|
|
1442
|
-
if (field.ORDER !== order)
|
|
1443
|
-
throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
|
|
1444
|
-
validateField(field);
|
|
1445
|
-
return field;
|
|
1446
|
-
} else {
|
|
1447
|
-
return Field(order, { isLE });
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
function createCurveFields(type, CURVE, curveOpts = {}, FpFnLE) {
|
|
1451
|
-
if (FpFnLE === void 0)
|
|
1452
|
-
FpFnLE = type === "edwards";
|
|
1453
|
-
if (!CURVE || typeof CURVE !== "object")
|
|
1454
|
-
throw new Error(`expected valid ${type} CURVE object`);
|
|
1455
|
-
for (const p of ["p", "n", "h"]) {
|
|
1456
|
-
const val = CURVE[p];
|
|
1457
|
-
if (!(typeof val === "bigint" && val > _0n3))
|
|
1458
|
-
throw new Error(`CURVE.${p} must be positive bigint`);
|
|
1459
|
-
}
|
|
1460
|
-
const Fp2 = createField(CURVE.p, curveOpts.Fp, FpFnLE);
|
|
1461
|
-
const Fn2 = createField(CURVE.n, curveOpts.Fn, FpFnLE);
|
|
1462
|
-
const _b = type === "weierstrass" ? "b" : "d";
|
|
1463
|
-
const params = ["Gx", "Gy", "a", _b];
|
|
1464
|
-
for (const p of params) {
|
|
1465
|
-
if (!Fp2.isValid(CURVE[p]))
|
|
1466
|
-
throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`);
|
|
1467
|
-
}
|
|
1468
|
-
CURVE = Object.freeze(Object.assign({}, CURVE));
|
|
1469
|
-
return { CURVE, Fp: Fp2, Fn: Fn2 };
|
|
1470
|
-
}
|
|
1471
|
-
function createKeygen(randomSecretKey, getPublicKey) {
|
|
1472
|
-
return function keygen(seed) {
|
|
1473
|
-
const secretKey = randomSecretKey(seed);
|
|
1474
|
-
return { secretKey, publicKey: getPublicKey(secretKey) };
|
|
1475
|
-
};
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
// node_modules/@noble/curves/abstract/edwards.js
|
|
1479
|
-
var _0n4 = BigInt(0);
|
|
1480
|
-
var _1n4 = BigInt(1);
|
|
1481
|
-
var _2n2 = BigInt(2);
|
|
1482
|
-
var _8n2 = BigInt(8);
|
|
1483
|
-
function isEdValidXY(Fp2, CURVE, x, y) {
|
|
1484
|
-
const x2 = Fp2.sqr(x);
|
|
1485
|
-
const y2 = Fp2.sqr(y);
|
|
1486
|
-
const left = Fp2.add(Fp2.mul(CURVE.a, x2), y2);
|
|
1487
|
-
const right = Fp2.add(Fp2.ONE, Fp2.mul(CURVE.d, Fp2.mul(x2, y2)));
|
|
1488
|
-
return Fp2.eql(left, right);
|
|
1489
|
-
}
|
|
1490
|
-
function edwards(params, extraOpts = {}) {
|
|
1491
|
-
const validated = createCurveFields("edwards", params, extraOpts, extraOpts.FpFnLE);
|
|
1492
|
-
const { Fp: Fp2, Fn: Fn2 } = validated;
|
|
1493
|
-
let CURVE = validated.CURVE;
|
|
1494
|
-
const { h: cofactor } = CURVE;
|
|
1495
|
-
validateObject(extraOpts, {}, { uvRatio: "function" });
|
|
1496
|
-
const MASK = _2n2 << BigInt(Fn2.BYTES * 8) - _1n4;
|
|
1497
|
-
const modP = (n) => Fp2.create(n);
|
|
1498
|
-
const uvRatio2 = extraOpts.uvRatio || ((u, v) => {
|
|
1499
|
-
try {
|
|
1500
|
-
return { isValid: true, value: Fp2.sqrt(Fp2.div(u, v)) };
|
|
1501
|
-
} catch (e) {
|
|
1502
|
-
return { isValid: false, value: _0n4 };
|
|
1503
|
-
}
|
|
1504
|
-
});
|
|
1505
|
-
if (!isEdValidXY(Fp2, CURVE, CURVE.Gx, CURVE.Gy))
|
|
1506
|
-
throw new Error("bad curve params: generator point");
|
|
1507
|
-
function acoord(title, n, banZero = false) {
|
|
1508
|
-
const min = banZero ? _1n4 : _0n4;
|
|
1509
|
-
aInRange("coordinate " + title, n, min, MASK);
|
|
1510
|
-
return n;
|
|
1511
|
-
}
|
|
1512
|
-
function aedpoint(other) {
|
|
1513
|
-
if (!(other instanceof Point))
|
|
1514
|
-
throw new Error("EdwardsPoint expected");
|
|
1515
|
-
}
|
|
1516
|
-
const toAffineMemo = memoized((p, iz) => {
|
|
1517
|
-
const { X, Y, Z } = p;
|
|
1518
|
-
const is0 = p.is0();
|
|
1519
|
-
if (iz == null)
|
|
1520
|
-
iz = is0 ? _8n2 : Fp2.inv(Z);
|
|
1521
|
-
const x = modP(X * iz);
|
|
1522
|
-
const y = modP(Y * iz);
|
|
1523
|
-
const zz = Fp2.mul(Z, iz);
|
|
1524
|
-
if (is0)
|
|
1525
|
-
return { x: _0n4, y: _1n4 };
|
|
1526
|
-
if (zz !== _1n4)
|
|
1527
|
-
throw new Error("invZ was invalid");
|
|
1528
|
-
return { x, y };
|
|
1529
|
-
});
|
|
1530
|
-
const assertValidMemo = memoized((p) => {
|
|
1531
|
-
const { a, d } = CURVE;
|
|
1532
|
-
if (p.is0())
|
|
1533
|
-
throw new Error("bad point: ZERO");
|
|
1534
|
-
const { X, Y, Z, T } = p;
|
|
1535
|
-
const X2 = modP(X * X);
|
|
1536
|
-
const Y2 = modP(Y * Y);
|
|
1537
|
-
const Z2 = modP(Z * Z);
|
|
1538
|
-
const Z4 = modP(Z2 * Z2);
|
|
1539
|
-
const aX2 = modP(X2 * a);
|
|
1540
|
-
const left = modP(Z2 * modP(aX2 + Y2));
|
|
1541
|
-
const right = modP(Z4 + modP(d * modP(X2 * Y2)));
|
|
1542
|
-
if (left !== right)
|
|
1543
|
-
throw new Error("bad point: equation left != right (1)");
|
|
1544
|
-
const XY = modP(X * Y);
|
|
1545
|
-
const ZT = modP(Z * T);
|
|
1546
|
-
if (XY !== ZT)
|
|
1547
|
-
throw new Error("bad point: equation left != right (2)");
|
|
1548
|
-
return true;
|
|
1549
|
-
});
|
|
1550
|
-
const _Point = class _Point {
|
|
1551
|
-
constructor(X, Y, Z, T) {
|
|
1552
|
-
__publicField(this, "X");
|
|
1553
|
-
__publicField(this, "Y");
|
|
1554
|
-
__publicField(this, "Z");
|
|
1555
|
-
__publicField(this, "T");
|
|
1556
|
-
this.X = acoord("x", X);
|
|
1557
|
-
this.Y = acoord("y", Y);
|
|
1558
|
-
this.Z = acoord("z", Z, true);
|
|
1559
|
-
this.T = acoord("t", T);
|
|
1560
|
-
Object.freeze(this);
|
|
1561
|
-
}
|
|
1562
|
-
static CURVE() {
|
|
1563
|
-
return CURVE;
|
|
1564
|
-
}
|
|
1565
|
-
static fromAffine(p) {
|
|
1566
|
-
if (p instanceof _Point)
|
|
1567
|
-
throw new Error("extended point not allowed");
|
|
1568
|
-
const { x, y } = p || {};
|
|
1569
|
-
acoord("x", x);
|
|
1570
|
-
acoord("y", y);
|
|
1571
|
-
return new _Point(x, y, _1n4, modP(x * y));
|
|
1572
|
-
}
|
|
1573
|
-
// Uses algo from RFC8032 5.1.3.
|
|
1574
|
-
static fromBytes(bytes, zip215 = false) {
|
|
1575
|
-
const len = Fp2.BYTES;
|
|
1576
|
-
const { a, d } = CURVE;
|
|
1577
|
-
bytes = copyBytes(abytes(bytes, len, "point"));
|
|
1578
|
-
abool(zip215, "zip215");
|
|
1579
|
-
const normed = copyBytes(bytes);
|
|
1580
|
-
const lastByte = bytes[len - 1];
|
|
1581
|
-
normed[len - 1] = lastByte & ~128;
|
|
1582
|
-
const y = bytesToNumberLE(normed);
|
|
1583
|
-
const max = zip215 ? MASK : Fp2.ORDER;
|
|
1584
|
-
aInRange("point.y", y, _0n4, max);
|
|
1585
|
-
const y2 = modP(y * y);
|
|
1586
|
-
const u = modP(y2 - _1n4);
|
|
1587
|
-
const v = modP(d * y2 - a);
|
|
1588
|
-
let { isValid, value: x } = uvRatio2(u, v);
|
|
1589
|
-
if (!isValid)
|
|
1590
|
-
throw new Error("bad point: invalid y coordinate");
|
|
1591
|
-
const isXOdd = (x & _1n4) === _1n4;
|
|
1592
|
-
const isLastByteOdd = (lastByte & 128) !== 0;
|
|
1593
|
-
if (!zip215 && x === _0n4 && isLastByteOdd)
|
|
1594
|
-
throw new Error("bad point: x=0 and x_0=1");
|
|
1595
|
-
if (isLastByteOdd !== isXOdd)
|
|
1596
|
-
x = modP(-x);
|
|
1597
|
-
return _Point.fromAffine({ x, y });
|
|
1598
|
-
}
|
|
1599
|
-
static fromHex(hex, zip215 = false) {
|
|
1600
|
-
return _Point.fromBytes(hexToBytes(hex), zip215);
|
|
1601
|
-
}
|
|
1602
|
-
get x() {
|
|
1603
|
-
return this.toAffine().x;
|
|
1604
|
-
}
|
|
1605
|
-
get y() {
|
|
1606
|
-
return this.toAffine().y;
|
|
1607
|
-
}
|
|
1608
|
-
precompute(windowSize = 8, isLazy = true) {
|
|
1609
|
-
wnaf.createCache(this, windowSize);
|
|
1610
|
-
if (!isLazy)
|
|
1611
|
-
this.multiply(_2n2);
|
|
1612
|
-
return this;
|
|
1613
|
-
}
|
|
1614
|
-
// Useful in fromAffine() - not for fromBytes(), which always created valid points.
|
|
1615
|
-
assertValidity() {
|
|
1616
|
-
assertValidMemo(this);
|
|
1617
|
-
}
|
|
1618
|
-
// Compare one point to another.
|
|
1619
|
-
equals(other) {
|
|
1620
|
-
aedpoint(other);
|
|
1621
|
-
const { X: X1, Y: Y1, Z: Z1 } = this;
|
|
1622
|
-
const { X: X2, Y: Y2, Z: Z2 } = other;
|
|
1623
|
-
const X1Z2 = modP(X1 * Z2);
|
|
1624
|
-
const X2Z1 = modP(X2 * Z1);
|
|
1625
|
-
const Y1Z2 = modP(Y1 * Z2);
|
|
1626
|
-
const Y2Z1 = modP(Y2 * Z1);
|
|
1627
|
-
return X1Z2 === X2Z1 && Y1Z2 === Y2Z1;
|
|
1628
|
-
}
|
|
1629
|
-
is0() {
|
|
1630
|
-
return this.equals(_Point.ZERO);
|
|
1631
|
-
}
|
|
1632
|
-
negate() {
|
|
1633
|
-
return new _Point(modP(-this.X), this.Y, this.Z, modP(-this.T));
|
|
1634
|
-
}
|
|
1635
|
-
// Fast algo for doubling Extended Point.
|
|
1636
|
-
// https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd
|
|
1637
|
-
// Cost: 4M + 4S + 1*a + 6add + 1*2.
|
|
1638
|
-
double() {
|
|
1639
|
-
const { a } = CURVE;
|
|
1640
|
-
const { X: X1, Y: Y1, Z: Z1 } = this;
|
|
1641
|
-
const A = modP(X1 * X1);
|
|
1642
|
-
const B = modP(Y1 * Y1);
|
|
1643
|
-
const C = modP(_2n2 * modP(Z1 * Z1));
|
|
1644
|
-
const D = modP(a * A);
|
|
1645
|
-
const x1y1 = X1 + Y1;
|
|
1646
|
-
const E = modP(modP(x1y1 * x1y1) - A - B);
|
|
1647
|
-
const G = D + B;
|
|
1648
|
-
const F = G - C;
|
|
1649
|
-
const H = D - B;
|
|
1650
|
-
const X3 = modP(E * F);
|
|
1651
|
-
const Y3 = modP(G * H);
|
|
1652
|
-
const T3 = modP(E * H);
|
|
1653
|
-
const Z3 = modP(F * G);
|
|
1654
|
-
return new _Point(X3, Y3, Z3, T3);
|
|
1655
|
-
}
|
|
1656
|
-
// Fast algo for adding 2 Extended Points.
|
|
1657
|
-
// https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd
|
|
1658
|
-
// Cost: 9M + 1*a + 1*d + 7add.
|
|
1659
|
-
add(other) {
|
|
1660
|
-
aedpoint(other);
|
|
1661
|
-
const { a, d } = CURVE;
|
|
1662
|
-
const { X: X1, Y: Y1, Z: Z1, T: T1 } = this;
|
|
1663
|
-
const { X: X2, Y: Y2, Z: Z2, T: T2 } = other;
|
|
1664
|
-
const A = modP(X1 * X2);
|
|
1665
|
-
const B = modP(Y1 * Y2);
|
|
1666
|
-
const C = modP(T1 * d * T2);
|
|
1667
|
-
const D = modP(Z1 * Z2);
|
|
1668
|
-
const E = modP((X1 + Y1) * (X2 + Y2) - A - B);
|
|
1669
|
-
const F = D - C;
|
|
1670
|
-
const G = D + C;
|
|
1671
|
-
const H = modP(B - a * A);
|
|
1672
|
-
const X3 = modP(E * F);
|
|
1673
|
-
const Y3 = modP(G * H);
|
|
1674
|
-
const T3 = modP(E * H);
|
|
1675
|
-
const Z3 = modP(F * G);
|
|
1676
|
-
return new _Point(X3, Y3, Z3, T3);
|
|
1677
|
-
}
|
|
1678
|
-
subtract(other) {
|
|
1679
|
-
return this.add(other.negate());
|
|
1680
|
-
}
|
|
1681
|
-
// Constant-time multiplication.
|
|
1682
|
-
multiply(scalar) {
|
|
1683
|
-
if (!Fn2.isValidNot0(scalar))
|
|
1684
|
-
throw new Error("invalid scalar: expected 1 <= sc < curve.n");
|
|
1685
|
-
const { p, f } = wnaf.cached(this, scalar, (p2) => normalizeZ(_Point, p2));
|
|
1686
|
-
return normalizeZ(_Point, [p, f])[0];
|
|
1687
|
-
}
|
|
1688
|
-
// Non-constant-time multiplication. Uses double-and-add algorithm.
|
|
1689
|
-
// It's faster, but should only be used when you don't care about
|
|
1690
|
-
// an exposed private key e.g. sig verification.
|
|
1691
|
-
// Does NOT allow scalars higher than CURVE.n.
|
|
1692
|
-
// Accepts optional accumulator to merge with multiply (important for sparse scalars)
|
|
1693
|
-
multiplyUnsafe(scalar, acc = _Point.ZERO) {
|
|
1694
|
-
if (!Fn2.isValid(scalar))
|
|
1695
|
-
throw new Error("invalid scalar: expected 0 <= sc < curve.n");
|
|
1696
|
-
if (scalar === _0n4)
|
|
1697
|
-
return _Point.ZERO;
|
|
1698
|
-
if (this.is0() || scalar === _1n4)
|
|
1699
|
-
return this;
|
|
1700
|
-
return wnaf.unsafe(this, scalar, (p) => normalizeZ(_Point, p), acc);
|
|
1701
|
-
}
|
|
1702
|
-
// Checks if point is of small order.
|
|
1703
|
-
// If you add something to small order point, you will have "dirty"
|
|
1704
|
-
// point with torsion component.
|
|
1705
|
-
// Multiplies point by cofactor and checks if the result is 0.
|
|
1706
|
-
isSmallOrder() {
|
|
1707
|
-
return this.multiplyUnsafe(cofactor).is0();
|
|
1708
|
-
}
|
|
1709
|
-
// Multiplies point by curve order and checks if the result is 0.
|
|
1710
|
-
// Returns `false` is the point is dirty.
|
|
1711
|
-
isTorsionFree() {
|
|
1712
|
-
return wnaf.unsafe(this, CURVE.n).is0();
|
|
1713
|
-
}
|
|
1714
|
-
// Converts Extended point to default (x, y) coordinates.
|
|
1715
|
-
// Can accept precomputed Z^-1 - for example, from invertBatch.
|
|
1716
|
-
toAffine(invertedZ) {
|
|
1717
|
-
return toAffineMemo(this, invertedZ);
|
|
1718
|
-
}
|
|
1719
|
-
clearCofactor() {
|
|
1720
|
-
if (cofactor === _1n4)
|
|
1721
|
-
return this;
|
|
1722
|
-
return this.multiplyUnsafe(cofactor);
|
|
1723
|
-
}
|
|
1724
|
-
toBytes() {
|
|
1725
|
-
const { x, y } = this.toAffine();
|
|
1726
|
-
const bytes = Fp2.toBytes(y);
|
|
1727
|
-
bytes[bytes.length - 1] |= x & _1n4 ? 128 : 0;
|
|
1728
|
-
return bytes;
|
|
1729
|
-
}
|
|
1730
|
-
toHex() {
|
|
1731
|
-
return bytesToHex(this.toBytes());
|
|
1732
|
-
}
|
|
1733
|
-
toString() {
|
|
1734
|
-
return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
|
|
1735
|
-
}
|
|
1736
|
-
};
|
|
1737
|
-
// base / generator point
|
|
1738
|
-
__publicField(_Point, "BASE", new _Point(CURVE.Gx, CURVE.Gy, _1n4, modP(CURVE.Gx * CURVE.Gy)));
|
|
1739
|
-
// zero / infinity / identity point
|
|
1740
|
-
__publicField(_Point, "ZERO", new _Point(_0n4, _1n4, _1n4, _0n4));
|
|
1741
|
-
// 0, 1, 1, 0
|
|
1742
|
-
// math field
|
|
1743
|
-
__publicField(_Point, "Fp", Fp2);
|
|
1744
|
-
// scalar field
|
|
1745
|
-
__publicField(_Point, "Fn", Fn2);
|
|
1746
|
-
let Point = _Point;
|
|
1747
|
-
const wnaf = new wNAF(Point, Fn2.BITS);
|
|
1748
|
-
Point.BASE.precompute(8);
|
|
1749
|
-
return Point;
|
|
1750
|
-
}
|
|
1751
|
-
var PrimeEdwardsPoint = class {
|
|
1752
|
-
constructor(ep) {
|
|
1753
|
-
__publicField(this, "ep");
|
|
1754
|
-
this.ep = ep;
|
|
1755
|
-
}
|
|
1756
|
-
// Static methods that must be implemented by subclasses
|
|
1757
|
-
static fromBytes(_bytes) {
|
|
1758
|
-
notImplemented();
|
|
1759
|
-
}
|
|
1760
|
-
static fromHex(_hex) {
|
|
1761
|
-
notImplemented();
|
|
1762
|
-
}
|
|
1763
|
-
get x() {
|
|
1764
|
-
return this.toAffine().x;
|
|
1765
|
-
}
|
|
1766
|
-
get y() {
|
|
1767
|
-
return this.toAffine().y;
|
|
1768
|
-
}
|
|
1769
|
-
// Common implementations
|
|
1770
|
-
clearCofactor() {
|
|
1771
|
-
return this;
|
|
1772
|
-
}
|
|
1773
|
-
assertValidity() {
|
|
1774
|
-
this.ep.assertValidity();
|
|
1775
|
-
}
|
|
1776
|
-
toAffine(invertedZ) {
|
|
1777
|
-
return this.ep.toAffine(invertedZ);
|
|
1778
|
-
}
|
|
1779
|
-
toHex() {
|
|
1780
|
-
return bytesToHex(this.toBytes());
|
|
1781
|
-
}
|
|
1782
|
-
toString() {
|
|
1783
|
-
return this.toHex();
|
|
1784
|
-
}
|
|
1785
|
-
isTorsionFree() {
|
|
1786
|
-
return true;
|
|
1787
|
-
}
|
|
1788
|
-
isSmallOrder() {
|
|
1789
|
-
return false;
|
|
1790
|
-
}
|
|
1791
|
-
add(other) {
|
|
1792
|
-
this.assertSame(other);
|
|
1793
|
-
return this.init(this.ep.add(other.ep));
|
|
1794
|
-
}
|
|
1795
|
-
subtract(other) {
|
|
1796
|
-
this.assertSame(other);
|
|
1797
|
-
return this.init(this.ep.subtract(other.ep));
|
|
1798
|
-
}
|
|
1799
|
-
multiply(scalar) {
|
|
1800
|
-
return this.init(this.ep.multiply(scalar));
|
|
1801
|
-
}
|
|
1802
|
-
multiplyUnsafe(scalar) {
|
|
1803
|
-
return this.init(this.ep.multiplyUnsafe(scalar));
|
|
1804
|
-
}
|
|
1805
|
-
double() {
|
|
1806
|
-
return this.init(this.ep.double());
|
|
1807
|
-
}
|
|
1808
|
-
negate() {
|
|
1809
|
-
return this.init(this.ep.negate());
|
|
1810
|
-
}
|
|
1811
|
-
precompute(windowSize, isLazy) {
|
|
1812
|
-
return this.init(this.ep.precompute(windowSize, isLazy));
|
|
1813
|
-
}
|
|
1814
|
-
};
|
|
1815
|
-
__publicField(PrimeEdwardsPoint, "BASE");
|
|
1816
|
-
__publicField(PrimeEdwardsPoint, "ZERO");
|
|
1817
|
-
__publicField(PrimeEdwardsPoint, "Fp");
|
|
1818
|
-
__publicField(PrimeEdwardsPoint, "Fn");
|
|
1819
|
-
function eddsa(Point, cHash, eddsaOpts = {}) {
|
|
1820
|
-
if (typeof cHash !== "function")
|
|
1821
|
-
throw new Error('"hash" function param is required');
|
|
1822
|
-
validateObject(eddsaOpts, {}, {
|
|
1823
|
-
adjustScalarBytes: "function",
|
|
1824
|
-
randomBytes: "function",
|
|
1825
|
-
domain: "function",
|
|
1826
|
-
prehash: "function",
|
|
1827
|
-
mapToCurve: "function"
|
|
1828
|
-
});
|
|
1829
|
-
const { prehash } = eddsaOpts;
|
|
1830
|
-
const { BASE, Fp: Fp2, Fn: Fn2 } = Point;
|
|
1831
|
-
const randomBytes2 = eddsaOpts.randomBytes || randomBytes;
|
|
1832
|
-
const adjustScalarBytes2 = eddsaOpts.adjustScalarBytes || ((bytes) => bytes);
|
|
1833
|
-
const domain = eddsaOpts.domain || ((data, ctx, phflag) => {
|
|
1834
|
-
abool(phflag, "phflag");
|
|
1835
|
-
if (ctx.length || phflag)
|
|
1836
|
-
throw new Error("Contexts/pre-hash are not supported");
|
|
1837
|
-
return data;
|
|
1838
|
-
});
|
|
1839
|
-
function modN_LE(hash) {
|
|
1840
|
-
return Fn2.create(bytesToNumberLE(hash));
|
|
1841
|
-
}
|
|
1842
|
-
function getPrivateScalar(key) {
|
|
1843
|
-
const len = lengths.secretKey;
|
|
1844
|
-
abytes(key, lengths.secretKey, "secretKey");
|
|
1845
|
-
const hashed = abytes(cHash(key), 2 * len, "hashedSecretKey");
|
|
1846
|
-
const head = adjustScalarBytes2(hashed.slice(0, len));
|
|
1847
|
-
const prefix = hashed.slice(len, 2 * len);
|
|
1848
|
-
const scalar = modN_LE(head);
|
|
1849
|
-
return { head, prefix, scalar };
|
|
1850
|
-
}
|
|
1851
|
-
function getExtendedPublicKey(secretKey) {
|
|
1852
|
-
const { head, prefix, scalar } = getPrivateScalar(secretKey);
|
|
1853
|
-
const point = BASE.multiply(scalar);
|
|
1854
|
-
const pointBytes = point.toBytes();
|
|
1855
|
-
return { head, prefix, scalar, point, pointBytes };
|
|
1856
|
-
}
|
|
1857
|
-
function getPublicKey(secretKey) {
|
|
1858
|
-
return getExtendedPublicKey(secretKey).pointBytes;
|
|
1859
|
-
}
|
|
1860
|
-
function hashDomainToScalar(context = Uint8Array.of(), ...msgs) {
|
|
1861
|
-
const msg = concatBytes(...msgs);
|
|
1862
|
-
return modN_LE(cHash(domain(msg, abytes(context, void 0, "context"), !!prehash)));
|
|
1863
|
-
}
|
|
1864
|
-
function sign(msg, secretKey, options = {}) {
|
|
1865
|
-
msg = abytes(msg, void 0, "message");
|
|
1866
|
-
if (prehash)
|
|
1867
|
-
msg = prehash(msg);
|
|
1868
|
-
const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey);
|
|
1869
|
-
const r = hashDomainToScalar(options.context, prefix, msg);
|
|
1870
|
-
const R = BASE.multiply(r).toBytes();
|
|
1871
|
-
const k = hashDomainToScalar(options.context, R, pointBytes, msg);
|
|
1872
|
-
const s = Fn2.create(r + k * scalar);
|
|
1873
|
-
if (!Fn2.isValid(s))
|
|
1874
|
-
throw new Error("sign failed: invalid s");
|
|
1875
|
-
const rs = concatBytes(R, Fn2.toBytes(s));
|
|
1876
|
-
return abytes(rs, lengths.signature, "result");
|
|
1877
|
-
}
|
|
1878
|
-
const verifyOpts = { zip215: true };
|
|
1879
|
-
function verify(sig, msg, publicKey, options = verifyOpts) {
|
|
1880
|
-
const { context, zip215 } = options;
|
|
1881
|
-
const len = lengths.signature;
|
|
1882
|
-
sig = abytes(sig, len, "signature");
|
|
1883
|
-
msg = abytes(msg, void 0, "message");
|
|
1884
|
-
publicKey = abytes(publicKey, lengths.publicKey, "publicKey");
|
|
1885
|
-
if (zip215 !== void 0)
|
|
1886
|
-
abool(zip215, "zip215");
|
|
1887
|
-
if (prehash)
|
|
1888
|
-
msg = prehash(msg);
|
|
1889
|
-
const mid = len / 2;
|
|
1890
|
-
const r = sig.subarray(0, mid);
|
|
1891
|
-
const s = bytesToNumberLE(sig.subarray(mid, len));
|
|
1892
|
-
let A, R, SB;
|
|
1893
|
-
try {
|
|
1894
|
-
A = Point.fromBytes(publicKey, zip215);
|
|
1895
|
-
R = Point.fromBytes(r, zip215);
|
|
1896
|
-
SB = BASE.multiplyUnsafe(s);
|
|
1897
|
-
} catch (error) {
|
|
1898
|
-
return false;
|
|
1899
|
-
}
|
|
1900
|
-
if (!zip215 && A.isSmallOrder())
|
|
1901
|
-
return false;
|
|
1902
|
-
const k = hashDomainToScalar(context, R.toBytes(), A.toBytes(), msg);
|
|
1903
|
-
const RkA = R.add(A.multiplyUnsafe(k));
|
|
1904
|
-
return RkA.subtract(SB).clearCofactor().is0();
|
|
1905
|
-
}
|
|
1906
|
-
const _size = Fp2.BYTES;
|
|
1907
|
-
const lengths = {
|
|
1908
|
-
secretKey: _size,
|
|
1909
|
-
publicKey: _size,
|
|
1910
|
-
signature: 2 * _size,
|
|
1911
|
-
seed: _size
|
|
1912
|
-
};
|
|
1913
|
-
function randomSecretKey(seed = randomBytes2(lengths.seed)) {
|
|
1914
|
-
return abytes(seed, lengths.seed, "seed");
|
|
1915
|
-
}
|
|
1916
|
-
function isValidSecretKey(key) {
|
|
1917
|
-
return isBytes(key) && key.length === Fn2.BYTES;
|
|
1918
|
-
}
|
|
1919
|
-
function isValidPublicKey(key, zip215) {
|
|
1920
|
-
try {
|
|
1921
|
-
return !!Point.fromBytes(key, zip215);
|
|
1922
|
-
} catch (error) {
|
|
1923
|
-
return false;
|
|
1924
|
-
}
|
|
1925
|
-
}
|
|
1926
|
-
const utils = {
|
|
1927
|
-
getExtendedPublicKey,
|
|
1928
|
-
randomSecretKey,
|
|
1929
|
-
isValidSecretKey,
|
|
1930
|
-
isValidPublicKey,
|
|
1931
|
-
/**
|
|
1932
|
-
* Converts ed public key to x public key. Uses formula:
|
|
1933
|
-
* - ed25519:
|
|
1934
|
-
* - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)`
|
|
1935
|
-
* - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))`
|
|
1936
|
-
* - ed448:
|
|
1937
|
-
* - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)`
|
|
1938
|
-
* - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))`
|
|
1939
|
-
*/
|
|
1940
|
-
toMontgomery(publicKey) {
|
|
1941
|
-
const { y } = Point.fromBytes(publicKey);
|
|
1942
|
-
const size = lengths.publicKey;
|
|
1943
|
-
const is25519 = size === 32;
|
|
1944
|
-
if (!is25519 && size !== 57)
|
|
1945
|
-
throw new Error("only defined for 25519 and 448");
|
|
1946
|
-
const u = is25519 ? Fp2.div(_1n4 + y, _1n4 - y) : Fp2.div(y - _1n4, y + _1n4);
|
|
1947
|
-
return Fp2.toBytes(u);
|
|
1948
|
-
},
|
|
1949
|
-
toMontgomerySecret(secretKey) {
|
|
1950
|
-
const size = lengths.secretKey;
|
|
1951
|
-
abytes(secretKey, size);
|
|
1952
|
-
const hashed = cHash(secretKey.subarray(0, size));
|
|
1953
|
-
return adjustScalarBytes2(hashed).subarray(0, size);
|
|
1954
|
-
}
|
|
1955
|
-
};
|
|
1956
|
-
return Object.freeze({
|
|
1957
|
-
keygen: createKeygen(randomSecretKey, getPublicKey),
|
|
1958
|
-
getPublicKey,
|
|
1959
|
-
sign,
|
|
1960
|
-
verify,
|
|
1961
|
-
utils,
|
|
1962
|
-
Point,
|
|
1963
|
-
lengths
|
|
1964
|
-
});
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
// node_modules/@noble/curves/abstract/hash-to-curve.js
|
|
1968
|
-
var os2ip = bytesToNumberBE;
|
|
1969
|
-
function i2osp(value, length) {
|
|
1970
|
-
asafenumber(value);
|
|
1971
|
-
asafenumber(length);
|
|
1972
|
-
if (value < 0 || value >= 1 << 8 * length)
|
|
1973
|
-
throw new Error("invalid I2OSP input: " + value);
|
|
1974
|
-
const res = Array.from({ length }).fill(0);
|
|
1975
|
-
for (let i = length - 1; i >= 0; i--) {
|
|
1976
|
-
res[i] = value & 255;
|
|
1977
|
-
value >>>= 8;
|
|
1978
|
-
}
|
|
1979
|
-
return new Uint8Array(res);
|
|
1980
|
-
}
|
|
1981
|
-
function strxor(a, b) {
|
|
1982
|
-
const arr = new Uint8Array(a.length);
|
|
1983
|
-
for (let i = 0; i < a.length; i++) {
|
|
1984
|
-
arr[i] = a[i] ^ b[i];
|
|
1985
|
-
}
|
|
1986
|
-
return arr;
|
|
1987
|
-
}
|
|
1988
|
-
function normDST(DST) {
|
|
1989
|
-
if (!isBytes(DST) && typeof DST !== "string")
|
|
1990
|
-
throw new Error("DST must be Uint8Array or ascii string");
|
|
1991
|
-
return typeof DST === "string" ? asciiToBytes(DST) : DST;
|
|
1992
|
-
}
|
|
1993
|
-
function expand_message_xmd(msg, DST, lenInBytes, H) {
|
|
1994
|
-
abytes(msg);
|
|
1995
|
-
asafenumber(lenInBytes);
|
|
1996
|
-
DST = normDST(DST);
|
|
1997
|
-
if (DST.length > 255)
|
|
1998
|
-
DST = H(concatBytes(asciiToBytes("H2C-OVERSIZE-DST-"), DST));
|
|
1999
|
-
const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H;
|
|
2000
|
-
const ell = Math.ceil(lenInBytes / b_in_bytes);
|
|
2001
|
-
if (lenInBytes > 65535 || ell > 255)
|
|
2002
|
-
throw new Error("expand_message_xmd: invalid lenInBytes");
|
|
2003
|
-
const DST_prime = concatBytes(DST, i2osp(DST.length, 1));
|
|
2004
|
-
const Z_pad = i2osp(0, r_in_bytes);
|
|
2005
|
-
const l_i_b_str = i2osp(lenInBytes, 2);
|
|
2006
|
-
const b = new Array(ell);
|
|
2007
|
-
const b_0 = H(concatBytes(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime));
|
|
2008
|
-
b[0] = H(concatBytes(b_0, i2osp(1, 1), DST_prime));
|
|
2009
|
-
for (let i = 1; i <= ell; i++) {
|
|
2010
|
-
const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime];
|
|
2011
|
-
b[i] = H(concatBytes(...args));
|
|
2012
|
-
}
|
|
2013
|
-
const pseudo_random_bytes = concatBytes(...b);
|
|
2014
|
-
return pseudo_random_bytes.slice(0, lenInBytes);
|
|
2015
|
-
}
|
|
2016
|
-
function expand_message_xof(msg, DST, lenInBytes, k, H) {
|
|
2017
|
-
abytes(msg);
|
|
2018
|
-
asafenumber(lenInBytes);
|
|
2019
|
-
DST = normDST(DST);
|
|
2020
|
-
if (DST.length > 255) {
|
|
2021
|
-
const dkLen = Math.ceil(2 * k / 8);
|
|
2022
|
-
DST = H.create({ dkLen }).update(asciiToBytes("H2C-OVERSIZE-DST-")).update(DST).digest();
|
|
2023
|
-
}
|
|
2024
|
-
if (lenInBytes > 65535 || DST.length > 255)
|
|
2025
|
-
throw new Error("expand_message_xof: invalid lenInBytes");
|
|
2026
|
-
return H.create({ dkLen: lenInBytes }).update(msg).update(i2osp(lenInBytes, 2)).update(DST).update(i2osp(DST.length, 1)).digest();
|
|
2027
|
-
}
|
|
2028
|
-
function hash_to_field(msg, count, options) {
|
|
2029
|
-
validateObject(options, {
|
|
2030
|
-
p: "bigint",
|
|
2031
|
-
m: "number",
|
|
2032
|
-
k: "number",
|
|
2033
|
-
hash: "function"
|
|
2034
|
-
});
|
|
2035
|
-
const { p, k, m, hash, expand, DST } = options;
|
|
2036
|
-
asafenumber(hash.outputLen, "valid hash");
|
|
2037
|
-
abytes(msg);
|
|
2038
|
-
asafenumber(count);
|
|
2039
|
-
const log2p = p.toString(2).length;
|
|
2040
|
-
const L = Math.ceil((log2p + k) / 8);
|
|
2041
|
-
const len_in_bytes = count * m * L;
|
|
2042
|
-
let prb;
|
|
2043
|
-
if (expand === "xmd") {
|
|
2044
|
-
prb = expand_message_xmd(msg, DST, len_in_bytes, hash);
|
|
2045
|
-
} else if (expand === "xof") {
|
|
2046
|
-
prb = expand_message_xof(msg, DST, len_in_bytes, k, hash);
|
|
2047
|
-
} else if (expand === "_internal_pass") {
|
|
2048
|
-
prb = msg;
|
|
2049
|
-
} else {
|
|
2050
|
-
throw new Error('expand must be "xmd" or "xof"');
|
|
2051
|
-
}
|
|
2052
|
-
const u = new Array(count);
|
|
2053
|
-
for (let i = 0; i < count; i++) {
|
|
2054
|
-
const e = new Array(m);
|
|
2055
|
-
for (let j = 0; j < m; j++) {
|
|
2056
|
-
const elm_offset = L * (j + i * m);
|
|
2057
|
-
const tv = prb.subarray(elm_offset, elm_offset + L);
|
|
2058
|
-
e[j] = mod(os2ip(tv), p);
|
|
2059
|
-
}
|
|
2060
|
-
u[i] = e;
|
|
2061
|
-
}
|
|
2062
|
-
return u;
|
|
2063
|
-
}
|
|
2064
|
-
var _DST_scalar = asciiToBytes("HashToScalar-");
|
|
2065
|
-
function createHasher2(Point, mapToCurve, defaults) {
|
|
2066
|
-
if (typeof mapToCurve !== "function")
|
|
2067
|
-
throw new Error("mapToCurve() must be defined");
|
|
2068
|
-
function map(num) {
|
|
2069
|
-
return Point.fromAffine(mapToCurve(num));
|
|
2070
|
-
}
|
|
2071
|
-
function clear(initial) {
|
|
2072
|
-
const P = initial.clearCofactor();
|
|
2073
|
-
if (P.equals(Point.ZERO))
|
|
2074
|
-
return Point.ZERO;
|
|
2075
|
-
P.assertValidity();
|
|
2076
|
-
return P;
|
|
2077
|
-
}
|
|
2078
|
-
return {
|
|
2079
|
-
defaults: Object.freeze(defaults),
|
|
2080
|
-
Point,
|
|
2081
|
-
hashToCurve(msg, options) {
|
|
2082
|
-
const opts = Object.assign({}, defaults, options);
|
|
2083
|
-
const u = hash_to_field(msg, 2, opts);
|
|
2084
|
-
const u0 = map(u[0]);
|
|
2085
|
-
const u1 = map(u[1]);
|
|
2086
|
-
return clear(u0.add(u1));
|
|
2087
|
-
},
|
|
2088
|
-
encodeToCurve(msg, options) {
|
|
2089
|
-
const optsDst = defaults.encodeDST ? { DST: defaults.encodeDST } : {};
|
|
2090
|
-
const opts = Object.assign({}, defaults, optsDst, options);
|
|
2091
|
-
const u = hash_to_field(msg, 1, opts);
|
|
2092
|
-
const u0 = map(u[0]);
|
|
2093
|
-
return clear(u0);
|
|
2094
|
-
},
|
|
2095
|
-
/** See {@link H2CHasher} */
|
|
2096
|
-
mapToCurve(scalars) {
|
|
2097
|
-
if (defaults.m === 1) {
|
|
2098
|
-
if (typeof scalars !== "bigint")
|
|
2099
|
-
throw new Error("expected bigint (m=1)");
|
|
2100
|
-
return clear(map([scalars]));
|
|
2101
|
-
}
|
|
2102
|
-
if (!Array.isArray(scalars))
|
|
2103
|
-
throw new Error("expected array of bigints");
|
|
2104
|
-
for (const i of scalars)
|
|
2105
|
-
if (typeof i !== "bigint")
|
|
2106
|
-
throw new Error("expected array of bigints");
|
|
2107
|
-
return clear(map(scalars));
|
|
2108
|
-
},
|
|
2109
|
-
// hash_to_scalar can produce 0: https://www.rfc-editor.org/errata/eid8393
|
|
2110
|
-
// RFC 9380, draft-irtf-cfrg-bbs-signatures-08
|
|
2111
|
-
hashToScalar(msg, options) {
|
|
2112
|
-
const N = Point.Fn.ORDER;
|
|
2113
|
-
const opts = Object.assign({}, defaults, { p: N, m: 1, DST: _DST_scalar }, options);
|
|
2114
|
-
return hash_to_field(msg, 1, opts)[0][0];
|
|
2115
|
-
}
|
|
2116
|
-
};
|
|
2117
|
-
}
|
|
2118
|
-
|
|
2119
|
-
// node_modules/@noble/curves/abstract/montgomery.js
|
|
2120
|
-
var _0n5 = BigInt(0);
|
|
2121
|
-
var _1n5 = BigInt(1);
|
|
2122
|
-
var _2n3 = BigInt(2);
|
|
2123
|
-
function validateOpts(curve) {
|
|
2124
|
-
validateObject(curve, {
|
|
2125
|
-
adjustScalarBytes: "function",
|
|
2126
|
-
powPminus2: "function"
|
|
2127
|
-
});
|
|
2128
|
-
return Object.freeze({ ...curve });
|
|
2129
|
-
}
|
|
2130
|
-
function montgomery(curveDef) {
|
|
2131
|
-
const CURVE = validateOpts(curveDef);
|
|
2132
|
-
const { P, type, adjustScalarBytes: adjustScalarBytes2, powPminus2, randomBytes: rand } = CURVE;
|
|
2133
|
-
const is25519 = type === "x25519";
|
|
2134
|
-
if (!is25519 && type !== "x448")
|
|
2135
|
-
throw new Error("invalid type");
|
|
2136
|
-
const randomBytes_ = rand || randomBytes;
|
|
2137
|
-
const montgomeryBits = is25519 ? 255 : 448;
|
|
2138
|
-
const fieldLen = is25519 ? 32 : 56;
|
|
2139
|
-
const Gu = is25519 ? BigInt(9) : BigInt(5);
|
|
2140
|
-
const a24 = is25519 ? BigInt(121665) : BigInt(39081);
|
|
2141
|
-
const minScalar = is25519 ? _2n3 ** BigInt(254) : _2n3 ** BigInt(447);
|
|
2142
|
-
const maxAdded = is25519 ? BigInt(8) * _2n3 ** BigInt(251) - _1n5 : BigInt(4) * _2n3 ** BigInt(445) - _1n5;
|
|
2143
|
-
const maxScalar = minScalar + maxAdded + _1n5;
|
|
2144
|
-
const modP = (n) => mod(n, P);
|
|
2145
|
-
const GuBytes = encodeU(Gu);
|
|
2146
|
-
function encodeU(u) {
|
|
2147
|
-
return numberToBytesLE(modP(u), fieldLen);
|
|
2148
|
-
}
|
|
2149
|
-
function decodeU(u) {
|
|
2150
|
-
const _u = copyBytes(abytes(u, fieldLen, "uCoordinate"));
|
|
2151
|
-
if (is25519)
|
|
2152
|
-
_u[31] &= 127;
|
|
2153
|
-
return modP(bytesToNumberLE(_u));
|
|
2154
|
-
}
|
|
2155
|
-
function decodeScalar(scalar) {
|
|
2156
|
-
return bytesToNumberLE(adjustScalarBytes2(copyBytes(abytes(scalar, fieldLen, "scalar"))));
|
|
2157
|
-
}
|
|
2158
|
-
function scalarMult(scalar, u) {
|
|
2159
|
-
const pu = montgomeryLadder(decodeU(u), decodeScalar(scalar));
|
|
2160
|
-
if (pu === _0n5)
|
|
2161
|
-
throw new Error("invalid private or public key received");
|
|
2162
|
-
return encodeU(pu);
|
|
2163
|
-
}
|
|
2164
|
-
function scalarMultBase(scalar) {
|
|
2165
|
-
return scalarMult(scalar, GuBytes);
|
|
2166
|
-
}
|
|
2167
|
-
const getPublicKey = scalarMultBase;
|
|
2168
|
-
const getSharedSecret = scalarMult;
|
|
2169
|
-
function cswap(swap, x_2, x_3) {
|
|
2170
|
-
const dummy = modP(swap * (x_2 - x_3));
|
|
2171
|
-
x_2 = modP(x_2 - dummy);
|
|
2172
|
-
x_3 = modP(x_3 + dummy);
|
|
2173
|
-
return { x_2, x_3 };
|
|
2174
|
-
}
|
|
2175
|
-
function montgomeryLadder(u, scalar) {
|
|
2176
|
-
aInRange("u", u, _0n5, P);
|
|
2177
|
-
aInRange("scalar", scalar, minScalar, maxScalar);
|
|
2178
|
-
const k = scalar;
|
|
2179
|
-
const x_1 = u;
|
|
2180
|
-
let x_2 = _1n5;
|
|
2181
|
-
let z_2 = _0n5;
|
|
2182
|
-
let x_3 = u;
|
|
2183
|
-
let z_3 = _1n5;
|
|
2184
|
-
let swap = _0n5;
|
|
2185
|
-
for (let t = BigInt(montgomeryBits - 1); t >= _0n5; t--) {
|
|
2186
|
-
const k_t = k >> t & _1n5;
|
|
2187
|
-
swap ^= k_t;
|
|
2188
|
-
({ x_2, x_3 } = cswap(swap, x_2, x_3));
|
|
2189
|
-
({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3));
|
|
2190
|
-
swap = k_t;
|
|
2191
|
-
const A = x_2 + z_2;
|
|
2192
|
-
const AA = modP(A * A);
|
|
2193
|
-
const B = x_2 - z_2;
|
|
2194
|
-
const BB = modP(B * B);
|
|
2195
|
-
const E = AA - BB;
|
|
2196
|
-
const C = x_3 + z_3;
|
|
2197
|
-
const D = x_3 - z_3;
|
|
2198
|
-
const DA = modP(D * A);
|
|
2199
|
-
const CB = modP(C * B);
|
|
2200
|
-
const dacb = DA + CB;
|
|
2201
|
-
const da_cb = DA - CB;
|
|
2202
|
-
x_3 = modP(dacb * dacb);
|
|
2203
|
-
z_3 = modP(x_1 * modP(da_cb * da_cb));
|
|
2204
|
-
x_2 = modP(AA * BB);
|
|
2205
|
-
z_2 = modP(E * (AA + modP(a24 * E)));
|
|
2206
|
-
}
|
|
2207
|
-
({ x_2, x_3 } = cswap(swap, x_2, x_3));
|
|
2208
|
-
({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3));
|
|
2209
|
-
const z2 = powPminus2(z_2);
|
|
2210
|
-
return modP(x_2 * z2);
|
|
2211
|
-
}
|
|
2212
|
-
const lengths = {
|
|
2213
|
-
secretKey: fieldLen,
|
|
2214
|
-
publicKey: fieldLen,
|
|
2215
|
-
seed: fieldLen
|
|
2216
|
-
};
|
|
2217
|
-
const randomSecretKey = (seed = randomBytes_(fieldLen)) => {
|
|
2218
|
-
abytes(seed, lengths.seed, "seed");
|
|
2219
|
-
return seed;
|
|
2220
|
-
};
|
|
2221
|
-
const utils = { randomSecretKey };
|
|
2222
|
-
return Object.freeze({
|
|
2223
|
-
keygen: createKeygen(randomSecretKey, getPublicKey),
|
|
2224
|
-
getSharedSecret,
|
|
2225
|
-
getPublicKey,
|
|
2226
|
-
scalarMult,
|
|
2227
|
-
scalarMultBase,
|
|
2228
|
-
utils,
|
|
2229
|
-
GuBytes: GuBytes.slice(),
|
|
2230
|
-
lengths
|
|
2231
|
-
});
|
|
2232
|
-
}
|
|
2233
|
-
|
|
2234
|
-
// node_modules/@noble/curves/abstract/oprf.js
|
|
2235
|
-
function createORPF(opts) {
|
|
2236
|
-
validateObject(opts, {
|
|
2237
|
-
name: "string",
|
|
2238
|
-
hash: "function",
|
|
2239
|
-
hashToScalar: "function",
|
|
2240
|
-
hashToGroup: "function"
|
|
2241
|
-
});
|
|
2242
|
-
const { name, Point, hash } = opts;
|
|
2243
|
-
const { Fn: Fn2 } = Point;
|
|
2244
|
-
const hashToGroup = (msg, ctx) => opts.hashToGroup(msg, {
|
|
2245
|
-
DST: concatBytes(asciiToBytes("HashToGroup-"), ctx)
|
|
2246
|
-
});
|
|
2247
|
-
const hashToScalarPrefixed = (msg, ctx) => opts.hashToScalar(msg, { DST: concatBytes(_DST_scalar, ctx) });
|
|
2248
|
-
const randomScalar = (rng = randomBytes) => {
|
|
2249
|
-
const t = mapHashToField(rng(getMinHashLength(Fn2.ORDER)), Fn2.ORDER, Fn2.isLE);
|
|
2250
|
-
return Fn2.isLE ? bytesToNumberLE(t) : bytesToNumberBE(t);
|
|
2251
|
-
};
|
|
2252
|
-
const msm = (points, scalars) => pippenger(Point, points, scalars);
|
|
2253
|
-
const getCtx = (mode) => concatBytes(asciiToBytes("OPRFV1-"), new Uint8Array([mode]), asciiToBytes("-" + name));
|
|
2254
|
-
const ctxOPRF = getCtx(0);
|
|
2255
|
-
const ctxVOPRF = getCtx(1);
|
|
2256
|
-
const ctxPOPRF = getCtx(2);
|
|
2257
|
-
function encode(...args) {
|
|
2258
|
-
const res = [];
|
|
2259
|
-
for (const a of args) {
|
|
2260
|
-
if (typeof a === "number")
|
|
2261
|
-
res.push(numberToBytesBE(a, 2));
|
|
2262
|
-
else if (typeof a === "string")
|
|
2263
|
-
res.push(asciiToBytes(a));
|
|
2264
|
-
else {
|
|
2265
|
-
abytes(a);
|
|
2266
|
-
res.push(numberToBytesBE(a.length, 2), a);
|
|
2267
|
-
}
|
|
2268
|
-
}
|
|
2269
|
-
return concatBytes(...res);
|
|
2270
|
-
}
|
|
2271
|
-
const hashInput = (...bytes) => hash(encode(...bytes, "Finalize"));
|
|
2272
|
-
function getTranscripts(B, C, D, ctx) {
|
|
2273
|
-
const Bm = B.toBytes();
|
|
2274
|
-
const seed = hash(encode(Bm, concatBytes(asciiToBytes("Seed-"), ctx)));
|
|
2275
|
-
const res = [];
|
|
2276
|
-
for (let i = 0; i < C.length; i++) {
|
|
2277
|
-
const Ci = C[i].toBytes();
|
|
2278
|
-
const Di = D[i].toBytes();
|
|
2279
|
-
const di = hashToScalarPrefixed(encode(seed, i, Ci, Di, "Composite"), ctx);
|
|
2280
|
-
res.push(di);
|
|
2281
|
-
}
|
|
2282
|
-
return res;
|
|
2283
|
-
}
|
|
2284
|
-
function computeComposites(B, C, D, ctx) {
|
|
2285
|
-
const T = getTranscripts(B, C, D, ctx);
|
|
2286
|
-
const M = msm(C, T);
|
|
2287
|
-
const Z = msm(D, T);
|
|
2288
|
-
return { M, Z };
|
|
2289
|
-
}
|
|
2290
|
-
function computeCompositesFast(k, B, C, D, ctx) {
|
|
2291
|
-
const T = getTranscripts(B, C, D, ctx);
|
|
2292
|
-
const M = msm(C, T);
|
|
2293
|
-
const Z = M.multiply(k);
|
|
2294
|
-
return { M, Z };
|
|
2295
|
-
}
|
|
2296
|
-
function challengeTranscript(B, M, Z, t2, t3, ctx) {
|
|
2297
|
-
const [Bm, a0, a1, a2, a3] = [B, M, Z, t2, t3].map((i) => i.toBytes());
|
|
2298
|
-
return hashToScalarPrefixed(encode(Bm, a0, a1, a2, a3, "Challenge"), ctx);
|
|
2299
|
-
}
|
|
2300
|
-
function generateProof(ctx, k, B, C, D, rng) {
|
|
2301
|
-
const { M, Z } = computeCompositesFast(k, B, C, D, ctx);
|
|
2302
|
-
const r = randomScalar(rng);
|
|
2303
|
-
const t2 = Point.BASE.multiply(r);
|
|
2304
|
-
const t3 = M.multiply(r);
|
|
2305
|
-
const c = challengeTranscript(B, M, Z, t2, t3, ctx);
|
|
2306
|
-
const s = Fn2.sub(r, Fn2.mul(c, k));
|
|
2307
|
-
return concatBytes(...[c, s].map((i) => Fn2.toBytes(i)));
|
|
2308
|
-
}
|
|
2309
|
-
function verifyProof(ctx, B, C, D, proof) {
|
|
2310
|
-
abytes(proof, 2 * Fn2.BYTES);
|
|
2311
|
-
const { M, Z } = computeComposites(B, C, D, ctx);
|
|
2312
|
-
const [c, s] = [proof.subarray(0, Fn2.BYTES), proof.subarray(Fn2.BYTES)].map((f) => Fn2.fromBytes(f));
|
|
2313
|
-
const t2 = Point.BASE.multiply(s).add(B.multiply(c));
|
|
2314
|
-
const t3 = M.multiply(s).add(Z.multiply(c));
|
|
2315
|
-
const expectedC = challengeTranscript(B, M, Z, t2, t3, ctx);
|
|
2316
|
-
if (!Fn2.eql(c, expectedC))
|
|
2317
|
-
throw new Error("proof verification failed");
|
|
2318
|
-
}
|
|
2319
|
-
function generateKeyPair() {
|
|
2320
|
-
const skS = randomScalar();
|
|
2321
|
-
const pkS = Point.BASE.multiply(skS);
|
|
2322
|
-
return { secretKey: Fn2.toBytes(skS), publicKey: pkS.toBytes() };
|
|
2323
|
-
}
|
|
2324
|
-
function deriveKeyPair(ctx, seed, info) {
|
|
2325
|
-
const dst = concatBytes(asciiToBytes("DeriveKeyPair"), ctx);
|
|
2326
|
-
const msg = concatBytes(seed, encode(info), Uint8Array.of(0));
|
|
2327
|
-
for (let counter = 0; counter <= 255; counter++) {
|
|
2328
|
-
msg[msg.length - 1] = counter;
|
|
2329
|
-
const skS = opts.hashToScalar(msg, { DST: dst });
|
|
2330
|
-
if (Fn2.is0(skS))
|
|
2331
|
-
continue;
|
|
2332
|
-
return { secretKey: Fn2.toBytes(skS), publicKey: Point.BASE.multiply(skS).toBytes() };
|
|
2333
|
-
}
|
|
2334
|
-
throw new Error("Cannot derive key");
|
|
2335
|
-
}
|
|
2336
|
-
function blind(ctx, input, rng = randomBytes) {
|
|
2337
|
-
const blind2 = randomScalar(rng);
|
|
2338
|
-
const inputPoint = hashToGroup(input, ctx);
|
|
2339
|
-
if (inputPoint.equals(Point.ZERO))
|
|
2340
|
-
throw new Error("Input point at infinity");
|
|
2341
|
-
const blinded = inputPoint.multiply(blind2);
|
|
2342
|
-
return { blind: Fn2.toBytes(blind2), blinded: blinded.toBytes() };
|
|
2343
|
-
}
|
|
2344
|
-
function evaluate(ctx, secretKey, input) {
|
|
2345
|
-
const skS = Fn2.fromBytes(secretKey);
|
|
2346
|
-
const inputPoint = hashToGroup(input, ctx);
|
|
2347
|
-
if (inputPoint.equals(Point.ZERO))
|
|
2348
|
-
throw new Error("Input point at infinity");
|
|
2349
|
-
const unblinded = inputPoint.multiply(skS).toBytes();
|
|
2350
|
-
return hashInput(input, unblinded);
|
|
2351
|
-
}
|
|
2352
|
-
const oprf = {
|
|
2353
|
-
generateKeyPair,
|
|
2354
|
-
deriveKeyPair: (seed, keyInfo) => deriveKeyPair(ctxOPRF, seed, keyInfo),
|
|
2355
|
-
blind: (input, rng = randomBytes) => blind(ctxOPRF, input, rng),
|
|
2356
|
-
blindEvaluate(secretKey, blindedPoint) {
|
|
2357
|
-
const skS = Fn2.fromBytes(secretKey);
|
|
2358
|
-
const elm = Point.fromBytes(blindedPoint);
|
|
2359
|
-
return elm.multiply(skS).toBytes();
|
|
2360
|
-
},
|
|
2361
|
-
finalize(input, blindBytes, evaluatedBytes) {
|
|
2362
|
-
const blind2 = Fn2.fromBytes(blindBytes);
|
|
2363
|
-
const evalPoint = Point.fromBytes(evaluatedBytes);
|
|
2364
|
-
const unblinded = evalPoint.multiply(Fn2.inv(blind2)).toBytes();
|
|
2365
|
-
return hashInput(input, unblinded);
|
|
2366
|
-
},
|
|
2367
|
-
evaluate: (secretKey, input) => evaluate(ctxOPRF, secretKey, input)
|
|
2368
|
-
};
|
|
2369
|
-
const voprf = {
|
|
2370
|
-
generateKeyPair,
|
|
2371
|
-
deriveKeyPair: (seed, keyInfo) => deriveKeyPair(ctxVOPRF, seed, keyInfo),
|
|
2372
|
-
blind: (input, rng = randomBytes) => blind(ctxVOPRF, input, rng),
|
|
2373
|
-
blindEvaluateBatch(secretKey, publicKey, blinded, rng = randomBytes) {
|
|
2374
|
-
if (!Array.isArray(blinded))
|
|
2375
|
-
throw new Error("expected array");
|
|
2376
|
-
const skS = Fn2.fromBytes(secretKey);
|
|
2377
|
-
const pkS = Point.fromBytes(publicKey);
|
|
2378
|
-
const blindedPoints = blinded.map(Point.fromBytes);
|
|
2379
|
-
const evaluated = blindedPoints.map((i) => i.multiply(skS));
|
|
2380
|
-
const proof = generateProof(ctxVOPRF, skS, pkS, blindedPoints, evaluated, rng);
|
|
2381
|
-
return { evaluated: evaluated.map((i) => i.toBytes()), proof };
|
|
2382
|
-
},
|
|
2383
|
-
blindEvaluate(secretKey, publicKey, blinded, rng = randomBytes) {
|
|
2384
|
-
const res = this.blindEvaluateBatch(secretKey, publicKey, [blinded], rng);
|
|
2385
|
-
return { evaluated: res.evaluated[0], proof: res.proof };
|
|
2386
|
-
},
|
|
2387
|
-
finalizeBatch(items, publicKey, proof) {
|
|
2388
|
-
if (!Array.isArray(items))
|
|
2389
|
-
throw new Error("expected array");
|
|
2390
|
-
const pkS = Point.fromBytes(publicKey);
|
|
2391
|
-
const blindedPoints = items.map((i) => i.blinded).map(Point.fromBytes);
|
|
2392
|
-
const evalPoints = items.map((i) => i.evaluated).map(Point.fromBytes);
|
|
2393
|
-
verifyProof(ctxVOPRF, pkS, blindedPoints, evalPoints, proof);
|
|
2394
|
-
return items.map((i) => oprf.finalize(i.input, i.blind, i.evaluated));
|
|
2395
|
-
},
|
|
2396
|
-
finalize(input, blind2, evaluated, blinded, publicKey, proof) {
|
|
2397
|
-
return this.finalizeBatch([{ input, blind: blind2, evaluated, blinded }], publicKey, proof)[0];
|
|
2398
|
-
},
|
|
2399
|
-
evaluate: (secretKey, input) => evaluate(ctxVOPRF, secretKey, input)
|
|
2400
|
-
};
|
|
2401
|
-
const poprf = (info) => {
|
|
2402
|
-
const m = hashToScalarPrefixed(encode("Info", info), ctxPOPRF);
|
|
2403
|
-
const T = Point.BASE.multiply(m);
|
|
2404
|
-
return {
|
|
2405
|
-
generateKeyPair,
|
|
2406
|
-
deriveKeyPair: (seed, keyInfo) => deriveKeyPair(ctxPOPRF, seed, keyInfo),
|
|
2407
|
-
blind(input, publicKey, rng = randomBytes) {
|
|
2408
|
-
const pkS = Point.fromBytes(publicKey);
|
|
2409
|
-
const tweakedKey = T.add(pkS);
|
|
2410
|
-
if (tweakedKey.equals(Point.ZERO))
|
|
2411
|
-
throw new Error("tweakedKey point at infinity");
|
|
2412
|
-
const blind2 = randomScalar(rng);
|
|
2413
|
-
const inputPoint = hashToGroup(input, ctxPOPRF);
|
|
2414
|
-
if (inputPoint.equals(Point.ZERO))
|
|
2415
|
-
throw new Error("Input point at infinity");
|
|
2416
|
-
const blindedPoint = inputPoint.multiply(blind2);
|
|
2417
|
-
return {
|
|
2418
|
-
blind: Fn2.toBytes(blind2),
|
|
2419
|
-
blinded: blindedPoint.toBytes(),
|
|
2420
|
-
tweakedKey: tweakedKey.toBytes()
|
|
2421
|
-
};
|
|
2422
|
-
},
|
|
2423
|
-
blindEvaluateBatch(secretKey, blinded, rng = randomBytes) {
|
|
2424
|
-
if (!Array.isArray(blinded))
|
|
2425
|
-
throw new Error("expected array");
|
|
2426
|
-
const skS = Fn2.fromBytes(secretKey);
|
|
2427
|
-
const t = Fn2.add(skS, m);
|
|
2428
|
-
const invT = Fn2.inv(t);
|
|
2429
|
-
const blindedPoints = blinded.map(Point.fromBytes);
|
|
2430
|
-
const evalPoints = blindedPoints.map((i) => i.multiply(invT));
|
|
2431
|
-
const tweakedKey = Point.BASE.multiply(t);
|
|
2432
|
-
const proof = generateProof(ctxPOPRF, t, tweakedKey, evalPoints, blindedPoints, rng);
|
|
2433
|
-
return { evaluated: evalPoints.map((i) => i.toBytes()), proof };
|
|
2434
|
-
},
|
|
2435
|
-
blindEvaluate(secretKey, blinded, rng = randomBytes) {
|
|
2436
|
-
const res = this.blindEvaluateBatch(secretKey, [blinded], rng);
|
|
2437
|
-
return { evaluated: res.evaluated[0], proof: res.proof };
|
|
2438
|
-
},
|
|
2439
|
-
finalizeBatch(items, proof, tweakedKey) {
|
|
2440
|
-
if (!Array.isArray(items))
|
|
2441
|
-
throw new Error("expected array");
|
|
2442
|
-
const evalPoints = items.map((i) => i.evaluated).map(Point.fromBytes);
|
|
2443
|
-
verifyProof(ctxPOPRF, Point.fromBytes(tweakedKey), evalPoints, items.map((i) => i.blinded).map(Point.fromBytes), proof);
|
|
2444
|
-
return items.map((i, j) => {
|
|
2445
|
-
const blind2 = Fn2.fromBytes(i.blind);
|
|
2446
|
-
const point = evalPoints[j].multiply(Fn2.inv(blind2)).toBytes();
|
|
2447
|
-
return hashInput(i.input, info, point);
|
|
2448
|
-
});
|
|
2449
|
-
},
|
|
2450
|
-
finalize(input, blind2, evaluated, blinded, proof, tweakedKey) {
|
|
2451
|
-
return this.finalizeBatch([{ input, blind: blind2, evaluated, blinded }], proof, tweakedKey)[0];
|
|
2452
|
-
},
|
|
2453
|
-
evaluate(secretKey, input) {
|
|
2454
|
-
const skS = Fn2.fromBytes(secretKey);
|
|
2455
|
-
const inputPoint = hashToGroup(input, ctxPOPRF);
|
|
2456
|
-
if (inputPoint.equals(Point.ZERO))
|
|
2457
|
-
throw new Error("Input point at infinity");
|
|
2458
|
-
const t = Fn2.add(skS, m);
|
|
2459
|
-
const invT = Fn2.inv(t);
|
|
2460
|
-
const unblinded = inputPoint.multiply(invT).toBytes();
|
|
2461
|
-
return hashInput(input, info, unblinded);
|
|
2462
|
-
}
|
|
2463
|
-
};
|
|
2464
|
-
};
|
|
2465
|
-
return Object.freeze({ name, oprf, voprf, poprf, __tests: { Fn: Fn2 } });
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
|
-
// node_modules/@noble/curves/ed25519.js
|
|
2469
|
-
var _0n6 = BigInt(0);
|
|
2470
|
-
var _1n6 = BigInt(1);
|
|
2471
|
-
var _2n4 = BigInt(2);
|
|
2472
|
-
var _3n2 = BigInt(3);
|
|
2473
|
-
var _5n2 = BigInt(5);
|
|
2474
|
-
var _8n3 = BigInt(8);
|
|
2475
|
-
var ed25519_CURVE_p = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed");
|
|
2476
|
-
var ed25519_CURVE = (() => ({
|
|
2477
|
-
p: ed25519_CURVE_p,
|
|
2478
|
-
n: BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),
|
|
2479
|
-
h: _8n3,
|
|
2480
|
-
a: BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),
|
|
2481
|
-
d: BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),
|
|
2482
|
-
Gx: BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),
|
|
2483
|
-
Gy: BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")
|
|
2484
|
-
}))();
|
|
2485
|
-
function ed25519_pow_2_252_3(x) {
|
|
2486
|
-
const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80);
|
|
2487
|
-
const P = ed25519_CURVE_p;
|
|
2488
|
-
const x2 = x * x % P;
|
|
2489
|
-
const b2 = x2 * x % P;
|
|
2490
|
-
const b4 = pow2(b2, _2n4, P) * b2 % P;
|
|
2491
|
-
const b5 = pow2(b4, _1n6, P) * x % P;
|
|
2492
|
-
const b10 = pow2(b5, _5n2, P) * b5 % P;
|
|
2493
|
-
const b20 = pow2(b10, _10n, P) * b10 % P;
|
|
2494
|
-
const b40 = pow2(b20, _20n, P) * b20 % P;
|
|
2495
|
-
const b80 = pow2(b40, _40n, P) * b40 % P;
|
|
2496
|
-
const b160 = pow2(b80, _80n, P) * b80 % P;
|
|
2497
|
-
const b240 = pow2(b160, _80n, P) * b80 % P;
|
|
2498
|
-
const b250 = pow2(b240, _10n, P) * b10 % P;
|
|
2499
|
-
const pow_p_5_8 = pow2(b250, _2n4, P) * x % P;
|
|
2500
|
-
return { pow_p_5_8, b2 };
|
|
2501
|
-
}
|
|
2502
|
-
function adjustScalarBytes(bytes) {
|
|
2503
|
-
bytes[0] &= 248;
|
|
2504
|
-
bytes[31] &= 127;
|
|
2505
|
-
bytes[31] |= 64;
|
|
2506
|
-
return bytes;
|
|
2507
|
-
}
|
|
2508
|
-
var ED25519_SQRT_M1 = BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");
|
|
2509
|
-
function uvRatio(u, v) {
|
|
2510
|
-
const P = ed25519_CURVE_p;
|
|
2511
|
-
const v3 = mod(v * v * v, P);
|
|
2512
|
-
const v7 = mod(v3 * v3 * v, P);
|
|
2513
|
-
const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8;
|
|
2514
|
-
let x = mod(u * v3 * pow, P);
|
|
2515
|
-
const vx2 = mod(v * x * x, P);
|
|
2516
|
-
const root1 = x;
|
|
2517
|
-
const root2 = mod(x * ED25519_SQRT_M1, P);
|
|
2518
|
-
const useRoot1 = vx2 === u;
|
|
2519
|
-
const useRoot2 = vx2 === mod(-u, P);
|
|
2520
|
-
const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P);
|
|
2521
|
-
if (useRoot1)
|
|
2522
|
-
x = root1;
|
|
2523
|
-
if (useRoot2 || noRoot)
|
|
2524
|
-
x = root2;
|
|
2525
|
-
if (isNegativeLE(x, P))
|
|
2526
|
-
x = mod(-x, P);
|
|
2527
|
-
return { isValid: useRoot1 || useRoot2, value: x };
|
|
2528
|
-
}
|
|
2529
|
-
var ed25519_Point = edwards(ed25519_CURVE, { uvRatio });
|
|
2530
|
-
var Fp = (() => ed25519_Point.Fp)();
|
|
2531
|
-
var Fn = (() => ed25519_Point.Fn)();
|
|
2532
|
-
function ed25519_domain(data, ctx, phflag) {
|
|
2533
|
-
if (ctx.length > 255)
|
|
2534
|
-
throw new Error("Context is too big");
|
|
2535
|
-
return concatBytes(asciiToBytes("SigEd25519 no Ed25519 collisions"), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data);
|
|
2536
|
-
}
|
|
2537
|
-
function ed(opts) {
|
|
2538
|
-
return eddsa(ed25519_Point, sha512, Object.assign({ adjustScalarBytes }, opts));
|
|
2539
|
-
}
|
|
2540
|
-
var ed25519 = ed({});
|
|
2541
|
-
var ed25519ctx = ed({ domain: ed25519_domain });
|
|
2542
|
-
var ed25519ph = ed({ domain: ed25519_domain, prehash: sha512 });
|
|
2543
|
-
var x25519 = (() => {
|
|
2544
|
-
const P = ed25519_CURVE_p;
|
|
2545
|
-
return montgomery({
|
|
2546
|
-
P,
|
|
2547
|
-
type: "x25519",
|
|
2548
|
-
powPminus2: (x) => {
|
|
2549
|
-
const { pow_p_5_8, b2 } = ed25519_pow_2_252_3(x);
|
|
2550
|
-
return mod(pow2(pow_p_5_8, _3n2, P) * b2, P);
|
|
2551
|
-
},
|
|
2552
|
-
adjustScalarBytes
|
|
2553
|
-
});
|
|
2554
|
-
})();
|
|
2555
|
-
var ELL2_C1 = (() => (ed25519_CURVE_p + _3n2) / _8n3)();
|
|
2556
|
-
var ELL2_C2 = (() => Fp.pow(_2n4, ELL2_C1))();
|
|
2557
|
-
var ELL2_C3 = (() => Fp.sqrt(Fp.neg(Fp.ONE)))();
|
|
2558
|
-
function _map_to_curve_elligator2_curve25519(u) {
|
|
2559
|
-
const ELL2_C4 = (ed25519_CURVE_p - _5n2) / _8n3;
|
|
2560
|
-
const ELL2_J = BigInt(486662);
|
|
2561
|
-
let tv1 = Fp.sqr(u);
|
|
2562
|
-
tv1 = Fp.mul(tv1, _2n4);
|
|
2563
|
-
let xd = Fp.add(tv1, Fp.ONE);
|
|
2564
|
-
let x1n = Fp.neg(ELL2_J);
|
|
2565
|
-
let tv2 = Fp.sqr(xd);
|
|
2566
|
-
let gxd = Fp.mul(tv2, xd);
|
|
2567
|
-
let gx1 = Fp.mul(tv1, ELL2_J);
|
|
2568
|
-
gx1 = Fp.mul(gx1, x1n);
|
|
2569
|
-
gx1 = Fp.add(gx1, tv2);
|
|
2570
|
-
gx1 = Fp.mul(gx1, x1n);
|
|
2571
|
-
let tv3 = Fp.sqr(gxd);
|
|
2572
|
-
tv2 = Fp.sqr(tv3);
|
|
2573
|
-
tv3 = Fp.mul(tv3, gxd);
|
|
2574
|
-
tv3 = Fp.mul(tv3, gx1);
|
|
2575
|
-
tv2 = Fp.mul(tv2, tv3);
|
|
2576
|
-
let y11 = Fp.pow(tv2, ELL2_C4);
|
|
2577
|
-
y11 = Fp.mul(y11, tv3);
|
|
2578
|
-
let y12 = Fp.mul(y11, ELL2_C3);
|
|
2579
|
-
tv2 = Fp.sqr(y11);
|
|
2580
|
-
tv2 = Fp.mul(tv2, gxd);
|
|
2581
|
-
let e1 = Fp.eql(tv2, gx1);
|
|
2582
|
-
let y1 = Fp.cmov(y12, y11, e1);
|
|
2583
|
-
let x2n = Fp.mul(x1n, tv1);
|
|
2584
|
-
let y21 = Fp.mul(y11, u);
|
|
2585
|
-
y21 = Fp.mul(y21, ELL2_C2);
|
|
2586
|
-
let y22 = Fp.mul(y21, ELL2_C3);
|
|
2587
|
-
let gx2 = Fp.mul(gx1, tv1);
|
|
2588
|
-
tv2 = Fp.sqr(y21);
|
|
2589
|
-
tv2 = Fp.mul(tv2, gxd);
|
|
2590
|
-
let e2 = Fp.eql(tv2, gx2);
|
|
2591
|
-
let y2 = Fp.cmov(y22, y21, e2);
|
|
2592
|
-
tv2 = Fp.sqr(y1);
|
|
2593
|
-
tv2 = Fp.mul(tv2, gxd);
|
|
2594
|
-
let e3 = Fp.eql(tv2, gx1);
|
|
2595
|
-
let xn = Fp.cmov(x2n, x1n, e3);
|
|
2596
|
-
let y = Fp.cmov(y2, y1, e3);
|
|
2597
|
-
let e4 = Fp.isOdd(y);
|
|
2598
|
-
y = Fp.cmov(y, Fp.neg(y), e3 !== e4);
|
|
2599
|
-
return { xMn: xn, xMd: xd, yMn: y, yMd: _1n6 };
|
|
2600
|
-
}
|
|
2601
|
-
var ELL2_C1_EDWARDS = (() => FpSqrtEven(Fp, Fp.neg(BigInt(486664))))();
|
|
2602
|
-
function map_to_curve_elligator2_edwards25519(u) {
|
|
2603
|
-
const { xMn, xMd, yMn, yMd } = _map_to_curve_elligator2_curve25519(u);
|
|
2604
|
-
let xn = Fp.mul(xMn, yMd);
|
|
2605
|
-
xn = Fp.mul(xn, ELL2_C1_EDWARDS);
|
|
2606
|
-
let xd = Fp.mul(xMd, yMn);
|
|
2607
|
-
let yn = Fp.sub(xMn, xMd);
|
|
2608
|
-
let yd = Fp.add(xMn, xMd);
|
|
2609
|
-
let tv1 = Fp.mul(xd, yd);
|
|
2610
|
-
let e = Fp.eql(tv1, Fp.ZERO);
|
|
2611
|
-
xn = Fp.cmov(xn, Fp.ZERO, e);
|
|
2612
|
-
xd = Fp.cmov(xd, Fp.ONE, e);
|
|
2613
|
-
yn = Fp.cmov(yn, Fp.ONE, e);
|
|
2614
|
-
yd = Fp.cmov(yd, Fp.ONE, e);
|
|
2615
|
-
const [xd_inv, yd_inv] = FpInvertBatch(Fp, [xd, yd], true);
|
|
2616
|
-
return { x: Fp.mul(xn, xd_inv), y: Fp.mul(yn, yd_inv) };
|
|
2617
|
-
}
|
|
2618
|
-
var ed25519_hasher = (() => createHasher2(ed25519_Point, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), {
|
|
2619
|
-
DST: "edwards25519_XMD:SHA-512_ELL2_RO_",
|
|
2620
|
-
encodeDST: "edwards25519_XMD:SHA-512_ELL2_NU_",
|
|
2621
|
-
p: ed25519_CURVE_p,
|
|
2622
|
-
m: 1,
|
|
2623
|
-
k: 128,
|
|
2624
|
-
expand: "xmd",
|
|
2625
|
-
hash: sha512
|
|
2626
|
-
}))();
|
|
2627
|
-
var SQRT_M1 = ED25519_SQRT_M1;
|
|
2628
|
-
var SQRT_AD_MINUS_ONE = BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235");
|
|
2629
|
-
var INVSQRT_A_MINUS_D = BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578");
|
|
2630
|
-
var ONE_MINUS_D_SQ = BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838");
|
|
2631
|
-
var D_MINUS_ONE_SQ = BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");
|
|
2632
|
-
var invertSqrt = (number) => uvRatio(_1n6, number);
|
|
2633
|
-
var MAX_255B = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
|
2634
|
-
var bytes255ToNumberLE = (bytes) => Fp.create(bytesToNumberLE(bytes) & MAX_255B);
|
|
2635
|
-
function calcElligatorRistrettoMap(r0) {
|
|
2636
|
-
const { d } = ed25519_CURVE;
|
|
2637
|
-
const P = ed25519_CURVE_p;
|
|
2638
|
-
const mod2 = (n) => Fp.create(n);
|
|
2639
|
-
const r = mod2(SQRT_M1 * r0 * r0);
|
|
2640
|
-
const Ns = mod2((r + _1n6) * ONE_MINUS_D_SQ);
|
|
2641
|
-
let c = BigInt(-1);
|
|
2642
|
-
const D = mod2((c - d * r) * mod2(r + d));
|
|
2643
|
-
let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D);
|
|
2644
|
-
let s_ = mod2(s * r0);
|
|
2645
|
-
if (!isNegativeLE(s_, P))
|
|
2646
|
-
s_ = mod2(-s_);
|
|
2647
|
-
if (!Ns_D_is_sq)
|
|
2648
|
-
s = s_;
|
|
2649
|
-
if (!Ns_D_is_sq)
|
|
2650
|
-
c = r;
|
|
2651
|
-
const Nt = mod2(c * (r - _1n6) * D_MINUS_ONE_SQ - D);
|
|
2652
|
-
const s2 = s * s;
|
|
2653
|
-
const W0 = mod2((s + s) * D);
|
|
2654
|
-
const W1 = mod2(Nt * SQRT_AD_MINUS_ONE);
|
|
2655
|
-
const W2 = mod2(_1n6 - s2);
|
|
2656
|
-
const W3 = mod2(_1n6 + s2);
|
|
2657
|
-
return new ed25519_Point(mod2(W0 * W3), mod2(W2 * W1), mod2(W1 * W3), mod2(W0 * W2));
|
|
2658
|
-
}
|
|
2659
|
-
var __RistrettoPoint = class __RistrettoPoint extends PrimeEdwardsPoint {
|
|
2660
|
-
constructor(ep) {
|
|
2661
|
-
super(ep);
|
|
2662
|
-
}
|
|
2663
|
-
static fromAffine(ap) {
|
|
2664
|
-
return new __RistrettoPoint(ed25519_Point.fromAffine(ap));
|
|
2665
|
-
}
|
|
2666
|
-
assertSame(other) {
|
|
2667
|
-
if (!(other instanceof __RistrettoPoint))
|
|
2668
|
-
throw new Error("RistrettoPoint expected");
|
|
2669
|
-
}
|
|
2670
|
-
init(ep) {
|
|
2671
|
-
return new __RistrettoPoint(ep);
|
|
2672
|
-
}
|
|
2673
|
-
static fromBytes(bytes) {
|
|
2674
|
-
abytes(bytes, 32);
|
|
2675
|
-
const { a, d } = ed25519_CURVE;
|
|
2676
|
-
const P = ed25519_CURVE_p;
|
|
2677
|
-
const mod2 = (n) => Fp.create(n);
|
|
2678
|
-
const s = bytes255ToNumberLE(bytes);
|
|
2679
|
-
if (!equalBytes(Fp.toBytes(s), bytes) || isNegativeLE(s, P))
|
|
2680
|
-
throw new Error("invalid ristretto255 encoding 1");
|
|
2681
|
-
const s2 = mod2(s * s);
|
|
2682
|
-
const u1 = mod2(_1n6 + a * s2);
|
|
2683
|
-
const u2 = mod2(_1n6 - a * s2);
|
|
2684
|
-
const u1_2 = mod2(u1 * u1);
|
|
2685
|
-
const u2_2 = mod2(u2 * u2);
|
|
2686
|
-
const v = mod2(a * d * u1_2 - u2_2);
|
|
2687
|
-
const { isValid, value: I } = invertSqrt(mod2(v * u2_2));
|
|
2688
|
-
const Dx = mod2(I * u2);
|
|
2689
|
-
const Dy = mod2(I * Dx * v);
|
|
2690
|
-
let x = mod2((s + s) * Dx);
|
|
2691
|
-
if (isNegativeLE(x, P))
|
|
2692
|
-
x = mod2(-x);
|
|
2693
|
-
const y = mod2(u1 * Dy);
|
|
2694
|
-
const t = mod2(x * y);
|
|
2695
|
-
if (!isValid || isNegativeLE(t, P) || y === _0n6)
|
|
2696
|
-
throw new Error("invalid ristretto255 encoding 2");
|
|
2697
|
-
return new __RistrettoPoint(new ed25519_Point(x, y, _1n6, t));
|
|
2698
|
-
}
|
|
2699
|
-
/**
|
|
2700
|
-
* Converts ristretto-encoded string to ristretto point.
|
|
2701
|
-
* Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode).
|
|
2702
|
-
* @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding
|
|
2703
|
-
*/
|
|
2704
|
-
static fromHex(hex) {
|
|
2705
|
-
return __RistrettoPoint.fromBytes(hexToBytes(hex));
|
|
2706
|
-
}
|
|
2707
|
-
/**
|
|
2708
|
-
* Encodes ristretto point to Uint8Array.
|
|
2709
|
-
* Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode).
|
|
2710
|
-
*/
|
|
2711
|
-
toBytes() {
|
|
2712
|
-
let { X, Y, Z, T } = this.ep;
|
|
2713
|
-
const P = ed25519_CURVE_p;
|
|
2714
|
-
const mod2 = (n) => Fp.create(n);
|
|
2715
|
-
const u1 = mod2(mod2(Z + Y) * mod2(Z - Y));
|
|
2716
|
-
const u2 = mod2(X * Y);
|
|
2717
|
-
const u2sq = mod2(u2 * u2);
|
|
2718
|
-
const { value: invsqrt } = invertSqrt(mod2(u1 * u2sq));
|
|
2719
|
-
const D1 = mod2(invsqrt * u1);
|
|
2720
|
-
const D2 = mod2(invsqrt * u2);
|
|
2721
|
-
const zInv = mod2(D1 * D2 * T);
|
|
2722
|
-
let D;
|
|
2723
|
-
if (isNegativeLE(T * zInv, P)) {
|
|
2724
|
-
let _x = mod2(Y * SQRT_M1);
|
|
2725
|
-
let _y = mod2(X * SQRT_M1);
|
|
2726
|
-
X = _x;
|
|
2727
|
-
Y = _y;
|
|
2728
|
-
D = mod2(D1 * INVSQRT_A_MINUS_D);
|
|
2729
|
-
} else {
|
|
2730
|
-
D = D2;
|
|
2731
|
-
}
|
|
2732
|
-
if (isNegativeLE(X * zInv, P))
|
|
2733
|
-
Y = mod2(-Y);
|
|
2734
|
-
let s = mod2((Z - Y) * D);
|
|
2735
|
-
if (isNegativeLE(s, P))
|
|
2736
|
-
s = mod2(-s);
|
|
2737
|
-
return Fp.toBytes(s);
|
|
2738
|
-
}
|
|
2739
|
-
/**
|
|
2740
|
-
* Compares two Ristretto points.
|
|
2741
|
-
* Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals).
|
|
2742
|
-
*/
|
|
2743
|
-
equals(other) {
|
|
2744
|
-
this.assertSame(other);
|
|
2745
|
-
const { X: X1, Y: Y1 } = this.ep;
|
|
2746
|
-
const { X: X2, Y: Y2 } = other.ep;
|
|
2747
|
-
const mod2 = (n) => Fp.create(n);
|
|
2748
|
-
const one = mod2(X1 * Y2) === mod2(Y1 * X2);
|
|
2749
|
-
const two = mod2(Y1 * Y2) === mod2(X1 * X2);
|
|
2750
|
-
return one || two;
|
|
2751
|
-
}
|
|
2752
|
-
is0() {
|
|
2753
|
-
return this.equals(__RistrettoPoint.ZERO);
|
|
2754
|
-
}
|
|
2755
|
-
};
|
|
2756
|
-
// Do NOT change syntax: the following gymnastics is done,
|
|
2757
|
-
// because typescript strips comments, which makes bundlers disable tree-shaking.
|
|
2758
|
-
// prettier-ignore
|
|
2759
|
-
__publicField(__RistrettoPoint, "BASE", (() => new __RistrettoPoint(ed25519_Point.BASE))());
|
|
2760
|
-
// prettier-ignore
|
|
2761
|
-
__publicField(__RistrettoPoint, "ZERO", (() => new __RistrettoPoint(ed25519_Point.ZERO))());
|
|
2762
|
-
// prettier-ignore
|
|
2763
|
-
__publicField(__RistrettoPoint, "Fp", /* @__PURE__ */ (() => Fp)());
|
|
2764
|
-
// prettier-ignore
|
|
2765
|
-
__publicField(__RistrettoPoint, "Fn", /* @__PURE__ */ (() => Fn)());
|
|
2766
|
-
var _RistrettoPoint = __RistrettoPoint;
|
|
2767
|
-
var ristretto255 = { Point: _RistrettoPoint };
|
|
2768
|
-
var ristretto255_hasher = {
|
|
2769
|
-
Point: _RistrettoPoint,
|
|
2770
|
-
/**
|
|
2771
|
-
* Spec: https://www.rfc-editor.org/rfc/rfc9380.html#name-hashing-to-ristretto255. Caveats:
|
|
2772
|
-
* * There are no test vectors
|
|
2773
|
-
* * encodeToCurve / mapToCurve is undefined
|
|
2774
|
-
* * mapToCurve would be `calcElligatorRistrettoMap(scalars[0])`, not ristretto255_map!
|
|
2775
|
-
* * hashToScalar is undefined too, so we just use OPRF implementation
|
|
2776
|
-
* * We cannot re-use 'createHasher', because ristretto255_map is different algorithm/RFC
|
|
2777
|
-
(os2ip -> bytes255ToNumberLE)
|
|
2778
|
-
* * mapToCurve == calcElligatorRistrettoMap, hashToCurve == ristretto255_map
|
|
2779
|
-
* * hashToScalar is undefined in RFC9380 for ristretto, we are using version from OPRF here, using bytes255ToNumblerLE will create different result if we use bytes255ToNumberLE as os2ip
|
|
2780
|
-
* * current version is closest to spec.
|
|
2781
|
-
*/
|
|
2782
|
-
hashToCurve(msg, options) {
|
|
2783
|
-
const DST = (options == null ? void 0 : options.DST) || "ristretto255_XMD:SHA-512_R255MAP_RO_";
|
|
2784
|
-
const xmd = expand_message_xmd(msg, DST, 64, sha512);
|
|
2785
|
-
return ristretto255_hasher.deriveToCurve(xmd);
|
|
2786
|
-
},
|
|
2787
|
-
hashToScalar(msg, options = { DST: _DST_scalar }) {
|
|
2788
|
-
const xmd = expand_message_xmd(msg, options.DST, 64, sha512);
|
|
2789
|
-
return Fn.create(bytesToNumberLE(xmd));
|
|
2790
|
-
},
|
|
2791
|
-
/**
|
|
2792
|
-
* HashToCurve-like construction based on RFC 9496 (Element Derivation).
|
|
2793
|
-
* Converts 64 uniform random bytes into a curve point.
|
|
2794
|
-
*
|
|
2795
|
-
* WARNING: This represents an older hash-to-curve construction, preceding the finalization of RFC 9380.
|
|
2796
|
-
* It was later reused as a component in the newer `hash_to_ristretto255` function defined in RFC 9380.
|
|
2797
|
-
*/
|
|
2798
|
-
deriveToCurve(bytes) {
|
|
2799
|
-
abytes(bytes, 64);
|
|
2800
|
-
const r1 = bytes255ToNumberLE(bytes.subarray(0, 32));
|
|
2801
|
-
const R1 = calcElligatorRistrettoMap(r1);
|
|
2802
|
-
const r2 = bytes255ToNumberLE(bytes.subarray(32, 64));
|
|
2803
|
-
const R2 = calcElligatorRistrettoMap(r2);
|
|
2804
|
-
return new _RistrettoPoint(R1.add(R2));
|
|
2805
|
-
}
|
|
2806
|
-
};
|
|
2807
|
-
var ristretto255_oprf = (() => createORPF({
|
|
2808
|
-
name: "ristretto255-SHA512",
|
|
2809
|
-
Point: _RistrettoPoint,
|
|
2810
|
-
hash: sha512,
|
|
2811
|
-
hashToGroup: ristretto255_hasher.hashToCurve,
|
|
2812
|
-
hashToScalar: ristretto255_hasher.hashToScalar
|
|
2813
|
-
}))();
|
|
2814
|
-
var ED25519_TORSION_SUBGROUP = [
|
|
2815
|
-
"0100000000000000000000000000000000000000000000000000000000000000",
|
|
2816
|
-
"c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a",
|
|
2817
|
-
"0000000000000000000000000000000000000000000000000000000000000080",
|
|
2818
|
-
"26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05",
|
|
2819
|
-
"ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f",
|
|
2820
|
-
"26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85",
|
|
2821
|
-
"0000000000000000000000000000000000000000000000000000000000000000",
|
|
2822
|
-
"c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"
|
|
2823
|
-
];
|
|
2824
|
-
export {
|
|
2825
|
-
ED25519_TORSION_SUBGROUP,
|
|
2826
|
-
_map_to_curve_elligator2_curve25519,
|
|
2827
|
-
ed25519,
|
|
2828
|
-
ed25519_hasher,
|
|
2829
|
-
ed25519ctx,
|
|
2830
|
-
ed25519ph,
|
|
2831
|
-
ristretto255,
|
|
2832
|
-
ristretto255_hasher,
|
|
2833
|
-
ristretto255_oprf,
|
|
2834
|
-
x25519
|
|
2835
|
-
};
|
|
2836
|
-
/*! Bundled license information:
|
|
2837
|
-
|
|
2838
|
-
@noble/curves/utils.js:
|
|
2839
|
-
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
2840
|
-
|
|
2841
|
-
@noble/curves/abstract/modular.js:
|
|
2842
|
-
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
2843
|
-
|
|
2844
|
-
@noble/curves/abstract/curve.js:
|
|
2845
|
-
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
2846
|
-
|
|
2847
|
-
@noble/curves/abstract/edwards.js:
|
|
2848
|
-
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
2849
|
-
|
|
2850
|
-
@noble/curves/abstract/montgomery.js:
|
|
2851
|
-
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
2852
|
-
|
|
2853
|
-
@noble/curves/abstract/oprf.js:
|
|
2854
|
-
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
2855
|
-
|
|
2856
|
-
@noble/curves/ed25519.js:
|
|
2857
|
-
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
2858
|
-
*/
|
|
2859
|
-
//# sourceMappingURL=@noble_curves_ed25519__js.js.map
|