Skip to content

Commit e78fa25

Browse files
author
gefeili
committed
Refactor of MayoParameters
1 parent 9ef9e78 commit e78fa25

File tree

1 file changed

+12
-19
lines changed

1 file changed

+12
-19
lines changed

core/src/main/java/org/bouncycastle/pqc/crypto/mayo/MayoParameters.java

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class MayoParameters
1111
86 - 8, // v = n - o = 78
1212
10 * 8 + 1, // A_cols = k * o + 1 = 10 * 8 + 1 = 81
1313
10, // k
14-
16, // q
14+
// q
1515
39, // m_bytes
1616
312, // O_bytes
1717
39, // v_bytes
@@ -26,7 +26,7 @@ public class MayoParameters
2626
new byte[]{8, 1, 1, 0}, // f_tail_arr
2727
24, // salt_bytes
2828
32, // digest_bytes
29-
16, // pk_seed_bytes
29+
// pk_seed_bytes
3030
24 // sk_seed_bytes
3131
);
3232

@@ -39,7 +39,7 @@ public class MayoParameters
3939
81 - 17, // v = 64
4040
4 * 17 + 1, // A_cols = 4 * 17 + 1 = 69
4141
4, // k
42-
16, // q
42+
// q
4343
32, // m_bytes
4444
544, // O_bytes
4545
32, // v_bytes
@@ -54,7 +54,7 @@ public class MayoParameters
5454
new byte[]{8, 0, 2, 8}, // f_tail_arr
5555
24, // salt_bytes
5656
32, // digest_bytes
57-
16, // pk_seed_bytes
57+
// pk_seed_bytes
5858
24 // sk_seed_bytes
5959
);
6060

@@ -67,7 +67,7 @@ public class MayoParameters
6767
118 - 10, // v = 108
6868
11 * 10 + 1, // A_cols = 11 * 10 + 1 = 111
6969
11, // k
70-
16, // q
70+
// q
7171
54, // m_bytes
7272
540, // O_bytes
7373
54, // v_bytes
@@ -82,7 +82,7 @@ public class MayoParameters
8282
new byte[]{8, 0, 1, 7}, // f_tail_arr
8383
32, // salt_bytes
8484
48, // digest_bytes
85-
16, // pk_seed_bytes
85+
// pk_seed_bytes
8686
32 // sk_seed_bytes
8787
);
8888

@@ -95,7 +95,7 @@ public class MayoParameters
9595
154 - 12, // v = 142
9696
12 * 12 + 1, // A_cols = 12 * 12 + 1 = 145
9797
12, // k
98-
16, // q
98+
// q
9999
71, // m_bytes
100100
852, // O_bytes
101101
71, // v_bytes
@@ -110,7 +110,7 @@ public class MayoParameters
110110
new byte[]{4, 0, 8, 1}, // f_tail_arr
111111
40, // salt_bytes
112112
64, // digest_bytes
113-
16, // pk_seed_bytes
113+
// pk_seed_bytes
114114
40 // sk_seed_bytes
115115
);
116116

@@ -122,7 +122,7 @@ public class MayoParameters
122122
private final int v;
123123
private final int ACols;
124124
private final int k;
125-
private final int q;
125+
//private final int q; q = 16
126126
private final int mBytes;
127127
private final int OBytes;
128128
private final int vBytes;
@@ -136,13 +136,13 @@ public class MayoParameters
136136
private final byte[] fTailArr;
137137
private final int saltBytes;
138138
private final int digestBytes;
139-
private final int pkSeedBytes;
139+
private static final int pkSeedBytes = 16;
140140
private final int skSeedBytes;
141141

142-
private MayoParameters(String name, int n, int m, int mVecLimbs, int o, int v, int ACols, int k, int q,
142+
private MayoParameters(String name, int n, int m, int mVecLimbs, int o, int v, int ACols, int k,
143143
int mBytes, int OBytes, int vBytes, int rBytes, int P1Bytes, int P2Bytes,
144144
int cskBytes, int cpkBytes, int sigBytes, int[] fTail, byte[] fTailArr,
145-
int saltBytes, int digestBytes, int pkSeedBytes, int skSeedBytes)
145+
int saltBytes, int digestBytes, int skSeedBytes)
146146
{
147147
this.name = name;
148148
this.n = n;
@@ -152,7 +152,6 @@ private MayoParameters(String name, int n, int m, int mVecLimbs, int o, int v, i
152152
this.v = v;
153153
this.ACols = ACols;
154154
this.k = k;
155-
this.q = q;
156155
this.mBytes = mBytes;
157156
this.OBytes = OBytes;
158157
this.vBytes = vBytes;
@@ -166,7 +165,6 @@ private MayoParameters(String name, int n, int m, int mVecLimbs, int o, int v, i
166165
this.fTailArr = fTailArr;
167166
this.saltBytes = saltBytes;
168167
this.digestBytes = digestBytes;
169-
this.pkSeedBytes = pkSeedBytes;
170168
this.skSeedBytes = skSeedBytes;
171169
}
172170

@@ -210,11 +208,6 @@ public int getK()
210208
return k;
211209
}
212210

213-
public int getQ()
214-
{
215-
return q;
216-
}
217-
218211
public int getMBytes()
219212
{
220213
return mBytes;

0 commit comments

Comments
 (0)