Skip to content

Commit

Permalink
fix: minor type issue for @zk-kit/eddsa-poseidon
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmad committed Mar 29, 2024
1 parent cca4446 commit ee81309
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crypto/ts/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const genRandomSalt = (): bigint => genRandomBabyJubValue();
* @param privKey A private key generated using genPrivKey()
* @returns A BabyJub-compatible private key.
*/
export const formatPrivKeyForBabyJub = (privKey: PrivKey): bigint => BigInt(deriveSecretScalar(privKey));
export const formatPrivKeyForBabyJub = (privKey: PrivKey): bigint => BigInt(deriveSecretScalar(privKey.toString()));

/**
* Losslessly reduces the size of the representation of a public key
Expand All @@ -49,7 +49,7 @@ export const unpackPubKey = (packed: bigint): PubKey => {
* @returns A public key associated with the private key
*/
export const genPubKey = (privKey: PrivKey): PubKey => {
const key = derivePublicKey(privKey);
const key = derivePublicKey(privKey.toString());
return [BigInt(key[0]), BigInt(key[1])];
};

Expand Down
2 changes: 1 addition & 1 deletion domainobjs/ts/commands/PCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class PCommand implements ICommand {
/**
* @notice Signs this command and returns a Signature.
*/
sign = (privKey: PrivKey): Signature => sign(privKey.rawPrivKey, this.hash());
sign = (privKey: PrivKey): Signature => sign(privKey.rawPrivKey.toString(), this.hash());

/**
* @notice Returns true if the given signature is a correct signature of this
Expand Down

0 comments on commit ee81309

Please sign in to comment.