Преглед на файлове

ntru: Match sample_fixed_weight to spec. Changes KATs. (c.f. Simone Dutto pqcforum 20200731)

kyber
John M. Schanck преди 4 години
committed by Kris Kwiatkowski
родител
ревизия
97968b3768
променени са 10 файла, в които са добавени 17 реда и са изтрити 17 реда
  1. +3
    -3
      crypto_kem/ntruhps2048509/META.yml
  2. +1
    -1
      crypto_kem/ntruhps2048509/avx2/sample.c
  3. +1
    -1
      crypto_kem/ntruhps2048509/clean/sample.c
  4. +3
    -3
      crypto_kem/ntruhps2048677/META.yml
  5. +1
    -1
      crypto_kem/ntruhps2048677/avx2/sample.c
  6. +1
    -1
      crypto_kem/ntruhps2048677/clean/sample.c
  7. +3
    -3
      crypto_kem/ntruhps4096821/META.yml
  8. +1
    -1
      crypto_kem/ntruhps4096821/avx2/sample.c
  9. +1
    -1
      crypto_kem/ntruhps4096821/clean/sample.c
  10. +2
    -2
      crypto_kem/ntruhrss701/META.yml

+ 3
- 3
crypto_kem/ntruhps2048509/META.yml Целия файл

@@ -6,7 +6,7 @@ length-public-key: 699
length-secret-key: 935
length-ciphertext: 699
length-shared-secret: 32
nistkat-sha256: 7ecb93dbc7a588878691f2b2d656ebc42192779f335e3a96197f4ce2134f72c6
nistkat-sha256: fc314366fbe795e2db6d29abb9f5b2ff43f0f608d0bd66161f9450364f0d271b
principal-submitters:
- John M. Schanck
auxiliary-submitters:
@@ -23,9 +23,9 @@ auxiliary-submitters:
- Zhenfei Zhang
implementations:
- name: clean
version: https://github.com/jschanck/ntru/tree/b38a346a reference implementation
version: https://github.com/jschanck/ntru/tree/6d1f44f5 reference implementation
- name: avx2
version: https://github.com/jschanck/ntru/tree/b38a346a avx2 implementation
version: https://github.com/jschanck/ntru/tree/6d1f44f5 avx2 implementation
supported_platforms:
- architecture: x86_64
operating_systems:


+ 1
- 1
crypto_kem/ntruhps2048509/avx2/sample.c Целия файл

@@ -24,7 +24,7 @@ void PQCLEAN_NTRUHPS2048509_AVX2_sample_fixed_type(poly *r, const unsigned char
s[4 * i + 0] = (u[15 * i + 0] << 2) + (u[15 * i + 1] << 10) + (u[15 * i + 2] << 18) + ((uint32_t) u[15 * i + 3] << 26);
s[4 * i + 1] = ((u[15 * i + 3] & 0xc0) >> 4) + (u[15 * i + 4] << 4) + (u[15 * i + 5] << 12) + (u[15 * i + 6] << 20) + ((uint32_t) u[15 * i + 7] << 28);
s[4 * i + 2] = ((u[15 * i + 7] & 0xf0) >> 2) + (u[15 * i + 8] << 6) + (u[15 * i + 9] << 14) + (u[15 * i + 10] << 22) + ((uint32_t) u[15 * i + 11] << 30);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 15) + ((uint32_t) u[15 * i + 14] << 24);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 16) + ((uint32_t) u[15 * i + 14] << 24);
}

for (i = 0; i < NTRU_WEIGHT / 2; i++) {


+ 1
- 1
crypto_kem/ntruhps2048509/clean/sample.c Целия файл

@@ -24,7 +24,7 @@ void PQCLEAN_NTRUHPS2048509_CLEAN_sample_fixed_type(poly *r, const unsigned char
s[4 * i + 0] = (u[15 * i + 0] << 2) + (u[15 * i + 1] << 10) + (u[15 * i + 2] << 18) + ((uint32_t) u[15 * i + 3] << 26);
s[4 * i + 1] = ((u[15 * i + 3] & 0xc0) >> 4) + (u[15 * i + 4] << 4) + (u[15 * i + 5] << 12) + (u[15 * i + 6] << 20) + ((uint32_t) u[15 * i + 7] << 28);
s[4 * i + 2] = ((u[15 * i + 7] & 0xf0) >> 2) + (u[15 * i + 8] << 6) + (u[15 * i + 9] << 14) + (u[15 * i + 10] << 22) + ((uint32_t) u[15 * i + 11] << 30);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 15) + ((uint32_t) u[15 * i + 14] << 24);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 16) + ((uint32_t) u[15 * i + 14] << 24);
}

