fix: replace deprecated @noble/curves and @noble/hashes APIs#386
Merged
fix: replace deprecated @noble/curves and @noble/hashes APIs#386
Conversation
Drop class-level @example blocks on KeyManager and EncryptedMaps (strings passed where Uint8Array required, wrong method names) and the IBE usage example in src/index.ts (references EncryptedKey and deriveKey which do not exist, and uses the old ic_vetkd_sdk_utils package name). Fix three method-level examples that called snake_case canister method names directly instead of the camelCase TypeScript wrappers: get_user_rights → getUserRights (key_manager, encrypted_maps) remove_user → removeUser (encrypted_maps)
- ProjPointType → WeierstrassPoint - @noble/hashes/sha256 → @noble/hashes/sha2 - randomPrivateKey() → randomSecretKey() - toRawBytes(true) → toBytes(true) (7 sites) - G1/G2.ProjectivePoint → G1/G2.Point (all occurrences) - Point.fromPrivateKey(sk) → Point.BASE.multiply(Point.Fn.fromBytes(sk)) - G1.normPrivateKeyToScalar() → G1.Point.Fn.fromBytes() - verifyShortSignature() → shortSignatures.hash() + shortSignatures.verify() - G2.CURVE.htfDefaults + manual hash_to_field() → G2.hashToScalar() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5134561 to
4e02c19
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4e02c19 to
ae33563
Compare
Member
Author
|
Note on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@noble/curvesAPIs inutils.ts:ProjPointType→WeierstrassPoint(exportedG1Point/G2Pointtypes)@noble/hashes/sha256→@noble/hashes/sha2randomPrivateKey()→randomSecretKey()toRawBytes(true)→toBytes(true)(7 sites)G1/G2.ProjectivePoint→G1/G2.Point(all occurrences)Point.fromPrivateKey(sk)→Point.BASE.multiply(Point.Fn.fromBytes(sk))G1.normPrivateKeyToScalar()→G1.Point.Fn.fromBytes()verifyShortSignature()→shortSignatures.hash()+shortSignatures.verify()G2.CURVE.htfDefaults+ manualhash_to_field()→G2.hashToScalar()@exampleblocks onKeyManagerandEncryptedMaps(wrong types, non-existent methods) and the IBE usage example insrc/index.tsget_user_rights→getUserRights,remove_user→removeUser)Test plan
pnpm run buildpassespnpm run lintpasses🤖 Generated with Claude Code