Skip to content

Commit

Permalink
Fixed KeylessSignature serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
hardsetting committed Mar 19, 2024
1 parent 1ab6404 commit 8e690e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@
"typedoc": "^0.25.4",
"typescript": "^5.3.3"
},
"version": "1.10.0-zeta.0"
"version": "1.10.0-zeta.1"
}
15 changes: 4 additions & 11 deletions src/core/crypto/keyless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class KeylessPublicKey extends AccountPublicKey {
pepper: HexInput;
}): KeylessPublicKey {
computeAddressSeed(args);
return new KeylessPublicKey(args.iss,computeAddressSeed(args));
return new KeylessPublicKey(args.iss, computeAddressSeed(args));
}
}

Expand Down Expand Up @@ -185,18 +185,14 @@ export class OpenIdSignatureOrZkProof extends Signature {
}
}

export class Groth16Zkp extends Serializable{
export class Groth16Zkp extends Serializable {
a: Uint8Array;

b: Uint8Array;

c: Uint8Array;

constructor(args: {
a: HexInput,
b: HexInput,
c: HexInput,
}) {
constructor(args: { a: HexInput; b: HexInput; c: HexInput }) {
super();
const { a, b, c } = args;
this.a = Hex.fromHexInput(a).toUint8Array();
Expand Down Expand Up @@ -234,13 +230,11 @@ export class SignedGroth16Signature extends Signature {

readonly trainingWheelsSignature?: EphemeralSignature;


constructor(args: {
proof: Groth16Zkp;
extraField?: string;
overrideAudVal?: string;
trainingWheelsSignature?: EphemeralSignature;

}) {
super();
const { proof, trainingWheelsSignature, extraField, overrideAudVal } = args;
Expand Down Expand Up @@ -276,7 +270,6 @@ export class SignedGroth16Signature extends Signature {
serializer.serializeOptionStr(this.extraField);
serializer.serializeOptionStr(this.overrideAudVal);
serializer.serializeOption(this.trainingWheelsSignature);

}

static deserialize(deserializer: Deserializer): SignedGroth16Signature {
Expand Down Expand Up @@ -455,9 +448,9 @@ export class KeylessSignature extends Signature {
}

static deserialize(deserializer: Deserializer): KeylessSignature {
const openIdSignatureOrZkProof = OpenIdSignatureOrZkProof.deserialize(deserializer);
const jwtHeader = deserializer.deserializeStr();
const expiryDateSecs = deserializer.deserializeU64();
const openIdSignatureOrZkProof = OpenIdSignatureOrZkProof.deserialize(deserializer);
const ephemeralPublicKey = EphemeralPublicKey.deserialize(deserializer);
const ephemeralSignature = EphemeralSignature.deserialize(deserializer);
return new KeylessSignature({
Expand Down

0 comments on commit 8e690e4

Please sign in to comment.