for (i = 0; i < NTRU_WEIGHT / 2; i++) {


+ 3
- 3
crypto_kem/ntruhps2048677/META.yml Целия файл

@@ -6,7 +6,7 @@ length-public-key: 930
length-secret-key: 1234
length-ciphertext: 930
length-shared-secret: 32
nistkat-sha256: 715a5caf1ee22bb4b75ff6b10f911fec77e0d63378ea359c0773ee0a4c6cbb97
nistkat-sha256: 33e2cad6c2a2f17991517050d7a1b745908c84b8283a4e0f07dbe6f62d166507
principal-submitters:
- John M. Schanck
auxiliary-submitters:
@@ -23,9 +23,9 @@ auxiliary-submitters:
- Zhenfei Zhang
implementations:
- name: clean
version: https://github.com/jschanck/ntru/tree/b38a346a reference implementation
version: https://github.com/jschanck/ntru/tree/6d1f44f5 reference implementation
- name: avx2
version: https://github.com/jschanck/ntru/tree/b38a346a avx2 implementation
version: https://github.com/jschanck/ntru/tree/6d1f44f5 avx2 implementation
supported_platforms:
- architecture: x86_64
operating_systems:


+ 1
- 1
crypto_kem/ntruhps2048677/avx2/sample.c Целия файл

@@ -24,7 +24,7 @@ void PQCLEAN_NTRUHPS2048677_AVX2_sample_fixed_type(poly *r, const unsigned char
s[4 * i + 0] = (u[15 * i + 0] << 2) + (u[15 * i + 1] << 10) + (u[15 * i + 2] << 18) + ((uint32_t) u[15 * i + 3] << 26);
s[4 * i + 1] = ((u[15 * i + 3] & 0xc0) >> 4) + (u[15 * i + 4] << 4) + (u[15 * i + 5] << 12) + (u[15 * i + 6] << 20) + ((uint32_t) u[15 * i + 7] << 28);
s[4 * i + 2] = ((u[15 * i + 7] & 0xf0) >> 2) + (u[15 * i + 8] << 6) + (u[15 * i + 9] << 14) + (u[15 * i + 10] << 22) + ((uint32_t) u[15 * i + 11] << 30);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 15) + ((uint32_t) u[15 * i + 14] << 24);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 16) + ((uint32_t) u[15 * i + 14] << 24);
}

for (i = 0; i < NTRU_WEIGHT / 2; i++) {


+ 1
- 1
crypto_kem/ntruhps2048677/clean/sample.c Целия файл

@@ -24,7 +24,7 @@ void PQCLEAN_NTRUHPS2048677_CLEAN_sample_fixed_type(poly *r, const unsigned char
s[4 * i + 0] = (u[15 * i + 0] << 2) + (u[15 * i + 1] << 10) + (u[15 * i + 2] << 18) + ((uint32_t) u[15 * i + 3] << 26);
s[4 * i + 1] = ((u[15 * i + 3] & 0xc0) >> 4) + (u[15 * i + 4] << 4) + (u[15 * i + 5] << 12) + (u[15 * i + 6] << 20) + ((uint32_t) u[15 * i + 7] << 28);
s[4 * i + 2] = ((u[15 * i + 7] & 0xf0) >> 2) + (u[15 * i + 8] << 6) + (u[15 * i + 9] << 14) + (u[15 * i + 10] << 22) + ((uint32_t) u[15 * i + 11] << 30);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 15) + ((uint32_t) u[15 * i + 14] << 24);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 16) + ((uint32_t) u[15 * i + 14] << 24);
}

for (i = 0; i < NTRU_WEIGHT / 2; i++) {


+ 3
- 3
crypto_kem/ntruhps4096821/META.yml Целия файл

@@ -6,7 +6,7 @@ length-public-key: 1230
length-secret-key: 1590
length-ciphertext: 1230
length-shared-secret: 32
nistkat-sha256: 0c5b6b159fab6eb677da469ec35aaa7e6b16162b315dcdb55a3b5da857e10519
nistkat-sha256: 1a8382ae0c801a43cf461c98d22743f5b2d8a1ffed1b1df0dd767de2c2874597
principal-submitters:
- John M. Schanck
auxiliary-submitters:
@@ -23,9 +23,9 @@ auxiliary-submitters:
- Zhenfei Zhang
implementations:
- name: clean
version: https://github.com/jschanck/ntru/tree/b38a346a reference implementation
version: https://github.com/jschanck/ntru/tree/6d1f44f5 reference implementation
- name: avx2
version: https://github.com/jschanck/ntru/tree/b38a346a avx2 implementation
version: https://github.com/jschanck/ntru/tree/6d1f44f5 avx2 implementation
supported_platforms:
- architecture: x86_64
operating_systems:


+ 1
- 1
crypto_kem/ntruhps4096821/avx2/sample.c Целия файл

@@ -24,7 +24,7 @@ void PQCLEAN_NTRUHPS4096821_AVX2_sample_fixed_type(poly *r, const unsigned char
s[4 * i + 0] = (u[15 * i + 0] << 2) + (u[15 * i + 1] << 10) + (u[15 * i + 2] << 18) + ((uint32_t) u[15 * i + 3] << 26);
s[4 * i + 1] = ((u[15 * i + 3] & 0xc0) >> 4) + (u[15 * i + 4] << 4) + (u[15 * i + 5] << 12) + (u[15 * i + 6] << 20) + ((uint32_t) u[15 * i + 7] << 28);
s[4 * i + 2] = ((u[15 * i + 7] & 0xf0) >> 2) + (u[15 * i + 8] << 6) + (u[15 * i + 9] << 14) + (u[15 * i + 10] << 22) + ((uint32_t) u[15 * i + 11] << 30);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 15) + ((uint32_t) u[15 * i + 14] << 24);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 16) + ((uint32_t) u[15 * i + 14] << 24);
}

for (i = 0; i < NTRU_WEIGHT / 2; i++) {


+ 1
- 1
crypto_kem/ntruhps4096821/clean/sample.c Целия файл

@@ -24,7 +24,7 @@ void PQCLEAN_NTRUHPS4096821_CLEAN_sample_fixed_type(poly *r, const unsigned char
s[4 * i + 0] = (u[15 * i + 0] << 2) + (u[15 * i + 1] << 10) + (u[15 * i + 2] << 18) + ((uint32_t) u[15 * i + 3] << 26);
s[4 * i + 1] = ((u[15 * i + 3] & 0xc0) >> 4) + (u[15 * i + 4] << 4) + (u[15 * i + 5] << 12) + (u[15 * i + 6] << 20) + ((uint32_t) u[15 * i + 7] << 28);
s[4 * i + 2] = ((u[15 * i + 7] & 0xf0) >> 2) + (u[15 * i + 8] << 6) + (u[15 * i + 9] << 14) + (u[15 * i + 10] << 22) + ((uint32_t) u[15 * i + 11] << 30);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 15) + ((uint32_t) u[15 * i + 14] << 24);
s[4 * i + 3] = (u[15 * i + 11] & 0xfc) + (u[15 * i + 12] << 8) + (u[15 * i + 13] << 16) + ((uint32_t) u[15 * i + 14] << 24);
}

for (i = 0; i < NTRU_WEIGHT / 2; i++) {


+ 2
- 2
crypto_kem/ntruhrss701/META.yml Целия файл

@@ -23,9 +23,9 @@ auxiliary-submitters:
- Zhenfei Zhang
implementations:
- name: clean
version: https://github.com/jschanck/ntru/tree/b38a346a reference implementation
version: https://github.com/jschanck/ntru/tree/6d1f44f5 reference implementation
- name: avx2
version: https://github.com/jschanck/ntru/tree/b38a346a avx2 implementation
version: https://github.com/jschanck/ntru/tree/6d1f44f5 avx2 implementation
supported_platforms:
- architecture: x86_64
operating_systems:


Зареждане…
Отказ
Запис