这个提交包含在:
Henry Case 2021-03-18 11:32:49 +00:00
父节点 54d54ce47b
当前提交 00ee00401b

24
test/mytest.cpp 普通文件
查看文件

@ -0,0 +1,24 @@
#include <gtest/gtest.h>
#include "crypto_sign/dilithium/dilithium2/clean/ntt.c"
#include "crypto_sign/dilithium/dilithium2/clean/reduce.c"
#include "crypto_kem/kyber/kyber768/clean/reduce.c"
TEST(X,XXX) {
uint32_t a_in[] = {
8185875, 3328957, 6049449, 4344158, 5817506, 4415885, 4890107, 4537720, 2601260,
5902114, 3903747, 3230496, 1956637, 2191773, 3457600, 7600481, 4147620, 8190640,
7924071, 6866972, 6686829, 4400528, 4395860, 4666630, 3340665, 664651, 675985,
815499, 6107540, 1814936, 7453049, 5979634, 3480494, 6182123, 5709199, 5575406,
2137407, 257879, 1210530, 5540063, 3180755, 3241650, 1589055, 4706994, 3452982, 4109083, 4112332, 5573708, 267948, 151343, 3305288, 3134096, 4603082, 5340136, 2568603, 485108, 7566543, 6820789, 4251049, 1378359, 5965149, 937777, 2321370, 7127433, 6801071, 2750422, 11719, 1890583, 8375126, 6349800, 2393618, 8139515, 6192094, 5255814, 6660684, 1952689, 6655361, 4621937, 7467656, 7344898, 7474678, 8351962, 6665480, 6888202, 4421042, 7879021, 7789784, 2280578, 5260675, 9692, 7254038, 7850779, 675164, 7314991, 442819, 1715495, 5839868, 5209371, 2558430, 4162145, 668478, 2895331, 7385554, 3015227, 3763138, 6415952, 787213, 2343631, 385162, 3096879, 825832, 5782225, 2834829, 4725467, 6489486, 5811156, 8073567, 1695853, 3019278, 1688034, 607641, 5556561, 4991951, 1470594, 5119893, 1571376, 8262797, 5950630, 5304176, 4796788, 5715560, 4866693, 3379575, 1870725, 7448504, 7241001, 7037764, 6152974, 244772, 386249, 2426570, 7951611, 7206287, 3478896, 3693360, 3407090, 480973, 5676134, 6522753, 1507061, 7744795, 2767207, 846485, 5177772, 4079749, 1374134, 470438, 3112175, 7859496, 236177, 713660, 3025300, 3887356, 426165, 6263553, 8318058, 6902609, 5606119, 3804710, 7908869, 5474292, 1454329, 7386710, 2256099, 181838, 8013358, 4480854, 256586, 7618539, 2550409, 7444470, 847822, 5107597, 7519787, 3536988, 3682568, 4266019, 2143306, 8214875, 6832575, 7101251, 3385786, 5108089, 1485043, 1806308, 1374492, 714034, 5978160, 3347364, 5932329, 1999640, 3370161, 228032, 1723236, 7476923, 7738029, 2253519, 4256351, 2384960, 60980, 1965448, 5735691, 4484652, 2711047, 3164554, 6512774, 6955106, 6834663, 4777874, 824698, 5677609, 3836581, 2083918, 2746726, 5661529, 5322953, 4745152, 5062530, 6753162, 5185630, 7056736, 3602067, 5387070, 670780, 7232273, 3770714, 6283632, 3886217, 5323057, 6416837, 3559330, 6307663, 4885918, 899731, 4749051, 247999, 1656132, 5893289, 3475196, 2663184, 306835, 7249269, 4337773, 7213163, 5740064, 6071390};
//PQCLEAN_DILITHIUM2_CLEAN_ntt((int32_t*)a_in);
PQCLEAN_DILITHIUM2_CLEAN_invntt_tomont((int32_t*)a_in);
for(size_t i=0; i<256; i++) {
if(i%10 == 0) printf("\n");
printf("%08X, ", a_in[i]);
}
}
TEST(Kyber,k) {
ASSERT_EQ(PQCLEAN_KYBER768_CLEAN_montgomery_reduce(1<<16), 1);
}