EncodedPoint should be Copy/Clone.
This commit is contained in:
parent
7b1cd7f211
commit
d67109d5d3
@ -579,8 +579,15 @@ pub mod g1 {
|
|||||||
|
|
||||||
curve_impl!("E", G1, G1Affine, G1Prepared, Fq, Fr, G1Uncompressed, G1Compressed);
|
curve_impl!("E", G1, G1Affine, G1Prepared, Fq, Fr, G1Uncompressed, G1Compressed);
|
||||||
|
|
||||||
|
#[derive(Copy)]
|
||||||
pub struct G1Uncompressed([u8; 96]);
|
pub struct G1Uncompressed([u8; 96]);
|
||||||
|
|
||||||
|
impl Clone for G1Uncompressed {
|
||||||
|
fn clone(&self) -> G1Uncompressed {
|
||||||
|
G1Uncompressed(self.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl AsRef<[u8]> for G1Uncompressed {
|
impl AsRef<[u8]> for G1Uncompressed {
|
||||||
fn as_ref(&self) -> &[u8] {
|
fn as_ref(&self) -> &[u8] {
|
||||||
&self.0
|
&self.0
|
||||||
@ -688,8 +695,15 @@ pub mod g1 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Copy)]
|
||||||
pub struct G1Compressed([u8; 48]);
|
pub struct G1Compressed([u8; 48]);
|
||||||
|
|
||||||
|
impl Clone for G1Compressed {
|
||||||
|
fn clone(&self) -> G1Compressed {
|
||||||
|
G1Compressed(self.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl AsRef<[u8]> for G1Compressed {
|
impl AsRef<[u8]> for G1Compressed {
|
||||||
fn as_ref(&self) -> &[u8] {
|
fn as_ref(&self) -> &[u8] {
|
||||||
&self.0
|
&self.0
|
||||||
@ -1135,8 +1149,15 @@ pub mod g2 {
|
|||||||
|
|
||||||
curve_impl!("E'", G2, G2Affine, G2Prepared, Fq2, Fr, G2Uncompressed, G2Compressed);
|
curve_impl!("E'", G2, G2Affine, G2Prepared, Fq2, Fr, G2Uncompressed, G2Compressed);
|
||||||
|
|
||||||
|
#[derive(Copy)]
|
||||||
pub struct G2Uncompressed([u8; 192]);
|
pub struct G2Uncompressed([u8; 192]);
|
||||||
|
|
||||||
|
impl Clone for G2Uncompressed {
|
||||||
|
fn clone(&self) -> G2Uncompressed {
|
||||||
|
G2Uncompressed(self.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl AsRef<[u8]> for G2Uncompressed {
|
impl AsRef<[u8]> for G2Uncompressed {
|
||||||
fn as_ref(&self) -> &[u8] {
|
fn as_ref(&self) -> &[u8] {
|
||||||
&self.0
|
&self.0
|
||||||
@ -1268,8 +1289,15 @@ pub mod g2 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Copy)]
|
||||||
pub struct G2Compressed([u8; 96]);
|
pub struct G2Compressed([u8; 96]);
|
||||||
|
|
||||||
|
impl Clone for G2Compressed {
|
||||||
|
fn clone(&self) -> G2Compressed {
|
||||||
|
G2Compressed(self.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl AsRef<[u8]> for G2Compressed {
|
impl AsRef<[u8]> for G2Compressed {
|
||||||
fn as_ref(&self) -> &[u8] {
|
fn as_ref(&self) -> &[u8] {
|
||||||
&self.0
|
&self.0
|
||||||
|
@ -213,6 +213,8 @@ pub trait EncodedPoint: Sized +
|
|||||||
Sync +
|
Sync +
|
||||||
AsRef<[u8]> +
|
AsRef<[u8]> +
|
||||||
AsMut<[u8]> +
|
AsMut<[u8]> +
|
||||||
|
Clone +
|
||||||
|
Copy +
|
||||||
'static
|
'static
|
||||||
{
|
{
|
||||||
type Affine: CurveAffine;
|
type Affine: CurveAffine;
|
||||||
|
Loading…
Reference in New Issue
Block a user