Skip to content

[zklogin] use sha2 for public inputs hash, update vk - #1021

Open
joyqvq wants to merge 3 commits into
mainfrom
joy/sha2-change
Open

[zklogin] use sha2 for public inputs hash, update vk#1021
joyqvq wants to merge 3 commits into
mainfrom
joy/sha2-change

Conversation

@joyqvq

@joyqvq joyqvq commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Updates FastCrypto zkLogin verification to match the V2 SHA-256 transcript implementation in zklogin-circuits.

  1. V2 public-input hashing mirrors encodePublicInputsTranscript and computePublicInputsHash.
  2. Fixed-width encoding and low-253-bit SHA-256 handling mirror src/lib/sha256.ts.
  3. Updates the dev V2 verifying key from v2-main.
  4. Preserves V1 verification and V2-first/V1-fallback rollout behavior.
  5. Adds TypeScript fixture, boundary, validation, and live dev-prover tests.
  6. (a rust sdk used by sui cli not needed for sui protocol change) V2 nonce and address-seed generation mirror src/lib/sha256Transcripts.ts.

@@ -0,0 +1,65 @@
// Copyright (c) Mysten Labs, Inc.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rust functions -> typescript functions:

append_fixed_width_be → bigIntToFixedBytesBE
append_length_prefixed_bytes → encodeLengthPrefixedString
append_length_prefixed_padded_bytes → encodePaddedBytes
sha256_low_253 → sha256 + sha256DigestToField

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant