real/imagianry part exposure

This commit is contained in:
NikVolf
2019-03-13 12:46:56 +03:00
parent 7395ad6d1d
commit 76c1296cfe
2 changed files with 16 additions and 0 deletions
+8
View File
@@ -92,6 +92,14 @@ impl Fq2 {
}
}
}
pub fn real(&self) -> &Fq {
&self.c0
}
pub fn imaginary(&self) -> &Fq {
&self.c1
}
}
impl FieldElement for Fq2 {
+8
View File
@@ -215,6 +215,14 @@ impl Fq2 {
pub fn pow(&self, exp: arith::U256) -> Self {
Fq2(self.0.pow(exp))
}
pub fn real(&self) -> Fq {
Fq(*self.0.real())
}
pub fn imaginary(&self) -> Fq {
Fq(*self.0.imaginary())
}
}