@@ -13,11 +13,15 @@ const C64: u64 = 0b1_1011;
1313const C128 : u64 = 0b1000_0111 ;
1414const C256 : u64 = 0b100_0010_0101 ;
1515
16- /// Double and inverse double over GF(2^n).
16+ mod sealed {
17+ pub trait Sealed { }
18+ }
19+
20+ /// Double and inverse double over `GF(2^n)` with the lexicographically first polynomial
21+ /// among the irreducible degree `n` polynomials having a minimum number of coefficients.
1722///
18- /// This trait is implemented for 64, 128 and 256 bit block sizes. Big-endian
19- /// order is used.
20- pub trait Dbl {
23+ /// This trait is implemented using big-endian byte order for 64, 128 and 256 bit block sizes.
24+ pub trait Dbl : sealed:: Sealed {
2125 /// Double block. (alternatively: multiply block by x)
2226 ///
2327 /// If most significant bit of the block equals to zero will return
@@ -59,6 +63,8 @@ impl Dbl for Array<u8, U8> {
5963 }
6064}
6165
66+ impl sealed:: Sealed for Array < u8 , U8 > { }
67+
6268impl Dbl for Array < u8 , U16 > {
6369 #[ inline]
6470 fn dbl ( self ) -> Self {
@@ -104,6 +110,8 @@ impl Dbl for Array<u8, U16> {
104110 }
105111}
106112
113+ impl sealed:: Sealed for Array < u8 , U16 > { }
114+
107115impl Dbl for Array < u8 , U32 > {
108116 #[ inline]
109117 fn dbl ( self ) -> Self {
@@ -169,3 +177,5 @@ impl Dbl for Array<u8, U32> {
169177 res
170178 }
171179}
180+
181+ impl sealed:: Sealed for Array < u8 , U32 > { }
0 commit comments