Skip to content

Commit 25309d6

Browse files
committed
export the rest
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent d2202e4 commit 25309d6

File tree

2 files changed

+123
-123
lines changed

2 files changed

+123
-123
lines changed

marshaler.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ func (z *Zr) UnmarshalJSON(raw []byte) error {
2020
return err
2121
}
2222

23-
z.curveID = ce.CurveID
24-
z.zr = Curves[z.curveID].NewZrFromBytes(ce.ElementBytes).zr
23+
z.CID = ce.CurveID
24+
z.Zr = Curves[z.CID].NewZrFromBytes(ce.ElementBytes).Zr
2525

2626
return nil
2727
}
2828

2929
func (z *Zr) MarshalJSON() ([]byte, error) {
3030
return json.Marshal(&curveElement{
31-
CurveID: z.curveID,
31+
CurveID: z.CID,
3232
ElementBytes: z.Bytes(),
3333
})
3434
}
@@ -40,19 +40,19 @@ func (g *G1) UnmarshalJSON(raw []byte) error {
4040
return err
4141
}
4242

43-
g.curveID = ce.CurveID
44-
g1, err := Curves[g.curveID].NewG1FromBytes(ce.ElementBytes)
43+
g.CID = ce.CurveID
44+
g1, err := Curves[g.CID].NewG1FromBytes(ce.ElementBytes)
4545
if err != nil {
4646
return err
4747
}
4848

49-
g.g1 = g1.g1
49+
g.G1 = g1.G1
5050
return nil
5151
}
5252

5353
func (g *G1) MarshalJSON() ([]byte, error) {
5454
return json.Marshal(&curveElement{
55-
CurveID: g.curveID,
55+
CurveID: g.CID,
5656
ElementBytes: g.Bytes(),
5757
})
5858
}
@@ -64,19 +64,19 @@ func (g *G2) UnmarshalJSON(raw []byte) error {
6464
return err
6565
}
6666

67-
g.curveID = ce.CurveID
68-
g2, err := Curves[g.curveID].NewG2FromBytes(ce.ElementBytes)
67+
g.CID = ce.CurveID
68+
g2, err := Curves[g.CID].NewG2FromBytes(ce.ElementBytes)
6969
if err != nil {
7070
return err
7171
}
7272

73-
g.g2 = g2.g2
73+
g.G2 = g2.G2
7474
return nil
7575
}
7676

7777
func (g *G2) MarshalJSON() ([]byte, error) {
7878
return json.Marshal(&curveElement{
79-
CurveID: g.curveID,
79+
CurveID: g.CID,
8080
ElementBytes: g.Bytes(),
8181
})
8282
}
@@ -88,19 +88,19 @@ func (g *Gt) UnmarshalJSON(raw []byte) error {
8888
return err
8989
}
9090

91-
g.curveID = ce.CurveID
92-
gt, err := Curves[g.curveID].NewGtFromBytes(ce.ElementBytes)
91+
g.CID = ce.CurveID
92+
gt, err := Curves[g.CID].NewGtFromBytes(ce.ElementBytes)
9393
if err != nil {
9494
return err
9595
}
9696

97-
g.gt = gt.gt
97+
g.GT = gt.GT
9898
return nil
9999
}
100100

101101
func (g *Gt) MarshalJSON() ([]byte, error) {
102102
return json.Marshal(&curveElement{
103-
CurveID: g.curveID,
103+
CurveID: g.CID,
104104
ElementBytes: g.Bytes(),
105105
})
106106
}

0 commit comments

Comments
 (0)