Skip to content

Commit

Permalink
fixed warnings + renamed example file to increase pub score
Browse files Browse the repository at this point in the history
  • Loading branch information
JannesNebendahl committed Aug 28, 2024
1 parent 222f1cb commit fa0d7d6
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 42 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1
- renamed example file to make it accessible for pub.dev
- fixed warnings to increase pub score

## 1.0.0
- Initial Version
- Implementation based on java and c ref implementation of Dilithium
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

analyzer:
errors:
constant_identifier_names: ignore
include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions lib/src/dilithium.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ class Dilithium {
/// Returns:
/// - The signature as a `Uint8List`.
static Uint8List sign(DilithiumPrivateKey prv, Uint8List M) {
var spec = prv.spec;
var CRYPTO_BYTES = Utils.getSigLength(spec);
var sig = Uint8List(CRYPTO_BYTES);
final spec = prv.spec;
final cryptoBytes = Utils.getSigLength(spec);
var sig = Uint8List(cryptoBytes);

var conc = Utils.concat([prv.tr, M]);
var mu = Utils.mucrh(conc);
Expand Down Expand Up @@ -234,10 +234,10 @@ class Dilithium {
/// Returns:
/// - `true` if the signature is valid, `false` otherwise.
static bool verify(DilithiumPublicKey pk, Uint8List sig, Uint8List M) {
var spec = pk.spec;
var CRYPTO_BYTES = Utils.getSigLength(spec);
final spec = pk.spec;
final cryptoBytes = Utils.getSigLength(spec);

if (sig.length != CRYPTO_BYTES) {
if (sig.length != cryptoBytes) {
return false;
}

Expand Down
2 changes: 2 additions & 0 deletions lib/src/dilithium_private_key.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: non_constant_identifier_names

import 'dart:typed_data';
import 'package:dilithium_crypto/dilithium_crypto.dart';
import 'package:dilithium_crypto/src/packing_utils.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/dilithium_public_key.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

// ignore_for_file: non_constant_identifier_names

import 'dart:typed_data';

Expand Down
56 changes: 34 additions & 22 deletions lib/src/packing_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,38 +128,44 @@ class PackingUtils {
/// - `IllegalEta` if `eta` is not 2 or 4.
static Uint8List packPrvKey(int eta, Uint8List rho, Uint8List tr, Uint8List K, PolyVec t0, PolyVec s1, PolyVec s2) {
int off = 0;
int POLYETA_PACKEDBYTES;
int polyEtaPackedBytes;
switch (eta) {
case 2:
POLYETA_PACKEDBYTES = 96;
polyEtaPackedBytes = 96;
break;
case 4:
POLYETA_PACKEDBYTES = 128;
polyEtaPackedBytes = 128;
break;
default:
throw IllegalEta(eta);
}

final int CRYPTO_SECRETKEYBYTES = (2 * Dilithium.SEEDBYTES + Dilithium.CRHBYTES + s1.length * POLYETA_PACKEDBYTES + s2.length * POLYETA_PACKEDBYTES + s2.length * Dilithium.POLYT0_PACKEDBYTES);
Uint8List buf = Uint8List(CRYPTO_SECRETKEYBYTES);
final int cryptoSecreteKeyByte = (2 * Dilithium.SEEDBYTES + Dilithium.CRHBYTES + s1.length * polyEtaPackedBytes + s2.length * polyEtaPackedBytes + s2.length * Dilithium.POLYT0_PACKEDBYTES);
Uint8List buf = Uint8List(cryptoSecreteKeyByte);

for (int i = 0; i < Dilithium.SEEDBYTES; i++) buf[off + i] = rho[i];
for (int i = 0; i < Dilithium.SEEDBYTES; i++) {
buf[off + i] = rho[i];
}
off += Dilithium.SEEDBYTES;

for (int i = 0; i < Dilithium.SEEDBYTES; i++) buf[off + i] = K[i];
for (int i = 0; i < Dilithium.SEEDBYTES; i++) {
buf[off + i] = K[i];
}
off += Dilithium.SEEDBYTES;

for (int i = 0; i < Dilithium.CRHBYTES; i++) buf[off + i] = tr[i];
for (int i = 0; i < Dilithium.CRHBYTES; i++) {
buf[off + i] = tr[i];
}
off += Dilithium.CRHBYTES;

for (int i = 0; i < s1.length; i++) {
s1.poly[i].etapack(eta, buf, off);
off += POLYETA_PACKEDBYTES;
off += polyEtaPackedBytes;
}

for (int i = 0; i < s2.length; i++) {
s2.poly[i].etapack(eta, buf, off);
off += POLYETA_PACKEDBYTES;
off += polyEtaPackedBytes;
}

for (int i = 0; i < t0.length; i++) {
Expand All @@ -178,10 +184,12 @@ class PackingUtils {
/// Returns:
/// - A `Uint8List` object containing the packed public key.
static Uint8List packPubKey(Uint8List rho, PolyVec t) {
int CRYPTO_PUBLICKEYBYTES = Dilithium.SEEDBYTES + t.length * Dilithium.POLYT1_PACKEDBYTES;
int cryptoPublicBytes = Dilithium.SEEDBYTES + t.length * Dilithium.POLYT1_PACKEDBYTES;

Uint8List pk = Uint8List(CRYPTO_PUBLICKEYBYTES);
for (int i = 0; i < Dilithium.SEEDBYTES; i++) pk[i] = rho[i];
Uint8List pk = Uint8List(cryptoPublicBytes);
for (int i = 0; i < Dilithium.SEEDBYTES; i++) {
pk[i] = rho[i];
}

for (int i = 0; i < t.length; i++) {
t.poly[i].t1pack(pk, Dilithium.SEEDBYTES + i * Dilithium.POLYT1_PACKEDBYTES);
Expand All @@ -199,19 +207,23 @@ class PackingUtils {
/// - `z`: A `PolyVec` object representing the polynomial vector `z`.
/// - `h`: A `PolyVec` object representing the polynomial vector `h`.
static void packSig(int gamma1, int omega, Uint8List sig, Uint8List c, PolyVec z, PolyVec h) {
int POLYZ_PACKEDBYTES = getPolyZPackedBytes(gamma1);
int polyZPackedBytes = getPolyZPackedBytes(gamma1);

int off = 0;
for (int i = 0; i < Dilithium.SEEDBYTES; i++) sig[i] = c[i];
for (int i = 0; i < Dilithium.SEEDBYTES; i++) {
sig[i] = c[i];
}
off += Dilithium.SEEDBYTES;

for (int i = 0; i < z.length; i++) {
z.poly[i].zpack(gamma1, sig, off);
off += POLYZ_PACKEDBYTES;
off += polyZPackedBytes;
}

// Encode h
for (int i = 0; i < omega + h.length; i++) sig[off + i] = 0;
for (int i = 0; i < omega + h.length; i++) {
sig[off + i] = 0;
}
int k = 0;
for (int i = 0; i < h.length; i++) {
for (int j = 0; j < Dilithium.N; j++) {
Expand All @@ -231,11 +243,11 @@ class PackingUtils {
/// - `w`: A `PolyVec` object representing the polynomial vector `w`.
/// - `sig`: A `Uint8List` to store the packed `w1` components.
static void packw1(int gamma2, PolyVec w, Uint8List sig) {
int POLYW1_PACKEDBYTES = getPolyW1PackedBytes(gamma2);
int polyW1Packedbytes = getPolyW1PackedBytes(gamma2);
int off = 0;
for (int i = 0; i < w.length; i++) {
w.poly[i].w1pack(gamma2, sig, off);
off += POLYW1_PACKEDBYTES;
off += polyW1Packedbytes;
}
}

Expand Down Expand Up @@ -306,7 +318,7 @@ class PackingUtils {
}

static DilithiumPrivateKey unpackPrivateKey(DilithiumParameterSpec parameterSpec, Uint8List bytes) {
final int POLYETA_PACKEDBYTES = getPolyEtaPackedBytes(parameterSpec.eta);
final int polyEtaPackedBytes = getPolyEtaPackedBytes(parameterSpec.eta);

int off = 0;
Uint8List rho = Uint8List.sublistView(bytes, off, off + Dilithium.SEEDBYTES);
Expand All @@ -321,13 +333,13 @@ class PackingUtils {
PolyVec s1 = PolyVec(parameterSpec.l);
for (int i = 0; i < parameterSpec.l; i++) {
s1.poly[i] = _etaunpack(parameterSpec.eta, bytes, off);
off += POLYETA_PACKEDBYTES;
off += polyEtaPackedBytes;
}

PolyVec s2 = PolyVec(parameterSpec.k);
for (int i = 0; i < parameterSpec.k; i++) {
s2.poly[i] = _etaunpack(parameterSpec.eta, bytes, off);
off += POLYETA_PACKEDBYTES;
off += polyEtaPackedBytes;
}

PolyVec t0 = PolyVec(parameterSpec.k);
Expand Down
12 changes: 6 additions & 6 deletions lib/src/poly.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ class Poly {
/// Throws:
/// - `IllegalEta` if `eta` is not 2 or 4.
static Poly genRandom(Uint8List rho, int eta, int nonce) {
int POLY_UNIFORM_ETA_NBLOCKS;
int polyUniformEtaNBlocks;
if (eta == 2) {
POLY_UNIFORM_ETA_NBLOCKS = ((136 + Dilithium.STREAM256_BLOCKBYTES - 1) ~/ Dilithium.STREAM256_BLOCKBYTES);
polyUniformEtaNBlocks = ((136 + Dilithium.STREAM256_BLOCKBYTES - 1) ~/ Dilithium.STREAM256_BLOCKBYTES);
} else if (eta == 4) {
POLY_UNIFORM_ETA_NBLOCKS = ((227 + Dilithium.STREAM256_BLOCKBYTES - 1) ~/ Dilithium.STREAM256_BLOCKBYTES);
polyUniformEtaNBlocks = ((227 + Dilithium.STREAM256_BLOCKBYTES - 1) ~/ Dilithium.STREAM256_BLOCKBYTES);
} else {
throw IllegalEta(eta);
}
Expand All @@ -107,7 +107,7 @@ class Poly {
non[1] = ((nonce >> 8) & 0xFF);
s.update(non, 0, 2);

var bb = Uint8List(POLY_UNIFORM_ETA_NBLOCKS * Dilithium.STREAM256_BLOCKBYTES);
var bb = Uint8List(polyUniformEtaNBlocks * Dilithium.STREAM256_BLOCKBYTES);
s.doOutput(bb, 0, bb.length);

Poly pre = Poly(Dilithium.N);
Expand Down Expand Up @@ -212,9 +212,9 @@ class Poly {
/// Returns:
/// - A polynomial `Poly` with coefficients sampled uniformly at random.
static Poly genUniformRandom(Uint8List rho, int nonce) {
final int POLY_UNIFORM_NBLOCKS = ((768 + Dilithium.STREAM128_BLOCKBYTES - 1) ~/ Dilithium.STREAM128_BLOCKBYTES);
final int polyUniformNBlocks = ((768 + Dilithium.STREAM128_BLOCKBYTES - 1) ~/ Dilithium.STREAM128_BLOCKBYTES);
int ctr, off;
int buflen = POLY_UNIFORM_NBLOCKS * Dilithium.STREAM128_BLOCKBYTES;
int buflen = polyUniformNBlocks * Dilithium.STREAM128_BLOCKBYTES;
var buf = Uint8List(buflen + 2);

var s = SHAKEDigest(128);
Expand Down
12 changes: 9 additions & 3 deletions lib/src/poly_vec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,23 @@ class PolyVec {

/// Reduces each `Poly` in the vector by modulo `Dilithium.Q`.
void reduce() {
poly.forEach((p) => p.reduce());
for (var p in poly) {
p.reduce();
}
}

/// Applies the inverse NTT to each `Poly` in the vector and converts to Montgomery form.
void invnttTomont() {
poly.forEach((p) => p.invnttTomont());
for (var p in poly) {
p.invnttTomont();
}
}

/// Adds `Dilithium.Q` to each `Poly` in the vector and reduces by modulo `Dilithium.Q`.
void caddq() {
poly.forEach((p) => p.caddq());
for (var p in poly) {
p.caddq();
}
}

/// Applies the power rounding to each `Poly` in the vector.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dilithium_crypto
description: Dart implementation of the Dilithium signature scheme, which supports all 3 security levels (2, 3, 5).
version: 1.0.0
version: 1.0.1
repository: https://github.com/JannesNebendahl/dilithium
topics:
- cryptography
Expand Down
6 changes: 3 additions & 3 deletions test/packing_utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void main(){
expect(sig, expected);
});

List<PolyVec> _getA(){
List<PolyVec> getA(){
return [
mockPolyVec([
[1682926, 4935596, 5554513, 1083260, 6792170, 8082604, 4039519, 552642, 5923948, 6131267, 2854525, 4207590, 7551778, 506231, 1665840, 6314218, 5320288, 6945266, 4461624, 2543718, 2551748, 3366562, 7383134, 8077812, 2085638, 6878054, 3665877, 555142, 2418479, 7206173, 5554353, 1421158, 3353670, 3226199, 5835209, 3168146, 604798, 8062901, 6296127, 4530640, 7923409, 6817622, 7534136, 6091562, 7311550, 1361354, 3081898, 1359315, 2897912, 7603752, 6518898, 85462, 2466235, 6525317, 1812307, 4252046, 2257401, 1751474, 5177119, 3532567, 3474240, 535044, 7788754, 1430524, 7717520, 7981649, 61516, 6955883, 5920159, 8266672, 2473721, 7717823, 2862353, 927345, 1329617, 1280936, 2732976, 8326639, 1029837, 1509306, 6753065, 6659957, 5611735, 156328, 5477409, 5559049, 4265627, 5950878, 6960543, 2326380, 4920041, 2110806, 464318, 839824, 5935308, 7215023, 120269, 6658199, 4638237, 95199, 476188, 5045778, 7890438, 2685778, 289517, 3580375, 1337092, 6681911, 6560958, 1413859, 873727, 5938596, 2657682, 5609553, 3129641, 3620403, 4087725, 7418681, 283241, 7552454, 1439223, 368158, 6421416, 928652, 4581378, 6665035, 4286202, 1801947, 3924392, 3043822, 4594835, 5031556, 7059134, 2930824, 3908989, 3597615, 4549827, 3197873, 4243171, 3700871, 4869536, 2667249, 3346775, 4909726, 5952937, 3046053, 3560361, 5766039, 5048260, 2249406, 8202513, 996869, 292717, 1211198, 6729225, 3415892, 1464767, 7950722, 5881170, 4403384, 2049357, 7558669, 2080668, 5835748, 5675490, 5231048, 3543745, 7165497, 6453254, 5457610, 6679552, 3581703, 5194424, 7957913, 8113085, 2882983, 5294182, 4995453, 1427913, 6932393, 8271020, 4744858, 3839386, 1419352, 1497556, 7328857, 8364797, 3349731, 711571, 6837528, 4911380, 2212861, 7218374, 3697280, 3325455, 6328871, 2500881, 6590828, 3350307, 7249763, 8362147, 6850014, 924586, 5575913, 7144871, 2858089, 8297285, 4940557, 7714167, 714340, 748641, 6060003, 337074, 3775557, 7582022, 782299, 7937734, 4281004, 7829069, 4107968, 6052796, 5709509, 6626414, 7670227, 6234602, 5967359, 2094988, 3782344, 344017, 4235743, 8041584, 4675844, 6286611, 3439623, 5714577, 6791866, 1957050, 6718333, 7084234, 2359849, 1963410, 6054306, 6617477, 1767662, 3971004, 7685620, 6964093, 6796847, 7721946, 2379459, 722603, 4142962, 1240906, 7390626, 7024003, 6998370],
Expand Down Expand Up @@ -209,7 +209,7 @@ void main(){
[4866231, 8458323, 5806608, 9927378, 12101883, 13913681, 13879618, 14588502, 9681531, 9663223, 4260756, 12357110, 4106626, 8539224, 11162790, 9932260, -1551170, 6251524, -3109071, -2382891, 4675078, 5710896, 4909005, 9718869, -684175, 2113299, -1130365, 1328697, 9118797, 755607, 6773013, 4729975, -3655807, 507305, -9172847, -3572291, 1380331, 3318591, -2124953, 4314999, -5626285, 629801, -5280385, 1148253, 3765569, -852591, 6531618, 12529892, 6374064, 5617122, 6844691, -1026089, 5515933, 11806341, 5689529, 8156265, 9998145, 11403903, 12748864, 9418452, 7532416, 10495768, 11631456, 10320324, -7010448, -2814626, -234294, 1956088, -1532920, -2366480, -11671728, -5252528, -12842210, -17036908, -5184618, -8466532, -10429639, -11806803, -4845612, -6291206, -16232705, -17589493, -9662759, -15656739, -2423009, -10374571, -7862292, -8012992, 3431149, 103665, -1944358, -9570740, -4691510, -8839422, -3339628, 1607356, -1919131, -763253, 5911544, 141644, -2483419, 274857, -3836172, -4305998, 10921988, 3543692, 9389373, 11187831, 5431264, -234938, -811379, -2619983, -4389299, -2829653, -5481620, -1757380, -1513202, -3287332, -2659619, 3677913, -4417856, -3083022, 3620644, -1933258, 6728459, -165757, 10038597, 1986385, 4345871, 7482745, 1349308, 2054232, 10812969, 5205239, 13399220, 17750840, 5878140, 12757912, 10081063, 4716797, 1852161, -3276383, 2291098, 3688596, -1054674, -40962, 5126900, 1691784, 8381558, 7040070, 9562032, 9318100, 3557713, 3437521, 3524938, 7520892, -741089, 3916331, -13794, -6610152, 702834, -481258, -2785495, -3098097, 6675224, -810694, 9371182, 5726456, -5460042, -3045432, 775842, 7179744, -8243948, -5573214, -1303702, 3868408, -5545200, -13279328, -11226062, -9220138, -8601483, -5402613, -5111811, -3103685, -7345967, -6999643, 2439085, -3243007, -4367026, -10940030, -10186618, -9098426, -653330, 5155792, 14110817, 6566725, 3375340, 1920978, -8216239, -985027, -322988, -2693774, -2810455, 2732357, -4547626, -4402520, -12498195, -5156575, -5654441, 1876861, -7460519, -12316189, 2017265, -615721, 1648232, 6616880, -4396711, -6184471, -13864753, -10786937, -6044146, -6951932, 118543, -2383961, -6809827, -4505537, -8750634, -2267066, -6967565, -4924589, -11620653, -13547641, -6174363, -8057287, -3916398, 3410544, -7447186, 853964, -1443161, 6913335, -5146995, -7956135, -16278160, -12992982, 1423611, 943753, -10521750, -3198438, 5914412, 1158856, -6459410, -2786654, 6125554, 2792036, 1050739, 3259163],
[-3536909, -1207117, 1621802, -2628352, -6541201, -306639, -6078549, -13444891, -2680155, 4748663, 2437580, -1065348, -1636776, -2926420, -157433, 1447041, -9551664, -7162244, -18339425, -13174375, -8869288, -10790942, -10361545, -13486485, -9958889, -6078481, -5892845, 457643, -3817856, -11646054, -15097688, -13493206, 2812574, 7373858, -764499, 5660399, -5882687, 2050263, -2308024, -2056500, -6132514, -10163778, -3873188, -333300, -2767720, -689158, -6920166, -7042952, 2924672, -815844, 5956973, 5142147, 3366298, 2109588, 122338, 3244596, -3368046, 2865846, -7608259, -392657, 6688449, 5466157, 2462575, 5305071, -8980833, -8593671, -8549835, -15565801, -10686510, -2807044, -4226449, -3504457, 1832554, 9599828, 1496567, -6544881, 1035050, -4336192, -11683850, -5686860, -11696105, -5079399, -5218166, -13288806, -6052144, -13144416, -3692930, -2884594, 2871935, 221005, -7008323, -1545625, -498120, -4154562, -11345874, -5929844, -92096, -2681142, 3160785, 7218257, -8601798, -3647012, -5450945, -6360185, 32478, 8055622, -7780666, -540942, -3569680, -1018446, -6226958, -12070552, -2502797, -10188055, -1171327, -8633113, -10705398, -16272370, -8616825, -15097883, -6714516, -8325428, -2977313, -7146655, -2380699, -1309461, -8581263, -781313, 7326248, 9846260, 1821836, -71804, 13312425, 11629209, 3694035, 10793679, 12612407, 13500619, 12452983, 8435459, 2927938, 8663832, 4248794, -2147424, 8710962, 16858636, 10839113, 17705013, 19511141, 16714701, 17363364, 10515270, 3474627, 8605825, 12561070, 15479530, 14114191, 13491241, 17158547, 22318593, 3125768, 11459668, 8387697, 6129727, -48336, 1286060, 2779325, 3257907, 9818285, 7786669, 13436980, 19231586, 12484001, 10090115, 5364233, 9375307, -781891, 3938283, -1057773, -3390467, 8617748, 8282164, 4231520, 3883416, -4988244, -7209644, -6544047, -6175301, -6648971, -1951859, 5053855, -2104773, -6170782, -6627458, -1697635, -460761, -9516223, -11671579, -9829613, -3425397, -267415, -8120671, -7240225, -759833, -8599818, -396794, -6888452, -11543488, -640803, -5555427, -1219785, 1618107, -2752857, 4996929, -171335, 6318323, -2008274, 5637316, -6475473, -1329613, -3825420, -3420414, 1152382, 3227656, 7985992, 8004586, 10796177, 12390181, 8864036, 3569482, 6581719, 9604603, -2494412, -1047150, 1349918, 7688252, 5956380, -360442, 1464920, 2554158, 10704613, 10085419, 1897640, 3420432, -1188163, -8727847, 2848915, 1946111, -2284809, 2439995, 2568703, 3876435, 2139540, 8658628, 10740126, 6539750]
]);
List<PolyVec> A = _getA();
List<PolyVec> A = getA();

DilithiumPrivateKey key = PackingUtils.unpackPrivateKey(DilithiumParameterSpec.LEVEL2, prvBytes);

Expand Down Expand Up @@ -240,7 +240,7 @@ void main(){
[586, 478, 69, 862, 543, 973, 257, 541, 810, 572, 94, 565, 589, 1011, 58, 319, 989, 716, 736, 977, 333, 484, 728, 561, 354, 814, 356, 134, 579, 746, 372, 959, 110, 138, 642, 507, 866, 325, 901, 716, 869, 861, 993, 438, 715, 215, 132, 941, 698, 671, 289, 189, 992, 338, 66, 50, 558, 697, 96, 927, 354, 369, 532, 279, 966, 519, 180, 776, 916, 890, 167, 195, 577, 70, 107, 370, 828, 969, 1004, 195, 172, 824, 978, 221, 262, 576, 669, 821, 903, 888, 136, 341, 400, 709, 416, 162, 552, 342, 113, 836, 328, 522, 830, 578, 523, 441, 212, 895, 406, 7, 283, 888, 29, 67, 989, 86, 880, 134, 474, 195, 225, 377, 950, 502, 336, 230, 362, 898, 184, 492, 784, 184, 227, 599, 897, 411, 372, 103, 322, 457, 26, 940, 58, 288, 443, 731, 181, 541, 602, 629, 1021, 555, 312, 584, 425, 1001, 916, 589, 642, 96, 500, 925, 132, 963, 887, 922, 942, 499, 434, 237, 647, 376, 277, 371, 637, 861, 376, 612, 431, 21, 432, 799, 80, 817, 303, 343, 376, 724, 972, 528, 274, 149, 767, 177, 906, 120, 91, 460, 389, 484, 196, 152, 734, 764, 58, 512, 786, 693, 169, 859, 649, 627, 146, 714, 697, 610, 720, 90, 203, 89, 601, 400, 167, 549, 993, 957, 43, 139, 973, 231, 477, 666, 825, 720, 50, 767, 896, 733, 507, 257, 822, 350, 1002, 39, 802, 201, 864, 730, 624, 423, 993, 680, 781, 144, 71, 908],
[70, 364, 764, 981, 206, 394, 342, 770, 692, 482, 714, 686, 952, 187, 373, 734, 324, 96, 536, 861, 74, 362, 98, 926, 694, 605, 789, 88, 95, 352, 790, 750, 132, 128, 668, 941, 445, 643, 822, 527, 279, 813, 305, 291, 845, 995, 660, 749, 716, 43, 114, 79, 1015, 477, 322, 516, 310, 217, 454, 958, 979, 707, 735, 942, 916, 615, 13, 1021, 395, 725, 66, 501, 582, 122, 559, 45, 652, 401, 714, 263, 407, 12, 286, 381, 202, 27, 1016, 190, 340, 233, 560, 872, 764, 773, 620, 156, 834, 579, 659, 562, 368, 562, 648, 905, 146, 445, 501, 917, 579, 559, 1009, 972, 537, 169, 502, 399, 333, 590, 474, 916, 112, 425, 113, 92, 448, 986, 374, 554, 970, 669, 78, 910, 1022, 280, 1018, 162, 205, 59, 597, 688, 757, 705, 512, 157, 79, 41, 770, 686, 548, 523, 751, 613, 510, 537, 545, 986, 510, 695, 138, 485, 815, 635, 310, 456, 910, 140, 553, 232, 284, 841, 372, 520, 245, 587, 921, 778, 662, 532, 235, 409, 16, 918, 537, 547, 978, 266, 590, 109, 548, 185, 195, 552, 486, 104, 551, 489, 45, 68, 735, 771, 111, 372, 257, 522, 417, 516, 840, 59, 893, 508, 20, 821, 324, 550, 971, 314, 425, 58, 319, 235, 547, 609, 153, 26, 967, 688, 101, 978, 169, 79, 790, 415, 601, 570, 137, 94, 806, 315, 801, 849, 575, 348, 215, 61, 547, 229, 884, 770, 504, 674, 390, 637, 88, 688, 241, 643]
]);
List<PolyVec> A = _getA();
List<PolyVec> A = getA();

DilithiumPublicKey key = PackingUtils.unpackPublicKey(DilithiumParameterSpec.LEVEL2, pubBytes);

Expand Down

0 comments on commit fa0d7d6

Please sign in to comment.