diff --git a/AES128_8cpp_source.html b/AES128_8cpp_source.html index 3237b516..cee8d34b 100644 --- a/AES128_8cpp_source.html +++ b/AES128_8cpp_source.html @@ -175,7 +175,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/AES192_8cpp_source.html b/AES192_8cpp_source.html index 8d4f41d0..aa5b28f3 100644 --- a/AES192_8cpp_source.html +++ b/AES192_8cpp_source.html @@ -175,7 +175,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/AES256_8cpp_source.html b/AES256_8cpp_source.html index d1d854fa..39d94062 100644 --- a/AES256_8cpp_source.html +++ b/AES256_8cpp_source.html @@ -182,7 +182,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/AESCommon_8cpp_source.html b/AESCommon_8cpp_source.html index 0665b6c8..a0d3de3d 100644 --- a/AESCommon_8cpp_source.html +++ b/AESCommon_8cpp_source.html @@ -415,7 +415,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/AES_8h_source.html b/AES_8h_source.html index dfd7777a..655e2117 100644 --- a/AES_8h_source.html +++ b/AES_8h_source.html @@ -203,7 +203,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/AuthenticatedCipher_8cpp_source.html b/AuthenticatedCipher_8cpp_source.html index 6c28b199..7989cdf1 100644 --- a/AuthenticatedCipher_8cpp_source.html +++ b/AuthenticatedCipher_8cpp_source.html @@ -125,7 +125,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/AuthenticatedCipher_8h_source.html b/AuthenticatedCipher_8h_source.html index 1fefbfb5..92dd9600 100644 --- a/AuthenticatedCipher_8h_source.html +++ b/AuthenticatedCipher_8h_source.html @@ -141,7 +141,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BLAKE2b_8cpp_source.html b/BLAKE2b_8cpp_source.html index 1d42843d..3f96a53a 100644 --- a/BLAKE2b_8cpp_source.html +++ b/BLAKE2b_8cpp_source.html @@ -365,7 +365,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BLAKE2b_8h_source.html b/BLAKE2b_8h_source.html index 6ce58894..d4b4f891 100644 --- a/BLAKE2b_8h_source.html +++ b/BLAKE2b_8h_source.html @@ -164,7 +164,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BLAKE2s_8cpp_source.html b/BLAKE2s_8cpp_source.html index e4c4473a..d9c4a642 100644 --- a/BLAKE2s_8cpp_source.html +++ b/BLAKE2s_8cpp_source.html @@ -356,7 +356,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BLAKE2s_8h_source.html b/BLAKE2s_8h_source.html index 4b69771d..706529ae 100644 --- a/BLAKE2s_8h_source.html +++ b/BLAKE2s_8h_source.html @@ -163,7 +163,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BigNumberUtil_8cpp_source.html b/BigNumberUtil_8cpp_source.html index 94f65f6f..2b8cf073 100644 --- a/BigNumberUtil_8cpp_source.html +++ b/BigNumberUtil_8cpp_source.html @@ -682,7 +682,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BigNumberUtil_8h_source.html b/BigNumberUtil_8h_source.html index 74f837b8..bb83e832 100644 --- a/BigNumberUtil_8h_source.html +++ b/BigNumberUtil_8h_source.html @@ -214,7 +214,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Bitmap_8cpp_source.html b/Bitmap_8cpp_source.html index 2c98e170..6224ce00 100644 --- a/Bitmap_8cpp_source.html +++ b/Bitmap_8cpp_source.html @@ -694,7 +694,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Bitmap_8h_source.html b/Bitmap_8h_source.html index af5483b2..16f2c32b 100644 --- a/Bitmap_8h_source.html +++ b/Bitmap_8h_source.html @@ -271,7 +271,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BlinkLED_8cpp_source.html b/BlinkLED_8cpp_source.html index 5317fc5e..d265ef39 100644 --- a/BlinkLED_8cpp_source.html +++ b/BlinkLED_8cpp_source.html @@ -196,7 +196,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BlinkLED_8h_source.html b/BlinkLED_8h_source.html index bc5fd9fc..a1291142 100644 --- a/BlinkLED_8h_source.html +++ b/BlinkLED_8h_source.html @@ -157,7 +157,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BlockCipher_8cpp_source.html b/BlockCipher_8cpp_source.html index ed965677..71457f26 100644 --- a/BlockCipher_8cpp_source.html +++ b/BlockCipher_8cpp_source.html @@ -125,7 +125,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BlockCipher_8h_source.html b/BlockCipher_8h_source.html index 21676a45..4e978250 100644 --- a/BlockCipher_8h_source.html +++ b/BlockCipher_8h_source.html @@ -146,7 +146,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BoolField_8cpp_source.html b/BoolField_8cpp_source.html index 0c4a58a0..084a496b 100644 --- a/BoolField_8cpp_source.html +++ b/BoolField_8cpp_source.html @@ -202,7 +202,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BoolField_8h_source.html b/BoolField_8h_source.html index b2c764f1..3a999791 100644 --- a/BoolField_8h_source.html +++ b/BoolField_8h_source.html @@ -160,7 +160,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/CBC_8cpp_source.html b/CBC_8cpp_source.html index 115544cf..b02524ce 100644 --- a/CBC_8cpp_source.html +++ b/CBC_8cpp_source.html @@ -208,7 +208,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/CBC_8h_source.html b/CBC_8h_source.html index c2eb4115..89afb4c4 100644 --- a/CBC_8h_source.html +++ b/CBC_8h_source.html @@ -172,7 +172,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/CFB_8cpp_source.html b/CFB_8cpp_source.html index 2862a74a..2ec112fb 100644 --- a/CFB_8cpp_source.html +++ b/CFB_8cpp_source.html @@ -233,7 +233,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/CFB_8h_source.html b/CFB_8h_source.html index 337f97af..89911f69 100644 --- a/CFB_8h_source.html +++ b/CFB_8h_source.html @@ -171,7 +171,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/CTR_8cpp_source.html b/CTR_8cpp_source.html index eaf84ab2..f692c1ad 100644 --- a/CTR_8cpp_source.html +++ b/CTR_8cpp_source.html @@ -228,7 +228,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/CTR_8h_source.html b/CTR_8h_source.html index f8784ede..7b9183ab 100644 --- a/CTR_8h_source.html +++ b/CTR_8h_source.html @@ -175,7 +175,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ChaChaPoly_8cpp_source.html b/ChaChaPoly_8cpp_source.html index fdbbcc28..99e6caa0 100644 --- a/ChaChaPoly_8cpp_source.html +++ b/ChaChaPoly_8cpp_source.html @@ -263,7 +263,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ChaChaPoly_8h_source.html b/ChaChaPoly_8h_source.html index 67793ef4..40a1491b 100644 --- a/ChaChaPoly_8h_source.html +++ b/ChaChaPoly_8h_source.html @@ -173,7 +173,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ChaCha_8cpp_source.html b/ChaCha_8cpp_source.html index d90359ef..41c12b59 100644 --- a/ChaCha_8cpp_source.html +++ b/ChaCha_8cpp_source.html @@ -311,7 +311,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ChaCha_8h_source.html b/ChaCha_8h_source.html index 1ae2bc52..f5adf39e 100644 --- a/ChaCha_8h_source.html +++ b/ChaCha_8h_source.html @@ -170,7 +170,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Charlieplex_8cpp_source.html b/Charlieplex_8cpp_source.html index f706a766..58c87903 100644 --- a/Charlieplex_8cpp_source.html +++ b/Charlieplex_8cpp_source.html @@ -232,7 +232,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Charlieplex_8h_source.html b/Charlieplex_8h_source.html index de39f4d5..8c5e3bac 100644 --- a/Charlieplex_8h_source.html +++ b/Charlieplex_8h_source.html @@ -162,7 +162,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ChaseLEDs_8cpp_source.html b/ChaseLEDs_8cpp_source.html index aba14660..a6c86104 100644 --- a/ChaseLEDs_8cpp_source.html +++ b/ChaseLEDs_8cpp_source.html @@ -160,7 +160,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ChaseLEDs_8h_source.html b/ChaseLEDs_8h_source.html index 2da85624..e04351e6 100644 --- a/ChaseLEDs_8h_source.html +++ b/ChaseLEDs_8h_source.html @@ -149,7 +149,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Cipher_8cpp_source.html b/Cipher_8cpp_source.html index f6452431..dcb01cae 100644 --- a/Cipher_8cpp_source.html +++ b/Cipher_8cpp_source.html @@ -125,7 +125,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Cipher_8h_source.html b/Cipher_8h_source.html index c43e5ae7..258ca000 100644 --- a/Cipher_8h_source.html +++ b/Cipher_8h_source.html @@ -148,7 +148,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Crypto_8cpp_source.html b/Crypto_8cpp_source.html index 16c2fccb..88b68db1 100644 --- a/Crypto_8cpp_source.html +++ b/Crypto_8cpp_source.html @@ -138,7 +138,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Crypto_8h_source.html b/Crypto_8h_source.html index 791fd8aa..7d6c092b 100644 --- a/Crypto_8h_source.html +++ b/Crypto_8h_source.html @@ -130,7 +130,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Curve25519_8cpp_source.html b/Curve25519_8cpp_source.html index bd2f99e7..5e8f697a 100644 --- a/Curve25519_8cpp_source.html +++ b/Curve25519_8cpp_source.html @@ -1457,7 +1457,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Curve25519_8h_source.html b/Curve25519_8h_source.html index 17c50f9b..a71842a6 100644 --- a/Curve25519_8h_source.html +++ b/Curve25519_8h_source.html @@ -173,7 +173,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DMD_8cpp_source.html b/DMD_8cpp_source.html index 453f1bf6..b1585068 100644 --- a/DMD_8cpp_source.html +++ b/DMD_8cpp_source.html @@ -456,7 +456,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DMD_8h_source.html b/DMD_8h_source.html index 18865682..fd3841d0 100644 --- a/DMD_8h_source.html +++ b/DMD_8h_source.html @@ -170,7 +170,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DS1307RTC_8cpp_source.html b/DS1307RTC_8cpp_source.html index 460bb45c..9c8d538f 100644 --- a/DS1307RTC_8cpp_source.html +++ b/DS1307RTC_8cpp_source.html @@ -415,7 +415,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DS1307RTC_8h_source.html b/DS1307RTC_8h_source.html index 0af9c6cf..cad18f98 100644 --- a/DS1307RTC_8h_source.html +++ b/DS1307RTC_8h_source.html @@ -172,7 +172,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DS3231RTC_8cpp_source.html b/DS3231RTC_8cpp_source.html index 8cda4427..3902f7e1 100644 --- a/DS3231RTC_8cpp_source.html +++ b/DS3231RTC_8cpp_source.html @@ -657,7 +657,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DS3231RTC_8h_source.html b/DS3231RTC_8h_source.html index 801632e3..eebd6a8d 100644 --- a/DS3231RTC_8h_source.html +++ b/DS3231RTC_8h_source.html @@ -202,7 +202,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DS3232RTC_8cpp_source.html b/DS3232RTC_8cpp_source.html index 9c8859e3..876dbef5 100644 --- a/DS3232RTC_8cpp_source.html +++ b/DS3232RTC_8cpp_source.html @@ -575,7 +575,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DS3232RTC_8h_source.html b/DS3232RTC_8h_source.html index 25195197..ed798fe2 100644 --- a/DS3232RTC_8h_source.html +++ b/DS3232RTC_8h_source.html @@ -190,7 +190,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DejaVuSans9_8h_source.html b/DejaVuSans9_8h_source.html index 7366d0cc..a9ae51fa 100644 --- a/DejaVuSans9_8h_source.html +++ b/DejaVuSans9_8h_source.html @@ -257,7 +257,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DejaVuSansBold9_8h_source.html b/DejaVuSansBold9_8h_source.html index bfd5f39b..641f415b 100644 --- a/DejaVuSansBold9_8h_source.html +++ b/DejaVuSansBold9_8h_source.html @@ -257,7 +257,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/DejaVuSansItalic9_8h_source.html b/DejaVuSansItalic9_8h_source.html index 8d04c1ea..4cc1474d 100644 --- a/DejaVuSansItalic9_8h_source.html +++ b/DejaVuSansItalic9_8h_source.html @@ -257,7 +257,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/EAX_8cpp_source.html b/EAX_8cpp_source.html index c5572f07..58161502 100644 --- a/EAX_8cpp_source.html +++ b/EAX_8cpp_source.html @@ -301,7 +301,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/EAX_8h_source.html b/EAX_8h_source.html index 26b594a2..b40a7e11 100644 --- a/EAX_8h_source.html +++ b/EAX_8h_source.html @@ -196,7 +196,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/EEPROM24_8cpp_source.html b/EEPROM24_8cpp_source.html index 63a40e38..e2f75d25 100644 --- a/EEPROM24_8cpp_source.html +++ b/EEPROM24_8cpp_source.html @@ -282,7 +282,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/EEPROM24_8h_source.html b/EEPROM24_8h_source.html index 5cb3614c..f528689e 100644 --- a/EEPROM24_8h_source.html +++ b/EEPROM24_8h_source.html @@ -186,7 +186,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Ed25519_8cpp_source.html b/Ed25519_8cpp_source.html index 8bd3e7c1..382729b5 100644 --- a/Ed25519_8cpp_source.html +++ b/Ed25519_8cpp_source.html @@ -571,7 +571,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Ed25519_8h_source.html b/Ed25519_8h_source.html index 0185c1d4..3b24c612 100644 --- a/Ed25519_8h_source.html +++ b/Ed25519_8h_source.html @@ -168,7 +168,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Field_8cpp_source.html b/Field_8cpp_source.html index 6c13363e..c608c73b 100644 --- a/Field_8cpp_source.html +++ b/Field_8cpp_source.html @@ -196,7 +196,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Field_8h_source.html b/Field_8h_source.html index 278bd05f..101bf55f 100644 --- a/Field_8h_source.html +++ b/Field_8h_source.html @@ -164,7 +164,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Form_8cpp_source.html b/Form_8cpp_source.html index 6579fb8d..bdcbfc74 100644 --- a/Form_8cpp_source.html +++ b/Form_8cpp_source.html @@ -278,7 +278,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Form_8h_source.html b/Form_8h_source.html index 122edc4f..7764398d 100644 --- a/Form_8h_source.html +++ b/Form_8h_source.html @@ -172,7 +172,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/GCM_8cpp_source.html b/GCM_8cpp_source.html index c3c29cc5..a932ec2b 100644 --- a/GCM_8cpp_source.html +++ b/GCM_8cpp_source.html @@ -353,7 +353,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/GCM_8h_source.html b/GCM_8h_source.html index 23a5efc5..2bbb10c1 100644 --- a/GCM_8h_source.html +++ b/GCM_8h_source.html @@ -191,7 +191,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/GF128_8cpp_source.html b/GF128_8cpp_source.html index 5f0aed28..728ef341 100644 --- a/GF128_8cpp_source.html +++ b/GF128_8cpp_source.html @@ -578,7 +578,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/GF128_8h_source.html b/GF128_8h_source.html index 455a7d06..b9046e7a 100644 --- a/GF128_8h_source.html +++ b/GF128_8h_source.html @@ -139,7 +139,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/GHASH_8cpp_source.html b/GHASH_8cpp_source.html index 6dba7ef3..dda6e7d0 100644 --- a/GHASH_8cpp_source.html +++ b/GHASH_8cpp_source.html @@ -190,7 +190,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/GHASH_8h_source.html b/GHASH_8h_source.html index a9bc4ab5..b14470e0 100644 --- a/GHASH_8h_source.html +++ b/GHASH_8h_source.html @@ -150,7 +150,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Hash_8cpp_source.html b/Hash_8cpp_source.html index e0b88745..619d6b08 100644 --- a/Hash_8cpp_source.html +++ b/Hash_8cpp_source.html @@ -151,7 +151,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Hash_8h_source.html b/Hash_8h_source.html index 19c15107..bd761edb 100644 --- a/Hash_8h_source.html +++ b/Hash_8h_source.html @@ -154,7 +154,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/I2CMaster_8cpp_source.html b/I2CMaster_8cpp_source.html index 43fce4fa..b2c26877 100644 --- a/I2CMaster_8cpp_source.html +++ b/I2CMaster_8cpp_source.html @@ -115,7 +115,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/I2CMaster_8h_source.html b/I2CMaster_8h_source.html index b67130fe..b9fae769 100644 --- a/I2CMaster_8h_source.html +++ b/I2CMaster_8h_source.html @@ -140,7 +140,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/IRreceiver_8cpp_source.html b/IRreceiver_8cpp_source.html index f0d1179f..78e6f4ae 100644 --- a/IRreceiver_8cpp_source.html +++ b/IRreceiver_8cpp_source.html @@ -261,7 +261,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/IRreceiver_8h_source.html b/IRreceiver_8h_source.html index 2b2aa882..1904726d 100644 --- a/IRreceiver_8h_source.html +++ b/IRreceiver_8h_source.html @@ -157,7 +157,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/IntField_8cpp_source.html b/IntField_8cpp_source.html index 0babd50b..58368922 100644 --- a/IntField_8cpp_source.html +++ b/IntField_8cpp_source.html @@ -208,7 +208,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/IntField_8h_source.html b/IntField_8h_source.html index c6c3b48a..b0e0683d 100644 --- a/IntField_8h_source.html +++ b/IntField_8h_source.html @@ -173,7 +173,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/KeccakCore_8cpp_source.html b/KeccakCore_8cpp_source.html index dd1c6424..ef20c045 100644 --- a/KeccakCore_8cpp_source.html +++ b/KeccakCore_8cpp_source.html @@ -1991,7 +1991,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/KeccakCore_8h_source.html b/KeccakCore_8h_source.html index 744bbd90..ac7d961d 100644 --- a/KeccakCore_8h_source.html +++ b/KeccakCore_8h_source.html @@ -167,7 +167,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/LCD_8cpp_source.html b/LCD_8cpp_source.html index 8afd847c..f79f7146 100644 --- a/LCD_8cpp_source.html +++ b/LCD_8cpp_source.html @@ -290,7 +290,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/LCD_8h_source.html b/LCD_8h_source.html index 0085fc94..17a324e6 100644 --- a/LCD_8h_source.html +++ b/LCD_8h_source.html @@ -202,7 +202,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ListField_8cpp_source.html b/ListField_8cpp_source.html index 5dae2768..9441d5df 100644 --- a/ListField_8cpp_source.html +++ b/ListField_8cpp_source.html @@ -221,7 +221,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ListField_8h_source.html b/ListField_8h_source.html index 2b48953e..1f7c7c94 100644 --- a/ListField_8h_source.html +++ b/ListField_8h_source.html @@ -159,7 +159,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/LoginShell_8cpp_source.html b/LoginShell_8cpp_source.html index ed5bf7e9..cd3e2fc5 100644 --- a/LoginShell_8cpp_source.html +++ b/LoginShell_8cpp_source.html @@ -126,7 +126,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/LoginShell_8h_source.html b/LoginShell_8h_source.html index 3ad6e3e9..06f21098 100644 --- a/LoginShell_8h_source.html +++ b/LoginShell_8h_source.html @@ -155,7 +155,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Melody_8cpp_source.html b/Melody_8cpp_source.html index 0013df2c..2738ab03 100644 --- a/Melody_8cpp_source.html +++ b/Melody_8cpp_source.html @@ -215,7 +215,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Melody_8h_source.html b/Melody_8h_source.html index f72bb4d4..f196cee1 100644 --- a/Melody_8h_source.html +++ b/Melody_8h_source.html @@ -258,7 +258,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Mono5x7_8h_source.html b/Mono5x7_8h_source.html index 92ae3386..23c06e5f 100644 --- a/Mono5x7_8h_source.html +++ b/Mono5x7_8h_source.html @@ -246,7 +246,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/NewHope_8cpp_source.html b/NewHope_8cpp_source.html index 0359560a..d0e287f6 100644 --- a/NewHope_8cpp_source.html +++ b/NewHope_8cpp_source.html @@ -118,1010 +118,1142 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
28 #include <RNG.h>
29 #include <string.h>
30 
-
31 // Define this to 0 to disable the "torref" version, which will save
-
32 // some code and data memory if you don't need that variant.
-
33 #define NEWHOPE_TORREF 1
-
34 
-
130 // The following is public domain code from the reference C version of
-
131 // New Hope at https://cryptojedi.org/crypto/#newhope. This part of
-
132 // the Arduino port remains public domain. Original authors:
-
133 // Erdem Alkim, Léo Ducas, Thomas Pöppelmann, Peter Schwabe
-
134 
-
135 #define PARAM_N 1024
-
136 #define PARAM_K 16
-
137 #define PARAM_Q 12289
-
138 #define POLY_BYTES 1792
-
139 #define NEWHOPE_SEEDBYTES 32
-
140 #define NEWHOPE_RECBYTES 256
-
141 
-
142 static uint16_t const omegas_montgomery[PARAM_N/2] = {
-
143  4075,6974,7373,7965,3262,5079,522,2169,6364,1018,1041,8775,2344,
-
144  11011,5574,1973,4536,1050,6844,3860,3818,6118,2683,1190,4789,7822,
-
145  7540,6752,5456,4449,3789,12142,11973,382,3988,468,6843,5339,6196,
-
146  3710,11316,1254,5435,10930,3998,10256,10367,3879,11889,1728,6137,
-
147  4948,5862,6136,3643,6874,8724,654,10302,1702,7083,6760,56,3199,9987,
-
148  605,11785,8076,5594,9260,6403,4782,6212,4624,9026,8689,4080,11868,
-
149  6221,3602,975,8077,8851,9445,5681,3477,1105,142,241,12231,1003,
-
150  3532,5009,1956,6008,11404,7377,2049,10968,12097,7591,5057,3445,
-
151  4780,2920,7048,3127,8120,11279,6821,11502,8807,12138,2127,2839,
-
152  3957,431,1579,6383,9784,5874,677,3336,6234,2766,1323,9115,12237,
-
153  2031,6956,6413,2281,3969,3991,12133,9522,4737,10996,4774,5429,11871,
-
154  3772,453,5908,2882,1805,2051,1954,11713,3963,2447,6142,8174,3030,
-
155  1843,2361,12071,2908,3529,3434,3202,7796,2057,5369,11939,1512,6906,
-
156  10474,11026,49,10806,5915,1489,9789,5942,10706,10431,7535,426,8974,
-
157  3757,10314,9364,347,5868,9551,9634,6554,10596,9280,11566,174,2948,
-
158  2503,6507,10723,11606,2459,64,3656,8455,5257,5919,7856,1747,9166,
-
159  5486,9235,6065,835,3570,4240,11580,4046,10970,9139,1058,8210,11848,
-
160  922,7967,1958,10211,1112,3728,4049,11130,5990,1404,325,948,11143,
-
161  6190,295,11637,5766,8212,8273,2919,8527,6119,6992,8333,1360,2555,
-
162  6167,1200,7105,7991,3329,9597,12121,5106,5961,10695,10327,3051,9923,
-
163  4896,9326,81,3091,1000,7969,4611,726,1853,12149,4255,11112,2768,
-
164  10654,1062,2294,3553,4805,2747,4846,8577,9154,1170,2319,790,11334,
-
165  9275,9088,1326,5086,9094,6429,11077,10643,3504,3542,8668,9744,1479,
-
166  1,8246,7143,11567,10984,4134,5736,4978,10938,5777,8961,4591,5728,
-
167  6461,5023,9650,7468,949,9664,2975,11726,2744,9283,10092,5067,12171,
-
168  2476,3748,11336,6522,827,9452,5374,12159,7935,3296,3949,9893,4452,
-
169  10908,2525,3584,8112,8011,10616,4989,6958,11809,9447,12280,1022,
-
170  11950,9821,11745,5791,5092,2089,9005,2881,3289,2013,9048,729,7901,
-
171  1260,5755,4632,11955,2426,10593,1428,4890,5911,3932,9558,8830,3637,
-
172  5542,145,5179,8595,3707,10530,355,3382,4231,9741,1207,9041,7012,1168,
-
173  10146,11224,4645,11885,10911,10377,435,7952,4096,493,9908,6845,6039,
-
174  2422,2187,9723,8643,9852,9302,6022,7278,1002,4284,5088,1607,7313,
-
175  875,8509,9430,1045,2481,5012,7428,354,6591,9377,11847,2401,1067,
-
176  7188,11516,390,8511,8456,7270,545,8585,9611,12047,1537,4143,4714,
-
177  4885,1017,5084,1632,3066,27,1440,8526,9273,12046,11618,9289,3400,
-
178  9890,3136,7098,8758,11813,7384,3985,11869,6730,10745,10111,2249,
-
179  4048,2884,11136,2126,1630,9103,5407,2686,9042,2969,8311,9424,
-
180  9919,8779,5332,10626,1777,4654,10863,7351,3636,9585,5291,8374,
-
181  2166,4919,12176,9140,12129,7852,12286,4895,10805,2780,5195,2305,
-
182  7247,9644,4053,10600,3364,3271,4057,4414,9442,7917,2174
-
183 };
-
184 
-
185 static uint16_t const omegas_inv_montgomery[PARAM_N/2] = {
-
186  4075,5315,4324,4916,10120,11767,7210,9027,10316,6715,1278,9945,
-
187  3514,11248,11271,5925,147,8500,7840,6833,5537,4749,4467,7500,11099,
-
188  9606,6171,8471,8429,5445,11239,7753,9090,12233,5529,5206,10587,
-
189  1987,11635,3565,5415,8646,6153,6427,7341,6152,10561,400,8410,1922,
-
190  2033,8291,1359,6854,11035,973,8579,6093,6950,5446,11821,8301,11907,
-
191  316,52,3174,10966,9523,6055,8953,11612,6415,2505,5906,10710,11858,
-
192  8332,9450,10162,151,3482,787,5468,1010,4169,9162,5241,9369,7509,
-
193  8844,7232,4698,192,1321,10240,4912,885,6281,10333,7280,8757,11286,
-
194  58,12048,12147,11184,8812,6608,2844,3438,4212,11314,8687,6068,421,
-
195  8209,3600,3263,7665,6077,7507,5886,3029,6695,4213,504,11684,2302,
-
196  1962,1594,6328,7183,168,2692,8960,4298,5184,11089,6122,9734,10929,
-
197  3956,5297,6170,3762,9370,4016,4077,6523,652,11994,6099,1146,11341,
-
198  11964,10885,6299,1159,8240,8561,11177,2078,10331,4322,11367,441,
-
199  4079,11231,3150,1319,8243,709,8049,8719,11454,6224,3054,6803,3123,
-
200  10542,4433,6370,7032,3834,8633,12225,9830,683,1566,5782,9786,9341,
-
201  12115,723,3009,1693,5735,2655,2738,6421,11942,2925,1975,8532,3315,
-
202  11863,4754,1858,1583,6347,2500,10800,6374,1483,12240,1263,1815,
-
203  5383,10777,350,6920,10232,4493,9087,8855,8760,9381,218,9928,10446,
-
204  9259,4115,6147,9842,8326,576,10335,10238,10484,9407,6381,11836,8517,
-
205  418,6860,7515,1293,7552,2767,156,8298,8320,10008,5876,5333,10258,
-
206  10115,4372,2847,7875,8232,9018,8925,1689,8236,2645,5042,9984,7094,
-
207  9509,1484,7394,3,4437,160,3149,113,7370,10123,3915,6998,2704,8653,
-
208  4938,1426,7635,10512,1663,6957,3510,2370,2865,3978,9320,3247,9603,
-
209  6882,3186,10659,10163,1153,9405,8241,10040,2178,1544,5559,420,8304,
-
210  4905,476,3531,5191,9153,2399,8889,3000,671,243,3016,3763,10849,12262,
-
211  9223,10657,7205,11272,7404,7575,8146,10752,242,2678,3704,11744,
-
212  5019,3833,3778,11899,773,5101,11222,9888,442,2912,5698,11935,4861,
-
213  7277,9808,11244,2859,3780,11414,4976,10682,7201,8005,11287,5011,
-
214  6267,2987,2437,3646,2566,10102,9867,6250,5444,2381,11796,8193,4337,
-
215  11854,1912,1378,404,7644,1065,2143,11121,5277,3248,11082,2548,8058,
-
216  8907,11934,1759,8582,3694,7110,12144,6747,8652,3459,2731,8357,6378,
-
217  7399,10861,1696,9863,334,7657,6534,11029,4388,11560,3241,10276,9000,
-
218  9408,3284,10200,7197,6498,544,2468,339,11267,9,2842,480,5331,7300,
-
219  1673,4278,4177,8705,9764,1381,7837,2396,8340,8993,4354,130,6915,
-
220  2837,11462,5767,953,8541,9813,118,7222,2197,3006,9545,563,9314,
-
221  2625,11340,4821,2639,7266,5828,6561,7698,3328,6512,1351,7311,6553,
-
222  8155,1305,722,5146,4043,12288,10810,2545,3621,8747,8785,1646,1212,
-
223  5860,3195,7203,10963,3201,3014,955,11499,9970,11119,3135,3712,7443,
-
224  9542,7484,8736,9995,11227,1635,9521,1177,8034,140,10436,11563,7678,
-
225  4320,11289,9198,12208,2963,7393,2366,9238
-
226 };
-
227 
-
228 static uint16_t const psis_bitrev_montgomery[PARAM_N] = {
-
229  4075,6974,7373,7965,3262,5079,522,2169,6364,1018,1041,8775,2344,
-
230  11011,5574,1973,4536,1050,6844,3860,3818,6118,2683,1190,4789,7822,
-
231  7540,6752,5456,4449,3789,12142,11973,382,3988,468,6843,5339,6196,3710,
-
232  11316,1254,5435,10930,3998,10256,10367,3879,11889,1728,6137,4948,
-
233  5862,6136,3643,6874,8724,654,10302,1702,7083,6760,56,3199,9987,605,
-
234  11785,8076,5594,9260,6403,4782,6212,4624,9026,8689,4080,11868,6221,
-
235  3602,975,8077,8851,9445,5681,3477,1105,142,241,12231,1003,3532,5009,
-
236  1956,6008,11404,7377,2049,10968,12097,7591,5057,3445,4780,2920,
-
237  7048,3127,8120,11279,6821,11502,8807,12138,2127,2839,3957,431,1579,
-
238  6383,9784,5874,677,3336,6234,2766,1323,9115,12237,2031,6956,6413,
-
239  2281,3969,3991,12133,9522,4737,10996,4774,5429,11871,3772,453,
-
240  5908,2882,1805,2051,1954,11713,3963,2447,6142,8174,3030,1843,2361,
-
241  12071,2908,3529,3434,3202,7796,2057,5369,11939,1512,6906,10474,
-
242  11026,49,10806,5915,1489,9789,5942,10706,10431,7535,426,8974,3757,
-
243  10314,9364,347,5868,9551,9634,6554,10596,9280,11566,174,2948,2503,
-
244  6507,10723,11606,2459,64,3656,8455,5257,5919,7856,1747,9166,5486,
-
245  9235,6065,835,3570,4240,11580,4046,10970,9139,1058,8210,11848,922,
-
246  7967,1958,10211,1112,3728,4049,11130,5990,1404,325,948,11143,6190,
-
247  295,11637,5766,8212,8273,2919,8527,6119,6992,8333,1360,2555,6167,
-
248  1200,7105,7991,3329,9597,12121,5106,5961,10695,10327,3051,9923,
-
249  4896,9326,81,3091,1000,7969,4611,726,1853,12149,4255,11112,2768,
-
250  10654,1062,2294,3553,4805,2747,4846,8577,9154,1170,2319,790,11334,
-
251  9275,9088,1326,5086,9094,6429,11077,10643,3504,3542,8668,9744,1479,
-
252  1,8246,7143,11567,10984,4134,5736,4978,10938,5777,8961,4591,5728,
-
253  6461,5023,9650,7468,949,9664,2975,11726,2744,9283,10092,5067,12171,
-
254  2476,3748,11336,6522,827,9452,5374,12159,7935,3296,3949,9893,4452,
-
255  10908,2525,3584,8112,8011,10616,4989,6958,11809,9447,12280,1022,
-
256  11950,9821,11745,5791,5092,2089,9005,2881,3289,2013,9048,729,7901,
-
257  1260,5755,4632,11955,2426,10593,1428,4890,5911,3932,9558,8830,3637,
-
258  5542,145,5179,8595,3707,10530,355,3382,4231,9741,1207,9041,7012,
-
259  1168,10146,11224,4645,11885,10911,10377,435,7952,4096,493,9908,6845,
-
260  6039,2422,2187,9723,8643,9852,9302,6022,7278,1002,4284,5088,1607,
-
261  7313,875,8509,9430,1045,2481,5012,7428,354,6591,9377,11847,2401,
-
262  1067,7188,11516,390,8511,8456,7270,545,8585,9611,12047,1537,4143,
-
263  4714,4885,1017,5084,1632,3066,27,1440,8526,9273,12046,11618,9289,
-
264  3400,9890,3136,7098,8758,11813,7384,3985,11869,6730,10745,10111,
-
265  2249,4048,2884,11136,2126,1630,9103,5407,2686,9042,2969,8311,9424,
-
266  9919,8779,5332,10626,1777,4654,10863,7351,3636,9585,5291,8374,
-
267  2166,4919,12176,9140,12129,7852,12286,4895,10805,2780,5195,2305,
-
268  7247,9644,4053,10600,3364,3271,4057,4414,9442,7917,2174,3947,
-
269  11951,2455,6599,10545,10975,3654,2894,7681,7126,7287,12269,4119,
-
270  3343,2151,1522,7174,7350,11041,2442,2148,5959,6492,8330,8945,5598,
-
271  3624,10397,1325,6565,1945,11260,10077,2674,3338,3276,11034,506,
-
272  6505,1392,5478,8778,1178,2776,3408,10347,11124,2575,9489,12096,
-
273  6092,10058,4167,6085,923,11251,11912,4578,10669,11914,425,10453,
-
274  392,10104,8464,4235,8761,7376,2291,3375,7954,8896,6617,7790,1737,
-
275  11667,3982,9342,6680,636,6825,7383,512,4670,2900,12050,7735,994,
-
276  1687,11883,7021,146,10485,1403,5189,6094,2483,2054,3042,10945,
-
277  3981,10821,11826,8882,8151,180,9600,7684,5219,10880,6780,204,
-
278  11232,2600,7584,3121,3017,11053,7814,7043,4251,4739,11063,6771,
-
279  7073,9261,2360,11925,1928,11825,8024,3678,3205,3359,11197,5209,
-
280  8581,3238,8840,1136,9363,1826,3171,4489,7885,346,2068,1389,8257,
-
281  3163,4840,6127,8062,8921,612,4238,10763,8067,125,11749,10125,5416,
-
282  2110,716,9839,10584,11475,11873,3448,343,1908,4538,10423,7078,
-
283  4727,1208,11572,3589,2982,1373,1721,10753,4103,2429,4209,5412,
-
284  5993,9011,438,3515,7228,1218,8347,5232,8682,1327,7508,4924,448,
-
285  1014,10029,12221,4566,5836,12229,2717,1535,3200,5588,5845,412,
-
286  5102,7326,3744,3056,2528,7406,8314,9202,6454,6613,1417,10032,7784,
-
287  1518,3765,4176,5063,9828,2275,6636,4267,6463,2065,7725,3495,8328,
-
288  8755,8144,10533,5966,12077,9175,9520,5596,6302,8400,579,6781,11014,
-
289  5734,11113,11164,4860,1131,10844,9068,8016,9694,3837,567,9348,7000,
-
290  6627,7699,5082,682,11309,5207,4050,7087,844,7434,3769,293,9057,
-
291  6940,9344,10883,2633,8190,3944,5530,5604,3480,2171,9282,11024,2213,
-
292  8136,3805,767,12239,216,11520,6763,10353,7,8566,845,7235,3154,4360,
-
293  3285,10268,2832,3572,1282,7559,3229,8360,10583,6105,3120,6643,6203,
-
294  8536,8348,6919,3536,9199,10891,11463,5043,1658,5618,8787,5789,4719,
-
295  751,11379,6389,10783,3065,7806,6586,2622,5386,510,7628,6921,578,
-
296  10345,11839,8929,4684,12226,7154,9916,7302,8481,3670,11066,2334,
-
297  1590,7878,10734,1802,1891,5103,6151,8820,3418,7846,9951,4693,417,
-
298  9996,9652,4510,2946,5461,365,881,1927,1015,11675,11009,1371,12265,
-
299  2485,11385,5039,6742,8449,1842,12217,8176,9577,4834,7937,9461,2643,
-
300  11194,3045,6508,4094,3451,7911,11048,5406,4665,3020,6616,11345,
-
301  7519,3669,5287,1790,7014,5410,11038,11249,2035,6125,10407,4565,
-
302  7315,5078,10506,2840,2478,9270,4194,9195,4518,7469,1160,6878,2730,
-
303  10421,10036,1734,3815,10939,5832,10595,10759,4423,8420,9617,7119,
-
304  11010,11424,9173,189,10080,10526,3466,10588,7592,3578,11511,7785,
-
305  9663,530,12150,8957,2532,3317,9349,10243,1481,9332,3454,3758,7899,
-
306  4218,2593,11410,2276,982,6513,1849,8494,9021,4523,7988,8,457,648,
-
307  150,8000,2307,2301,874,5650,170,9462,2873,9855,11498,2535,11169,
-
308  5808,12268,9687,1901,7171,11787,3846,1573,6063,3793,466,11259,
-
309  10608,3821,6320,4649,6263,2929
-
310 };
-
311 
-
312 static uint16_t const psis_inv_montgomery[PARAM_N] = {
-
313  256,10570,1510,7238,1034,7170,6291,7921,11665,3422,4000,2327,
-
314  2088,5565,795,10647,1521,5484,2539,7385,1055,7173,8047,11683,
-
315  1669,1994,3796,5809,4341,9398,11876,12230,10525,12037,12253,
-
316  3506,4012,9351,4847,2448,7372,9831,3160,2207,5582,2553,7387,6322,
-
317  9681,1383,10731,1533,219,5298,4268,7632,6357,9686,8406,4712,9451,
-
318  10128,4958,5975,11387,8649,11769,6948,11526,12180,1740,10782,
-
319  6807,2728,7412,4570,4164,4106,11120,12122,8754,11784,3439,5758,
-
320  11356,6889,9762,11928,1704,1999,10819,12079,12259,7018,11536,
-
321  1648,1991,2040,2047,2048,10826,12080,8748,8272,8204,1172,1923,
-
322  7297,2798,7422,6327,4415,7653,6360,11442,12168,7005,8023,9924,
-
323  8440,8228,2931,7441,1063,3663,5790,9605,10150,1450,8985,11817,
-
324  10466,10273,12001,3470,7518,1074,1909,7295,9820,4914,702,5367,
-
325  7789,8135,9940,1420,3714,11064,12114,12264,1752,5517,9566,11900,
-
326  1700,3754,5803,829,1874,7290,2797,10933,5073,7747,8129,6428,
-
327  6185,11417,1631,233,5300,9535,10140,11982,8734,8270,2937,10953,
-
328  8587,8249,2934,9197,4825,5956,4362,9401,1343,3703,529,10609,
-
329  12049,6988,6265,895,3639,4031,4087,4095,585,10617,8539,4731,
-
330  4187,9376,3095,9220,10095,10220,1460,10742,12068,1724,5513,
-
331  11321,6884,2739,5658,6075,4379,11159,10372,8504,4726,9453,3106,
-
332  7466,11600,10435,8513,9994,8450,9985,3182,10988,8592,2983,9204,
-
333  4826,2445,5616,6069,867,3635,5786,11360,5134,2489,10889,12089,
-
334  1727,7269,2794,9177,1311,5454,9557,6632,2703,9164,10087,1441,
-
335  3717,531,3587,2268,324,5313,759,1864,5533,2546,7386,9833,8427,
-
336  4715,11207,1601,7251,4547,11183,12131,1733,10781,10318,1474,
-
337  10744,5046,4232,11138,10369,6748,964,7160,4534,7670,8118,8182,
-
338  4680,11202,6867,981,8918,1274,182,26,7026,8026,11680,12202,
-
339  10521,1503,7237,4545,5916,9623,8397,11733,10454,3249,9242,6587,
-
340  941,1890,270,10572,6777,9746,6659,6218,6155,6146,878,1881,7291,
-
341  11575,12187,1741,7271,8061,11685,6936,4502,9421,4857,4205,7623,
-
342  1089,10689,1527,8996,10063,11971,10488,6765,2722,3900,9335,11867,
-
343  6962,11528,5158,4248,4118,5855,2592,5637,6072,2623,7397,8079,
-
344  9932,4930,5971,853,3633,519,8852,11798,3441,11025,1575,225,8810,
-
345  11792,12218,3501,9278,3081,9218,4828,7712,8124,11694,12204,3499,
-
346  4011,573,3593,5780,7848,9899,10192,1456,208,7052,2763,7417,11593,
-
347  10434,12024,8740,11782,10461,3250,5731,7841,9898,1414,202,3540,
-
348  7528,2831,2160,10842,5060,4234,4116,588,84,12,7024,2759,9172,6577,
-
349  11473,1639,9012,3043,7457,6332,11438,1634,1989,9062,11828,8712,
-
350  11778,12216,10523,6770,9745,10170,4964,9487,6622,946,8913,6540,
-
351  6201,4397,9406,8366,9973,8447,8229,11709,8695,10020,3187,5722,
-
352  2573,10901,6824,4486,4152,9371,8361,2950,2177,311,1800,9035,
-
353  8313,11721,3430,490,70,10,1757,251,3547,7529,11609,3414,7510,
-
354  4584,4166,9373,1339,5458,7802,11648,1664,7260,9815,10180,6721,
-
355  9738,10169,8475,8233,9954,1422,8981,1283,5450,11312,1616,3742,
-
356  11068,10359,4991,713,3613,9294,8350,4704,672,96,7036,9783,11931,
-
357  3460,5761,823,10651,12055,10500,1500,5481,783,3623,11051,8601,
-
358  8251,8201,11705,10450,5004,4226,7626,2845,2162,3820,7568,9859,
-
359  3164,452,10598,1514,5483,6050,6131,4387,7649,8115,6426,918,8909,
-
360  8295,1185,5436,11310,8638,1234,5443,11311,5127,2488,2111,10835,
-
361  5059,7745,2862,3920,560,80,1767,2008,3798,11076,6849,2734,10924,
-
362  12094,8750,1250,10712,6797,971,7161,1023,8924,4786,7706,4612,4170,
-
363  7618,6355,4419,5898,11376,10403,10264,6733,4473,639,5358,2521,
-
364  9138,3061,5704,4326,618,5355,765,5376,768,7132,4530,9425,3102,
-
365  9221,6584,11474,10417,10266,12000,6981,6264,4406,2385,7363,4563,
-
366  4163,7617,9866,3165,9230,11852,10471,5007,5982,11388,5138,734,
-
367  3616,11050,12112,6997,11533,12181,10518,12036,3475,2252,7344,
-
368  9827,4915,9480,6621,4457,7659,9872,6677,4465,4149,7615,4599,657,
-
369  3605,515,10607,6782,4480,640,1847,3775,5806,2585,5636,9583,1369,
-
370  10729,8555,10000,11962,5220,7768,8132,8184,9947,1421,203,29,8782,
-
371  11788,1684,10774,10317,4985,9490,8378,4708,11206,5112,5997,7879,
-
372  11659,12199,8765,10030,4944,5973,6120,6141,6144,7900,11662,1666,
-
373  238,34,3516,5769,9602,8394,9977,6692,956,10670,6791,9748,11926,
-
374  8726,11780,5194,742,106,8793,10034,3189,10989,5081,4237,5872,4350,
-
375  2377,10873,6820,6241,11425,10410,10265,3222,5727,9596,4882,2453,
-
376  2106,3812,11078,12116,5242,4260,11142,8614,11764,12214,5256,4262,
-
377  4120,11122,5100,11262,5120,2487,5622,9581,8391,8221,2930,10952,
-
378  12098,6995,6266,9673,4893,699,3611,4027,5842,11368,1624,232,8811,
-
379  8281,1183,169,8802,3013,2186,5579,797,3625,4029,11109,1587,7249,
-
380  11569,8675,6506,2685,10917,12093,12261,12285,1755,7273,1039,1904,
-
381  272,3550,9285,3082,5707,6082,4380,7648,11626,5172,4250,9385,8363,
-
382  8217,4685,5936,848,8899,6538,934,1889,3781,9318,10109,10222,6727,
-
383  961,5404,772,5377,9546,8386,1198,8949,3034,2189,7335,4559,5918,2601,
-
384  10905,5069,9502,3113,7467,8089,11689,5181,9518,8382,2953,3933,4073,
-
385  4093,7607,8109,2914,5683,4323,11151,1593,10761,6804,972,3650,2277,
-
386  5592,4310,7638,9869,4921,703,1856,9043,4803,9464,1352,8971,11815,
-
387  5199,7765,6376,4422,7654,2849,407,8836,6529,7955,2892,9191,1313,
-
388  10721,12065,12257,1751,9028,8312,2943,2176,3822,546,78,8789,11789,
-
389  10462,12028,6985,4509,9422,1346,5459,4291,613,10621,6784,9747,3148,
-
390  7472,2823,5670,810,7138,8042,4660,7688,6365,6176,6149,2634,5643,
-
391  9584,10147,11983,5223,9524,11894,10477,8519,1217,3685,2282,326,
-
392  10580,3267,7489,4581,2410,5611,11335,6886,8006,8166,11700,3427,
-
393  11023,8597,10006,3185,455,65,5276,7776,4622,5927,7869,9902,11948,
-
394  5218,2501,5624,2559,10899,1557,1978,10816,10323,8497,4725,675,1852,
-
395  10798,12076,10503,3256,9243,3076,2195,10847,12083,10504,12034,10497
-
396 };
-
397 
-
398 static uint16_t const bitrev_table[PARAM_N] = {
-
399  0,512,256,768,128,640,384,896,64,576,320,832,192,704,448,960,32,544,288,800,160,672,416,928,96,608,352,864,224,736,480,992,
-
400  16,528,272,784,144,656,400,912,80,592,336,848,208,720,464,976,48,560,304,816,176,688,432,944,112,624,368,880,240,752,496,1008,
-
401  8,520,264,776,136,648,392,904,72,584,328,840,200,712,456,968,40,552,296,808,168,680,424,936,104,616,360,872,232,744,488,1000,
-
402  24,536,280,792,152,664,408,920,88,600,344,856,216,728,472,984,56,568,312,824,184,696,440,952,120,632,376,888,248,760,504,1016,
-
403  4,516,260,772,132,644,388,900,68,580,324,836,196,708,452,964,36,548,292,804,164,676,420,932,100,612,356,868,228,740,484,996,
-
404  20,532,276,788,148,660,404,916,84,596,340,852,212,724,468,980,52,564,308,820,180,692,436,948,116,628,372,884,244,756,500,1012,
-
405  12,524,268,780,140,652,396,908,76,588,332,844,204,716,460,972,44,556,300,812,172,684,428,940,108,620,364,876,236,748,492,1004,
-
406  28,540,284,796,156,668,412,924,92,604,348,860,220,732,476,988,60,572,316,828,188,700,444,956,124,636,380,892,252,764,508,1020,
-
407  2,514,258,770,130,642,386,898,66,578,322,834,194,706,450,962,34,546,290,802,162,674,418,930,98,610,354,866,226,738,482,994,
-
408  18,530,274,786,146,658,402,914,82,594,338,850,210,722,466,978,50,562,306,818,178,690,434,946,114,626,370,882,242,754,498,1010,
-
409  10,522,266,778,138,650,394,906,74,586,330,842,202,714,458,970,42,554,298,810,170,682,426,938,106,618,362,874,234,746,490,1002,
-
410  26,538,282,794,154,666,410,922,90,602,346,858,218,730,474,986,58,570,314,826,186,698,442,954,122,634,378,890,250,762,506,1018,
-
411  6,518,262,774,134,646,390,902,70,582,326,838,198,710,454,966,38,550,294,806,166,678,422,934,102,614,358,870,230,742,486,998,
-
412  22,534,278,790,150,662,406,918,86,598,342,854,214,726,470,982,54,566,310,822,182,694,438,950,118,630,374,886,246,758,502,1014,
-
413  14,526,270,782,142,654,398,910,78,590,334,846,206,718,462,974,46,558,302,814,174,686,430,942,110,622,366,878,238,750,494,1006,
-
414  30,542,286,798,158,670,414,926,94,606,350,862,222,734,478,990,62,574,318,830,190,702,446,958,126,638,382,894,254,766,510,1022,
-
415  1,513,257,769,129,641,385,897,65,577,321,833,193,705,449,961,33,545,289,801,161,673,417,929,97,609,353,865,225,737,481,993,
-
416  17,529,273,785,145,657,401,913,81,593,337,849,209,721,465,977,49,561,305,817,177,689,433,945,113,625,369,881,241,753,497,1009,
-
417  9,521,265,777,137,649,393,905,73,585,329,841,201,713,457,969,41,553,297,809,169,681,425,937,105,617,361,873,233,745,489,1001,
-
418  25,537,281,793,153,665,409,921,89,601,345,857,217,729,473,985,57,569,313,825,185,697,441,953,121,633,377,889,249,761,505,1017,
-
419  5,517,261,773,133,645,389,901,69,581,325,837,197,709,453,965,37,549,293,805,165,677,421,933,101,613,357,869,229,741,485,997,
-
420  21,533,277,789,149,661,405,917,85,597,341,853,213,725,469,981,53,565,309,821,181,693,437,949,117,629,373,885,245,757,501,1013,
-
421  13,525,269,781,141,653,397,909,77,589,333,845,205,717,461,973,45,557,301,813,173,685,429,941,109,621,365,877,237,749,493,1005,
-
422  29,541,285,797,157,669,413,925,93,605,349,861,221,733,477,989,61,573,317,829,189,701,445,957,125,637,381,893,253,765,509,1021,
-
423  3,515,259,771,131,643,387,899,67,579,323,835,195,707,451,963,35,547,291,803,163,675,419,931,99,611,355,867,227,739,483,995,
-
424  19,531,275,787,147,659,403,915,83,595,339,851,211,723,467,979,51,563,307,819,179,691,435,947,115,627,371,883,243,755,499,1011,
-
425  11,523,267,779,139,651,395,907,75,587,331,843,203,715,459,971,43,555,299,811,171,683,427,939,107,619,363,875,235,747,491,1003,
-
426  27,539,283,795,155,667,411,923,91,603,347,859,219,731,475,987,59,571,315,827,187,699,443,955,123,635,379,891,251,763,507,1019,
-
427  7,519,263,775,135,647,391,903,71,583,327,839,199,711,455,967,39,551,295,807,167,679,423,935,103,615,359,871,231,743,487,999,
-
428  23,535,279,791,151,663,407,919,87,599,343,855,215,727,471,983,55,567,311,823,183,695,439,951,119,631,375,887,247,759,503,1015,
-
429  15,527,271,783,143,655,399,911,79,591,335,847,207,719,463,975,47,559,303,815,175,687,431,943,111,623,367,879,239,751,495,1007,
-
430  31,543,287,799,159,671,415,927,95,607,351,863,223,735,479,991,63,575,319,831,191,703,447,959,127,639,383,895,255,767,511,1023
+
33 // Older Arduino IDE's don't define placement new. Provide our own definition.
+
34 void *operator new(size_t size, void *ptr)
+
35 {
+
36  return ptr;
+
37 }
+
38 
+
39 #if defined(__AVR__)
+
40 #include <avr/pgmspace.h>
+
41 #define table_read(name, index) (pgm_read_word(&((name)[(index)])))
+
42 #else
+
43 #define PROGMEM
+
44 #define table_read(name, index) ((name)[(index)])
+
45 #endif
+
46 
+
158 typedef struct
+
159 {
+
160  uint32_t input[16];
+
161  uint32_t output[16];
+
162 
+
163 } NewHopeChaChaState;
+
164 
+
165 // The following is public domain code from the reference C version of
+
166 // New Hope at https://cryptojedi.org/crypto/#newhope. This part of
+
167 // the Arduino port remains public domain. Original authors:
+
168 // Erdem Alkim, Léo Ducas, Thomas Pöppelmann, Peter Schwabe
+
169 
+
170 #define PARAM_N 1024
+
171 #define PARAM_K 16
+
172 #define PARAM_Q ((int32_t)12289)
+
173 #define POLY_BYTES 1792
+
174 #define NEWHOPE_SEEDBYTES 32
+
175 #define NEWHOPE_RECBYTES 256
+
176 
+
177 static uint16_t const omegas_montgomery[PARAM_N/2] PROGMEM = {
+
178  4075,6974,7373,7965,3262,5079,522,2169,6364,1018,1041,8775,2344,
+
179  11011,5574,1973,4536,1050,6844,3860,3818,6118,2683,1190,4789,7822,
+
180  7540,6752,5456,4449,3789,12142,11973,382,3988,468,6843,5339,6196,
+
181  3710,11316,1254,5435,10930,3998,10256,10367,3879,11889,1728,6137,
+
182  4948,5862,6136,3643,6874,8724,654,10302,1702,7083,6760,56,3199,9987,
+
183  605,11785,8076,5594,9260,6403,4782,6212,4624,9026,8689,4080,11868,
+
184  6221,3602,975,8077,8851,9445,5681,3477,1105,142,241,12231,1003,
+
185  3532,5009,1956,6008,11404,7377,2049,10968,12097,7591,5057,3445,
+
186  4780,2920,7048,3127,8120,11279,6821,11502,8807,12138,2127,2839,
+
187  3957,431,1579,6383,9784,5874,677,3336,6234,2766,1323,9115,12237,
+
188  2031,6956,6413,2281,3969,3991,12133,9522,4737,10996,4774,5429,11871,
+
189  3772,453,5908,2882,1805,2051,1954,11713,3963,2447,6142,8174,3030,
+
190  1843,2361,12071,2908,3529,3434,3202,7796,2057,5369,11939,1512,6906,
+
191  10474,11026,49,10806,5915,1489,9789,5942,10706,10431,7535,426,8974,
+
192  3757,10314,9364,347,5868,9551,9634,6554,10596,9280,11566,174,2948,
+
193  2503,6507,10723,11606,2459,64,3656,8455,5257,5919,7856,1747,9166,
+
194  5486,9235,6065,835,3570,4240,11580,4046,10970,9139,1058,8210,11848,
+
195  922,7967,1958,10211,1112,3728,4049,11130,5990,1404,325,948,11143,
+
196  6190,295,11637,5766,8212,8273,2919,8527,6119,6992,8333,1360,2555,
+
197  6167,1200,7105,7991,3329,9597,12121,5106,5961,10695,10327,3051,9923,
+
198  4896,9326,81,3091,1000,7969,4611,726,1853,12149,4255,11112,2768,
+
199  10654,1062,2294,3553,4805,2747,4846,8577,9154,1170,2319,790,11334,
+
200  9275,9088,1326,5086,9094,6429,11077,10643,3504,3542,8668,9744,1479,
+
201  1,8246,7143,11567,10984,4134,5736,4978,10938,5777,8961,4591,5728,
+
202  6461,5023,9650,7468,949,9664,2975,11726,2744,9283,10092,5067,12171,
+
203  2476,3748,11336,6522,827,9452,5374,12159,7935,3296,3949,9893,4452,
+
204  10908,2525,3584,8112,8011,10616,4989,6958,11809,9447,12280,1022,
+
205  11950,9821,11745,5791,5092,2089,9005,2881,3289,2013,9048,729,7901,
+
206  1260,5755,4632,11955,2426,10593,1428,4890,5911,3932,9558,8830,3637,
+
207  5542,145,5179,8595,3707,10530,355,3382,4231,9741,1207,9041,7012,1168,
+
208  10146,11224,4645,11885,10911,10377,435,7952,4096,493,9908,6845,6039,
+
209  2422,2187,9723,8643,9852,9302,6022,7278,1002,4284,5088,1607,7313,
+
210  875,8509,9430,1045,2481,5012,7428,354,6591,9377,11847,2401,1067,
+
211  7188,11516,390,8511,8456,7270,545,8585,9611,12047,1537,4143,4714,
+
212  4885,1017,5084,1632,3066,27,1440,8526,9273,12046,11618,9289,3400,
+
213  9890,3136,7098,8758,11813,7384,3985,11869,6730,10745,10111,2249,
+
214  4048,2884,11136,2126,1630,9103,5407,2686,9042,2969,8311,9424,
+
215  9919,8779,5332,10626,1777,4654,10863,7351,3636,9585,5291,8374,
+
216  2166,4919,12176,9140,12129,7852,12286,4895,10805,2780,5195,2305,
+
217  7247,9644,4053,10600,3364,3271,4057,4414,9442,7917,2174
+
218 };
+
219 
+
220 static uint16_t const omegas_inv_montgomery[PARAM_N/2] PROGMEM = {
+
221  4075,5315,4324,4916,10120,11767,7210,9027,10316,6715,1278,9945,
+
222  3514,11248,11271,5925,147,8500,7840,6833,5537,4749,4467,7500,11099,
+
223  9606,6171,8471,8429,5445,11239,7753,9090,12233,5529,5206,10587,
+
224  1987,11635,3565,5415,8646,6153,6427,7341,6152,10561,400,8410,1922,
+
225  2033,8291,1359,6854,11035,973,8579,6093,6950,5446,11821,8301,11907,
+
226  316,52,3174,10966,9523,6055,8953,11612,6415,2505,5906,10710,11858,
+
227  8332,9450,10162,151,3482,787,5468,1010,4169,9162,5241,9369,7509,
+
228  8844,7232,4698,192,1321,10240,4912,885,6281,10333,7280,8757,11286,
+
229  58,12048,12147,11184,8812,6608,2844,3438,4212,11314,8687,6068,421,
+
230  8209,3600,3263,7665,6077,7507,5886,3029,6695,4213,504,11684,2302,
+
231  1962,1594,6328,7183,168,2692,8960,4298,5184,11089,6122,9734,10929,
+
232  3956,5297,6170,3762,9370,4016,4077,6523,652,11994,6099,1146,11341,
+
233  11964,10885,6299,1159,8240,8561,11177,2078,10331,4322,11367,441,
+
234  4079,11231,3150,1319,8243,709,8049,8719,11454,6224,3054,6803,3123,
+
235  10542,4433,6370,7032,3834,8633,12225,9830,683,1566,5782,9786,9341,
+
236  12115,723,3009,1693,5735,2655,2738,6421,11942,2925,1975,8532,3315,
+
237  11863,4754,1858,1583,6347,2500,10800,6374,1483,12240,1263,1815,
+
238  5383,10777,350,6920,10232,4493,9087,8855,8760,9381,218,9928,10446,
+
239  9259,4115,6147,9842,8326,576,10335,10238,10484,9407,6381,11836,8517,
+
240  418,6860,7515,1293,7552,2767,156,8298,8320,10008,5876,5333,10258,
+
241  10115,4372,2847,7875,8232,9018,8925,1689,8236,2645,5042,9984,7094,
+
242  9509,1484,7394,3,4437,160,3149,113,7370,10123,3915,6998,2704,8653,
+
243  4938,1426,7635,10512,1663,6957,3510,2370,2865,3978,9320,3247,9603,
+
244  6882,3186,10659,10163,1153,9405,8241,10040,2178,1544,5559,420,8304,
+
245  4905,476,3531,5191,9153,2399,8889,3000,671,243,3016,3763,10849,12262,
+
246  9223,10657,7205,11272,7404,7575,8146,10752,242,2678,3704,11744,
+
247  5019,3833,3778,11899,773,5101,11222,9888,442,2912,5698,11935,4861,
+
248  7277,9808,11244,2859,3780,11414,4976,10682,7201,8005,11287,5011,
+
249  6267,2987,2437,3646,2566,10102,9867,6250,5444,2381,11796,8193,4337,
+
250  11854,1912,1378,404,7644,1065,2143,11121,5277,3248,11082,2548,8058,
+
251  8907,11934,1759,8582,3694,7110,12144,6747,8652,3459,2731,8357,6378,
+
252  7399,10861,1696,9863,334,7657,6534,11029,4388,11560,3241,10276,9000,
+
253  9408,3284,10200,7197,6498,544,2468,339,11267,9,2842,480,5331,7300,
+
254  1673,4278,4177,8705,9764,1381,7837,2396,8340,8993,4354,130,6915,
+
255  2837,11462,5767,953,8541,9813,118,7222,2197,3006,9545,563,9314,
+
256  2625,11340,4821,2639,7266,5828,6561,7698,3328,6512,1351,7311,6553,
+
257  8155,1305,722,5146,4043,12288,10810,2545,3621,8747,8785,1646,1212,
+
258  5860,3195,7203,10963,3201,3014,955,11499,9970,11119,3135,3712,7443,
+
259  9542,7484,8736,9995,11227,1635,9521,1177,8034,140,10436,11563,7678,
+
260  4320,11289,9198,12208,2963,7393,2366,9238
+
261 };
+
262 
+
263 static uint16_t const psis_bitrev_montgomery[PARAM_N] PROGMEM = {
+
264  4075,6974,7373,7965,3262,5079,522,2169,6364,1018,1041,8775,2344,
+
265  11011,5574,1973,4536,1050,6844,3860,3818,6118,2683,1190,4789,7822,
+
266  7540,6752,5456,4449,3789,12142,11973,382,3988,468,6843,5339,6196,3710,
+
267  11316,1254,5435,10930,3998,10256,10367,3879,11889,1728,6137,4948,
+
268  5862,6136,3643,6874,8724,654,10302,1702,7083,6760,56,3199,9987,605,
+
269  11785,8076,5594,9260,6403,4782,6212,4624,9026,8689,4080,11868,6221,
+
270  3602,975,8077,8851,9445,5681,3477,1105,142,241,12231,1003,3532,5009,
+
271  1956,6008,11404,7377,2049,10968,12097,7591,5057,3445,4780,2920,
+
272  7048,3127,8120,11279,6821,11502,8807,12138,2127,2839,3957,431,1579,
+
273  6383,9784,5874,677,3336,6234,2766,1323,9115,12237,2031,6956,6413,
+
274  2281,3969,3991,12133,9522,4737,10996,4774,5429,11871,3772,453,
+
275  5908,2882,1805,2051,1954,11713,3963,2447,6142,8174,3030,1843,2361,
+
276  12071,2908,3529,3434,3202,7796,2057,5369,11939,1512,6906,10474,
+
277  11026,49,10806,5915,1489,9789,5942,10706,10431,7535,426,8974,3757,
+
278  10314,9364,347,5868,9551,9634,6554,10596,9280,11566,174,2948,2503,
+
279  6507,10723,11606,2459,64,3656,8455,5257,5919,7856,1747,9166,5486,
+
280  9235,6065,835,3570,4240,11580,4046,10970,9139,1058,8210,11848,922,
+
281  7967,1958,10211,1112,3728,4049,11130,5990,1404,325,948,11143,6190,
+
282  295,11637,5766,8212,8273,2919,8527,6119,6992,8333,1360,2555,6167,
+
283  1200,7105,7991,3329,9597,12121,5106,5961,10695,10327,3051,9923,
+
284  4896,9326,81,3091,1000,7969,4611,726,1853,12149,4255,11112,2768,
+
285  10654,1062,2294,3553,4805,2747,4846,8577,9154,1170,2319,790,11334,
+
286  9275,9088,1326,5086,9094,6429,11077,10643,3504,3542,8668,9744,1479,
+
287  1,8246,7143,11567,10984,4134,5736,4978,10938,5777,8961,4591,5728,
+
288  6461,5023,9650,7468,949,9664,2975,11726,2744,9283,10092,5067,12171,
+
289  2476,3748,11336,6522,827,9452,5374,12159,7935,3296,3949,9893,4452,
+
290  10908,2525,3584,8112,8011,10616,4989,6958,11809,9447,12280,1022,
+
291  11950,9821,11745,5791,5092,2089,9005,2881,3289,2013,9048,729,7901,
+
292  1260,5755,4632,11955,2426,10593,1428,4890,5911,3932,9558,8830,3637,
+
293  5542,145,5179,8595,3707,10530,355,3382,4231,9741,1207,9041,7012,
+
294  1168,10146,11224,4645,11885,10911,10377,435,7952,4096,493,9908,6845,
+
295  6039,2422,2187,9723,8643,9852,9302,6022,7278,1002,4284,5088,1607,
+
296  7313,875,8509,9430,1045,2481,5012,7428,354,6591,9377,11847,2401,
+
297  1067,7188,11516,390,8511,8456,7270,545,8585,9611,12047,1537,4143,
+
298  4714,4885,1017,5084,1632,3066,27,1440,8526,9273,12046,11618,9289,
+
299  3400,9890,3136,7098,8758,11813,7384,3985,11869,6730,10745,10111,
+
300  2249,4048,2884,11136,2126,1630,9103,5407,2686,9042,2969,8311,9424,
+
301  9919,8779,5332,10626,1777,4654,10863,7351,3636,9585,5291,8374,
+
302  2166,4919,12176,9140,12129,7852,12286,4895,10805,2780,5195,2305,
+
303  7247,9644,4053,10600,3364,3271,4057,4414,9442,7917,2174,3947,
+
304  11951,2455,6599,10545,10975,3654,2894,7681,7126,7287,12269,4119,
+
305  3343,2151,1522,7174,7350,11041,2442,2148,5959,6492,8330,8945,5598,
+
306  3624,10397,1325,6565,1945,11260,10077,2674,3338,3276,11034,506,
+
307  6505,1392,5478,8778,1178,2776,3408,10347,11124,2575,9489,12096,
+
308  6092,10058,4167,6085,923,11251,11912,4578,10669,11914,425,10453,
+
309  392,10104,8464,4235,8761,7376,2291,3375,7954,8896,6617,7790,1737,
+
310  11667,3982,9342,6680,636,6825,7383,512,4670,2900,12050,7735,994,
+
311  1687,11883,7021,146,10485,1403,5189,6094,2483,2054,3042,10945,
+
312  3981,10821,11826,8882,8151,180,9600,7684,5219,10880,6780,204,
+
313  11232,2600,7584,3121,3017,11053,7814,7043,4251,4739,11063,6771,
+
314  7073,9261,2360,11925,1928,11825,8024,3678,3205,3359,11197,5209,
+
315  8581,3238,8840,1136,9363,1826,3171,4489,7885,346,2068,1389,8257,
+
316  3163,4840,6127,8062,8921,612,4238,10763,8067,125,11749,10125,5416,
+
317  2110,716,9839,10584,11475,11873,3448,343,1908,4538,10423,7078,
+
318  4727,1208,11572,3589,2982,1373,1721,10753,4103,2429,4209,5412,
+
319  5993,9011,438,3515,7228,1218,8347,5232,8682,1327,7508,4924,448,
+
320  1014,10029,12221,4566,5836,12229,2717,1535,3200,5588,5845,412,
+
321  5102,7326,3744,3056,2528,7406,8314,9202,6454,6613,1417,10032,7784,
+
322  1518,3765,4176,5063,9828,2275,6636,4267,6463,2065,7725,3495,8328,
+
323  8755,8144,10533,5966,12077,9175,9520,5596,6302,8400,579,6781,11014,
+
324  5734,11113,11164,4860,1131,10844,9068,8016,9694,3837,567,9348,7000,
+
325  6627,7699,5082,682,11309,5207,4050,7087,844,7434,3769,293,9057,
+
326  6940,9344,10883,2633,8190,3944,5530,5604,3480,2171,9282,11024,2213,
+
327  8136,3805,767,12239,216,11520,6763,10353,7,8566,845,7235,3154,4360,
+
328  3285,10268,2832,3572,1282,7559,3229,8360,10583,6105,3120,6643,6203,
+
329  8536,8348,6919,3536,9199,10891,11463,5043,1658,5618,8787,5789,4719,
+
330  751,11379,6389,10783,3065,7806,6586,2622,5386,510,7628,6921,578,
+
331  10345,11839,8929,4684,12226,7154,9916,7302,8481,3670,11066,2334,
+
332  1590,7878,10734,1802,1891,5103,6151,8820,3418,7846,9951,4693,417,
+
333  9996,9652,4510,2946,5461,365,881,1927,1015,11675,11009,1371,12265,
+
334  2485,11385,5039,6742,8449,1842,12217,8176,9577,4834,7937,9461,2643,
+
335  11194,3045,6508,4094,3451,7911,11048,5406,4665,3020,6616,11345,
+
336  7519,3669,5287,1790,7014,5410,11038,11249,2035,6125,10407,4565,
+
337  7315,5078,10506,2840,2478,9270,4194,9195,4518,7469,1160,6878,2730,
+
338  10421,10036,1734,3815,10939,5832,10595,10759,4423,8420,9617,7119,
+
339  11010,11424,9173,189,10080,10526,3466,10588,7592,3578,11511,7785,
+
340  9663,530,12150,8957,2532,3317,9349,10243,1481,9332,3454,3758,7899,
+
341  4218,2593,11410,2276,982,6513,1849,8494,9021,4523,7988,8,457,648,
+
342  150,8000,2307,2301,874,5650,170,9462,2873,9855,11498,2535,11169,
+
343  5808,12268,9687,1901,7171,11787,3846,1573,6063,3793,466,11259,
+
344  10608,3821,6320,4649,6263,2929
+
345 };
+
346 
+
347 static uint16_t const psis_inv_montgomery[PARAM_N] PROGMEM = {
+
348  256,10570,1510,7238,1034,7170,6291,7921,11665,3422,4000,2327,
+
349  2088,5565,795,10647,1521,5484,2539,7385,1055,7173,8047,11683,
+
350  1669,1994,3796,5809,4341,9398,11876,12230,10525,12037,12253,
+
351  3506,4012,9351,4847,2448,7372,9831,3160,2207,5582,2553,7387,6322,
+
352  9681,1383,10731,1533,219,5298,4268,7632,6357,9686,8406,4712,9451,
+
353  10128,4958,5975,11387,8649,11769,6948,11526,12180,1740,10782,
+
354  6807,2728,7412,4570,4164,4106,11120,12122,8754,11784,3439,5758,
+
355  11356,6889,9762,11928,1704,1999,10819,12079,12259,7018,11536,
+
356  1648,1991,2040,2047,2048,10826,12080,8748,8272,8204,1172,1923,
+
357  7297,2798,7422,6327,4415,7653,6360,11442,12168,7005,8023,9924,
+
358  8440,8228,2931,7441,1063,3663,5790,9605,10150,1450,8985,11817,
+
359  10466,10273,12001,3470,7518,1074,1909,7295,9820,4914,702,5367,
+
360  7789,8135,9940,1420,3714,11064,12114,12264,1752,5517,9566,11900,
+
361  1700,3754,5803,829,1874,7290,2797,10933,5073,7747,8129,6428,
+
362  6185,11417,1631,233,5300,9535,10140,11982,8734,8270,2937,10953,
+
363  8587,8249,2934,9197,4825,5956,4362,9401,1343,3703,529,10609,
+
364  12049,6988,6265,895,3639,4031,4087,4095,585,10617,8539,4731,
+
365  4187,9376,3095,9220,10095,10220,1460,10742,12068,1724,5513,
+
366  11321,6884,2739,5658,6075,4379,11159,10372,8504,4726,9453,3106,
+
367  7466,11600,10435,8513,9994,8450,9985,3182,10988,8592,2983,9204,
+
368  4826,2445,5616,6069,867,3635,5786,11360,5134,2489,10889,12089,
+
369  1727,7269,2794,9177,1311,5454,9557,6632,2703,9164,10087,1441,
+
370  3717,531,3587,2268,324,5313,759,1864,5533,2546,7386,9833,8427,
+
371  4715,11207,1601,7251,4547,11183,12131,1733,10781,10318,1474,
+
372  10744,5046,4232,11138,10369,6748,964,7160,4534,7670,8118,8182,
+
373  4680,11202,6867,981,8918,1274,182,26,7026,8026,11680,12202,
+
374  10521,1503,7237,4545,5916,9623,8397,11733,10454,3249,9242,6587,
+
375  941,1890,270,10572,6777,9746,6659,6218,6155,6146,878,1881,7291,
+
376  11575,12187,1741,7271,8061,11685,6936,4502,9421,4857,4205,7623,
+
377  1089,10689,1527,8996,10063,11971,10488,6765,2722,3900,9335,11867,
+
378  6962,11528,5158,4248,4118,5855,2592,5637,6072,2623,7397,8079,
+
379  9932,4930,5971,853,3633,519,8852,11798,3441,11025,1575,225,8810,
+
380  11792,12218,3501,9278,3081,9218,4828,7712,8124,11694,12204,3499,
+
381  4011,573,3593,5780,7848,9899,10192,1456,208,7052,2763,7417,11593,
+
382  10434,12024,8740,11782,10461,3250,5731,7841,9898,1414,202,3540,
+
383  7528,2831,2160,10842,5060,4234,4116,588,84,12,7024,2759,9172,6577,
+
384  11473,1639,9012,3043,7457,6332,11438,1634,1989,9062,11828,8712,
+
385  11778,12216,10523,6770,9745,10170,4964,9487,6622,946,8913,6540,
+
386  6201,4397,9406,8366,9973,8447,8229,11709,8695,10020,3187,5722,
+
387  2573,10901,6824,4486,4152,9371,8361,2950,2177,311,1800,9035,
+
388  8313,11721,3430,490,70,10,1757,251,3547,7529,11609,3414,7510,
+
389  4584,4166,9373,1339,5458,7802,11648,1664,7260,9815,10180,6721,
+
390  9738,10169,8475,8233,9954,1422,8981,1283,5450,11312,1616,3742,
+
391  11068,10359,4991,713,3613,9294,8350,4704,672,96,7036,9783,11931,
+
392  3460,5761,823,10651,12055,10500,1500,5481,783,3623,11051,8601,
+
393  8251,8201,11705,10450,5004,4226,7626,2845,2162,3820,7568,9859,
+
394  3164,452,10598,1514,5483,6050,6131,4387,7649,8115,6426,918,8909,
+
395  8295,1185,5436,11310,8638,1234,5443,11311,5127,2488,2111,10835,
+
396  5059,7745,2862,3920,560,80,1767,2008,3798,11076,6849,2734,10924,
+
397  12094,8750,1250,10712,6797,971,7161,1023,8924,4786,7706,4612,4170,
+
398  7618,6355,4419,5898,11376,10403,10264,6733,4473,639,5358,2521,
+
399  9138,3061,5704,4326,618,5355,765,5376,768,7132,4530,9425,3102,
+
400  9221,6584,11474,10417,10266,12000,6981,6264,4406,2385,7363,4563,
+
401  4163,7617,9866,3165,9230,11852,10471,5007,5982,11388,5138,734,
+
402  3616,11050,12112,6997,11533,12181,10518,12036,3475,2252,7344,
+
403  9827,4915,9480,6621,4457,7659,9872,6677,4465,4149,7615,4599,657,
+
404  3605,515,10607,6782,4480,640,1847,3775,5806,2585,5636,9583,1369,
+
405  10729,8555,10000,11962,5220,7768,8132,8184,9947,1421,203,29,8782,
+
406  11788,1684,10774,10317,4985,9490,8378,4708,11206,5112,5997,7879,
+
407  11659,12199,8765,10030,4944,5973,6120,6141,6144,7900,11662,1666,
+
408  238,34,3516,5769,9602,8394,9977,6692,956,10670,6791,9748,11926,
+
409  8726,11780,5194,742,106,8793,10034,3189,10989,5081,4237,5872,4350,
+
410  2377,10873,6820,6241,11425,10410,10265,3222,5727,9596,4882,2453,
+
411  2106,3812,11078,12116,5242,4260,11142,8614,11764,12214,5256,4262,
+
412  4120,11122,5100,11262,5120,2487,5622,9581,8391,8221,2930,10952,
+
413  12098,6995,6266,9673,4893,699,3611,4027,5842,11368,1624,232,8811,
+
414  8281,1183,169,8802,3013,2186,5579,797,3625,4029,11109,1587,7249,
+
415  11569,8675,6506,2685,10917,12093,12261,12285,1755,7273,1039,1904,
+
416  272,3550,9285,3082,5707,6082,4380,7648,11626,5172,4250,9385,8363,
+
417  8217,4685,5936,848,8899,6538,934,1889,3781,9318,10109,10222,6727,
+
418  961,5404,772,5377,9546,8386,1198,8949,3034,2189,7335,4559,5918,2601,
+
419  10905,5069,9502,3113,7467,8089,11689,5181,9518,8382,2953,3933,4073,
+
420  4093,7607,8109,2914,5683,4323,11151,1593,10761,6804,972,3650,2277,
+
421  5592,4310,7638,9869,4921,703,1856,9043,4803,9464,1352,8971,11815,
+
422  5199,7765,6376,4422,7654,2849,407,8836,6529,7955,2892,9191,1313,
+
423  10721,12065,12257,1751,9028,8312,2943,2176,3822,546,78,8789,11789,
+
424  10462,12028,6985,4509,9422,1346,5459,4291,613,10621,6784,9747,3148,
+
425  7472,2823,5670,810,7138,8042,4660,7688,6365,6176,6149,2634,5643,
+
426  9584,10147,11983,5223,9524,11894,10477,8519,1217,3685,2282,326,
+
427  10580,3267,7489,4581,2410,5611,11335,6886,8006,8166,11700,3427,
+
428  11023,8597,10006,3185,455,65,5276,7776,4622,5927,7869,9902,11948,
+
429  5218,2501,5624,2559,10899,1557,1978,10816,10323,8497,4725,675,1852,
+
430  10798,12076,10503,3256,9243,3076,2195,10847,12083,10504,12034,10497
431 };
432 
-
433 /* Incomplete-reduction routines; for details on allowed input ranges
-
434  * and produced output ranges, see the description in the paper:
-
435  * https://cryptojedi.org/papers/#newhope */
-
436 
-
437 #define qinv 12287 // -inverse_mod(p,2^18)
-
438 #define rlog 18
-
439 
-
440 inline uint16_t montgomery_reduce(uint32_t a)
-
441 {
-
442  uint32_t u;
-
443 
-
444  u = (a * qinv);
-
445  u &= ((1<<rlog)-1);
-
446  u *= PARAM_Q;
-
447  a = a + u;
-
448  return a >> 18;
-
449 }
-
450 
-
451 inline uint16_t barrett_reduce(uint16_t a)
-
452 {
-
453  uint32_t u;
-
454 
-
455  u = ((uint32_t) a * 5) >> 16;
-
456  u *= PARAM_Q;
-
457  a -= u;
-
458  return a;
-
459 }
-
460 
-
461 static void bitrev_vector(uint16_t* poly)
-
462 {
-
463  unsigned int i,r;
-
464  uint16_t tmp;
-
465 
-
466  for(i = 0; i < PARAM_N; i++)
-
467  {
-
468  r = bitrev_table[i];
-
469  if (i < r)
-
470  {
-
471  tmp = poly[i];
-
472  poly[i] = poly[r];
-
473  poly[r] = tmp;
-
474  }
-
475  }
-
476 }
-
477 
-
478 static void mul_coefficients(uint16_t* poly, const uint16_t* factors)
-
479 {
-
480  unsigned int i;
-
481 
-
482  for(i = 0; i < PARAM_N; i++)
-
483  poly[i] = montgomery_reduce((poly[i] * factors[i]));
+
433 static uint16_t const bitrev_table[PARAM_N] PROGMEM = {
+
434  0,512,256,768,128,640,384,896,64,576,320,832,192,704,448,960,32,544,288,800,160,672,416,928,96,608,352,864,224,736,480,992,
+
435  16,528,272,784,144,656,400,912,80,592,336,848,208,720,464,976,48,560,304,816,176,688,432,944,112,624,368,880,240,752,496,1008,
+
436  8,520,264,776,136,648,392,904,72,584,328,840,200,712,456,968,40,552,296,808,168,680,424,936,104,616,360,872,232,744,488,1000,
+
437  24,536,280,792,152,664,408,920,88,600,344,856,216,728,472,984,56,568,312,824,184,696,440,952,120,632,376,888,248,760,504,1016,
+
438  4,516,260,772,132,644,388,900,68,580,324,836,196,708,452,964,36,548,292,804,164,676,420,932,100,612,356,868,228,740,484,996,
+
439  20,532,276,788,148,660,404,916,84,596,340,852,212,724,468,980,52,564,308,820,180,692,436,948,116,628,372,884,244,756,500,1012,
+
440  12,524,268,780,140,652,396,908,76,588,332,844,204,716,460,972,44,556,300,812,172,684,428,940,108,620,364,876,236,748,492,1004,
+
441  28,540,284,796,156,668,412,924,92,604,348,860,220,732,476,988,60,572,316,828,188,700,444,956,124,636,380,892,252,764,508,1020,
+
442  2,514,258,770,130,642,386,898,66,578,322,834,194,706,450,962,34,546,290,802,162,674,418,930,98,610,354,866,226,738,482,994,
+
443  18,530,274,786,146,658,402,914,82,594,338,850,210,722,466,978,50,562,306,818,178,690,434,946,114,626,370,882,242,754,498,1010,
+
444  10,522,266,778,138,650,394,906,74,586,330,842,202,714,458,970,42,554,298,810,170,682,426,938,106,618,362,874,234,746,490,1002,
+
445  26,538,282,794,154,666,410,922,90,602,346,858,218,730,474,986,58,570,314,826,186,698,442,954,122,634,378,890,250,762,506,1018,
+
446  6,518,262,774,134,646,390,902,70,582,326,838,198,710,454,966,38,550,294,806,166,678,422,934,102,614,358,870,230,742,486,998,
+
447  22,534,278,790,150,662,406,918,86,598,342,854,214,726,470,982,54,566,310,822,182,694,438,950,118,630,374,886,246,758,502,1014,
+
448  14,526,270,782,142,654,398,910,78,590,334,846,206,718,462,974,46,558,302,814,174,686,430,942,110,622,366,878,238,750,494,1006,
+
449  30,542,286,798,158,670,414,926,94,606,350,862,222,734,478,990,62,574,318,830,190,702,446,958,126,638,382,894,254,766,510,1022,
+
450  1,513,257,769,129,641,385,897,65,577,321,833,193,705,449,961,33,545,289,801,161,673,417,929,97,609,353,865,225,737,481,993,
+
451  17,529,273,785,145,657,401,913,81,593,337,849,209,721,465,977,49,561,305,817,177,689,433,945,113,625,369,881,241,753,497,1009,
+
452  9,521,265,777,137,649,393,905,73,585,329,841,201,713,457,969,41,553,297,809,169,681,425,937,105,617,361,873,233,745,489,1001,
+
453  25,537,281,793,153,665,409,921,89,601,345,857,217,729,473,985,57,569,313,825,185,697,441,953,121,633,377,889,249,761,505,1017,
+
454  5,517,261,773,133,645,389,901,69,581,325,837,197,709,453,965,37,549,293,805,165,677,421,933,101,613,357,869,229,741,485,997,
+
455  21,533,277,789,149,661,405,917,85,597,341,853,213,725,469,981,53,565,309,821,181,693,437,949,117,629,373,885,245,757,501,1013,
+
456  13,525,269,781,141,653,397,909,77,589,333,845,205,717,461,973,45,557,301,813,173,685,429,941,109,621,365,877,237,749,493,1005,
+
457  29,541,285,797,157,669,413,925,93,605,349,861,221,733,477,989,61,573,317,829,189,701,445,957,125,637,381,893,253,765,509,1021,
+
458  3,515,259,771,131,643,387,899,67,579,323,835,195,707,451,963,35,547,291,803,163,675,419,931,99,611,355,867,227,739,483,995,
+
459  19,531,275,787,147,659,403,915,83,595,339,851,211,723,467,979,51,563,307,819,179,691,435,947,115,627,371,883,243,755,499,1011,
+
460  11,523,267,779,139,651,395,907,75,587,331,843,203,715,459,971,43,555,299,811,171,683,427,939,107,619,363,875,235,747,491,1003,
+
461  27,539,283,795,155,667,411,923,91,603,347,859,219,731,475,987,59,571,315,827,187,699,443,955,123,635,379,891,251,763,507,1019,
+
462  7,519,263,775,135,647,391,903,71,583,327,839,199,711,455,967,39,551,295,807,167,679,423,935,103,615,359,871,231,743,487,999,
+
463  23,535,279,791,151,663,407,919,87,599,343,855,215,727,471,983,55,567,311,823,183,695,439,951,119,631,375,887,247,759,503,1015,
+
464  15,527,271,783,143,655,399,911,79,591,335,847,207,719,463,975,47,559,303,815,175,687,431,943,111,623,367,879,239,751,495,1007,
+
465  31,543,287,799,159,671,415,927,95,607,351,863,223,735,479,991,63,575,319,831,191,703,447,959,127,639,383,895,255,767,511,1023
+
466 };
+
467 
+
468 /* Incomplete-reduction routines; for details on allowed input ranges
+
469  * and produced output ranges, see the description in the paper:
+
470  * https://cryptojedi.org/papers/#newhope */
+
471 
+
472 #define qinv 12287 // -inverse_mod(p,2^18)
+
473 #define rlog 18
+
474 
+
475 inline uint16_t montgomery_reduce(uint32_t a)
+
476 {
+
477  uint32_t u;
+
478 
+
479  u = (a * qinv);
+
480  u &= ((((uint32_t)1)<<rlog)-1);
+
481  u *= PARAM_Q;
+
482  a = a + u;
+
483  return a >> 18;
484 }
485 
-
486 /* GS_bo_to_no; omegas need to be in Montgomery domain */
-
487 static void ntt(uint16_t * a, const uint16_t* omega)
-
488 {
-
489  int i, start, j, jTwiddle, distance;
-
490  uint16_t temp, W;
-
491 
-
492 
-
493  for(i=0;i<10;i+=2)
-
494  {
-
495  // Even level
-
496  distance = (1<<i);
-
497  for(start = 0; start < distance;start++)
-
498  {
-
499  jTwiddle = 0;
-
500  for(j=start;j<PARAM_N-1;j+=2*distance)
-
501  {
-
502  W = omega[jTwiddle++];
-
503  temp = a[j];
-
504  a[j] = (temp + a[j + distance]); // Omit reduction (be lazy)
-
505  a[j + distance] = montgomery_reduce((W * ((uint32_t)temp + 3*PARAM_Q - a[j + distance])));
-
506  }
-
507  }
-
508 
-
509  // Odd level
-
510  distance <<= 1;
-
511  for(start = 0; start < distance;start++)
-
512  {
-
513  jTwiddle = 0;
-
514  for(j=start;j<PARAM_N-1;j+=2*distance)
-
515  {
-
516  W = omega[jTwiddle++];
-
517  temp = a[j];
-
518  a[j] = barrett_reduce((temp + a[j + distance]));
-
519  a[j + distance] = montgomery_reduce((W * ((uint32_t)temp + 3*PARAM_Q - a[j + distance])));
-
520  }
-
521  }
-
522  }
-
523 }
-
524 
-
525 static int32_t abs(int32_t v)
-
526 {
-
527  int32_t mask = v >> 31;
-
528  return (v ^ mask) - mask;
-
529 }
-
530 
-
531 static int32_t f(int32_t *v0, int32_t *v1, uint32_t x)
-
532 {
-
533  int32_t xit, t, r, b;
-
534 
-
535  // Next 6 lines compute t = x/PARAM_Q;
-
536  b = x*2730;
-
537  t = b >> 25;
-
538  b = x - t*12289;
-
539  b = 12288 - b;
-
540  b >>= 31;
-
541  t -= b;
-
542 
-
543  r = t & 1;
-
544  xit = (t>>1);
-
545  *v0 = xit+r; // v0 = round(x/(2*PARAM_Q))
-
546 
-
547  t -= 1;
-
548  r = t & 1;
-
549  *v1 = (t>>1)+r;
-
550 
-
551  return abs(x-((*v0)*2*PARAM_Q));
-
552 }
-
553 
-
554 static int32_t g(int32_t x)
-
555 {
-
556  int32_t t,c,b;
-
557 
-
558  // Next 6 lines compute t = x/(4*PARAM_Q);
-
559  b = x*2730;
-
560  t = b >> 27;
-
561  b = x - t*49156;
-
562  b = 49155 - b;
-
563  b >>= 31;
-
564  t -= b;
+
486 inline uint16_t barrett_reduce(uint16_t a)
+
487 {
+
488  uint32_t u;
+
489 
+
490  u = ((uint32_t) a * 5) >> 16;
+
491  u *= PARAM_Q;
+
492  a -= u;
+
493  return a;
+
494 }
+
495 
+
496 static void bitrev_vector(uint16_t* poly)
+
497 {
+
498  unsigned int i,r;
+
499  uint16_t tmp;
+
500 
+
501  for(i = 0; i < PARAM_N; i++)
+
502  {
+
503  r = table_read(bitrev_table,i);
+
504  if (i < r)
+
505  {
+
506  tmp = poly[i];
+
507  poly[i] = poly[r];
+
508  poly[r] = tmp;
+
509  }
+
510  }
+
511 }
+
512 
+
513 static void mul_coefficients(uint16_t* poly, const uint16_t* factors)
+
514 {
+
515  unsigned int i;
+
516 
+
517  for(i = 0; i < PARAM_N; i++)
+
518  poly[i] = montgomery_reduce((poly[i] * (uint32_t)table_read(factors,i)));
+
519 }
+
520 
+
521 /* GS_bo_to_no; omegas need to be in Montgomery domain */
+
522 static void ntt(uint16_t * a, const uint16_t* omega)
+
523 {
+
524  int i, start, j, jTwiddle, distance;
+
525  uint16_t temp, W;
+
526 
+
527 
+
528  for(i=0;i<10;i+=2)
+
529  {
+
530  // Even level
+
531  distance = (1<<i);
+
532  for(start = 0; start < distance;start++)
+
533  {
+
534  jTwiddle = 0;
+
535  for(j=start;j<PARAM_N-1;j+=2*distance)
+
536  {
+
537  W = table_read(omega,jTwiddle++);
+
538  temp = a[j];
+
539  a[j] = (temp + a[j + distance]); // Omit reduction (be lazy)
+
540  a[j + distance] = montgomery_reduce((W * ((uint32_t)temp + 3*PARAM_Q - a[j + distance])));
+
541  }
+
542  }
+
543 
+
544  // Odd level
+
545  distance <<= 1;
+
546  for(start = 0; start < distance;start++)
+
547  {
+
548  jTwiddle = 0;
+
549  for(j=start;j<PARAM_N-1;j+=2*distance)
+
550  {
+
551  W = table_read(omega,jTwiddle++);
+
552  temp = a[j];
+
553  a[j] = barrett_reduce((temp + a[j + distance]));
+
554  a[j + distance] = montgomery_reduce((W * ((uint32_t)temp + 3*PARAM_Q - a[j + distance])));
+
555  }
+
556  }
+
557  }
+
558 }
+
559 
+
560 static int32_t abs(int32_t v)
+
561 {
+
562  int32_t mask = v >> 31;
+
563  return (v ^ mask) - mask;
+
564 }
565 
-
566  c = t & 1;
-
567  t = (t >> 1) + c; // t = round(x/(8*PARAM_Q))
-
568 
-
569  t *= 8*PARAM_Q;
-
570 
-
571  return abs(t - x);
-
572 }
-
573 
-
574 static int16_t LDDecode(int32_t xi0, int32_t xi1, int32_t xi2, int32_t xi3)
-
575 {
-
576  int32_t t;
+
566 static int32_t f(int32_t *v0, int32_t *v1, uint32_t x)
+
567 {
+
568  int32_t xit, t, r, b;
+
569 
+
570  // Next 6 lines compute t = x/PARAM_Q;
+
571  b = x*2730;
+
572  t = b >> 25;
+
573  b = x - t*12289;
+
574  b = 12288 - b;
+
575  b >>= 31;
+
576  t -= b;
577 
-
578  t = g(xi0);
-
579  t += g(xi1);
-
580  t += g(xi2);
-
581  t += g(xi3);
-
582 
-
583  t -= 8*PARAM_Q;
-
584  t >>= 31;
-
585  return t&1;
-
586 }
-
587 
-
588 static void crypto_chacha20_set_key(uint32_t *block, const unsigned char *k, const unsigned char *n);
-
589 
-
590 static void helprec(uint16_t *c, const uint16_t *v, const unsigned char *seed, unsigned char nonce)
-
591 {
-
592  int32_t v0[4], v1[4], v_tmp[4], k;
-
593  unsigned char rbit;
-
594  unsigned char *rand;
-
595  unsigned char n[8];
-
596  uint32_t input[16];
-
597  uint32_t output[16];
-
598  int i;
-
599 
-
600  for(i=0;i<7;i++)
-
601  n[i] = 0;
-
602  n[7] = nonce;
+
578  r = t & 1;
+
579  xit = (t>>1);
+
580  *v0 = xit+r; // v0 = round(x/(2*PARAM_Q))
+
581 
+
582  t -= 1;
+
583  r = t & 1;
+
584  *v1 = (t>>1)+r;
+
585 
+
586  return abs(x-((*v0)*2*PARAM_Q));
+
587 }
+
588 
+
589 static int32_t g(int32_t x)
+
590 {
+
591  int32_t t,c,b;
+
592 
+
593  // Next 6 lines compute t = x/(4*PARAM_Q);
+
594  b = x*2730;
+
595  t = b >> 27;
+
596  b = x - t*49156;
+
597  b = 49155 - b;
+
598  b >>= 31;
+
599  t -= b;
+
600 
+
601  c = t & 1;
+
602  t = (t >> 1) + c; // t = round(x/(8*PARAM_Q))
603 
-
604  //crypto_stream_chacha20(rand,32,n,seed);
-
605  crypto_chacha20_set_key(input, seed, n);
-
606  ChaCha::hashCore(output, input, 20);
-
607  rand = (unsigned char *)output;
-
608 
-
609  for(i=0; i<256; i++)
-
610  {
-
611  rbit = (rand[i>>3] >> (i&7)) & 1;
+
604  t *= 8*PARAM_Q;
+
605 
+
606  return abs(t - x);
+
607 }
+
608 
+
609 static int16_t LDDecode(int32_t xi0, int32_t xi1, int32_t xi2, int32_t xi3)
+
610 {
+
611  int32_t t;
612 
-
613  k = f(v0+0, v1+0, 8*v[ 0+i] + 4*rbit);
-
614  k += f(v0+1, v1+1, 8*v[256+i] + 4*rbit);
-
615  k += f(v0+2, v1+2, 8*v[512+i] + 4*rbit);
-
616  k += f(v0+3, v1+3, 8*v[768+i] + 4*rbit);
+
613  t = g(xi0);
+
614  t += g(xi1);
+
615  t += g(xi2);
+
616  t += g(xi3);
617 
-
618  k = (2*PARAM_Q-1-k) >> 31;
-
619 
-
620  v_tmp[0] = ((~k) & v0[0]) ^ (k & v1[0]);
-
621  v_tmp[1] = ((~k) & v0[1]) ^ (k & v1[1]);
-
622  v_tmp[2] = ((~k) & v0[2]) ^ (k & v1[2]);
-
623  v_tmp[3] = ((~k) & v0[3]) ^ (k & v1[3]);
-
624 
-
625  c[ 0+i] = (v_tmp[0] - v_tmp[3]) & 3;
-
626  c[256+i] = (v_tmp[1] - v_tmp[3]) & 3;
-
627  c[512+i] = (v_tmp[2] - v_tmp[3]) & 3;
-
628  c[768+i] = ( -k + 2*v_tmp[3]) & 3;
-
629  }
-
630 
-
631  clean(input);
-
632  clean(output);
-
633 }
-
634 
-
635 static void rec(unsigned char *key, const uint16_t *v, const uint16_t *c)
-
636 {
-
637  int i;
-
638  int32_t tmp[4];
-
639 
-
640  for(i=0;i<32;i++)
-
641  key[i] = 0;
-
642 
-
643  for(i=0; i<256; i++)
-
644  {
-
645  tmp[0] = 16*PARAM_Q + 8*(int32_t)v[ 0+i] - PARAM_Q * (2*c[ 0+i]+c[768+i]);
-
646  tmp[1] = 16*PARAM_Q + 8*(int32_t)v[256+i] - PARAM_Q * (2*c[256+i]+c[768+i]);
-
647  tmp[2] = 16*PARAM_Q + 8*(int32_t)v[512+i] - PARAM_Q * (2*c[512+i]+c[768+i]);
-
648  tmp[3] = 16*PARAM_Q + 8*(int32_t)v[768+i] - PARAM_Q * ( c[768+i]);
-
649 
-
650  key[i>>3] |= LDDecode(tmp[0], tmp[1], tmp[2], tmp[3]) << (i & 7);
-
651  }
-
652 }
-
653 
-
654 static void poly_frombytes(uint16_t *r, const unsigned char *a)
-
655 {
-
656  int i;
-
657  for(i=0;i<PARAM_N/4;i++)
-
658  {
-
659  r[4*i+0] = a[7*i+0] | (((uint16_t)a[7*i+1] & 0x3f) << 8);
-
660  r[4*i+1] = (a[7*i+1] >> 6) | (((uint16_t)a[7*i+2]) << 2) | (((uint16_t)a[7*i+3] & 0x0f) << 10);
-
661  r[4*i+2] = (a[7*i+3] >> 4) | (((uint16_t)a[7*i+4]) << 4) | (((uint16_t)a[7*i+5] & 0x03) << 12);
-
662  r[4*i+3] = (a[7*i+5] >> 2) | (((uint16_t)a[7*i+6]) << 6);
-
663  }
-
664 }
-
665 
-
666 static void poly_tobytes(unsigned char *r, const uint16_t *p)
-
667 {
-
668  int i;
-
669  uint16_t t0,t1,t2,t3,m;
-
670  int16_t c;
-
671  for(i=0;i<PARAM_N/4;i++)
-
672  {
-
673  t0 = barrett_reduce(p[4*i+0]); //Make sure that coefficients have only 14 bits
-
674  t1 = barrett_reduce(p[4*i+1]);
-
675  t2 = barrett_reduce(p[4*i+2]);
-
676  t3 = barrett_reduce(p[4*i+3]);
-
677 
-
678  m = t0 - PARAM_Q;
-
679  c = m;
-
680  c >>= 15;
-
681  t0 = m ^ ((t0^m)&c); // <Make sure that coefficients are in [0,q]
-
682 
-
683  m = t1 - PARAM_Q;
-
684  c = m;
-
685  c >>= 15;
-
686  t1 = m ^ ((t1^m)&c); // <Make sure that coefficients are in [0,q]
-
687 
-
688  m = t2 - PARAM_Q;
-
689  c = m;
-
690  c >>= 15;
-
691  t2 = m ^ ((t2^m)&c); // <Make sure that coefficients are in [0,q]
+
618  t -= 8*PARAM_Q;
+
619  t >>= 31;
+
620  return t&1;
+
621 }
+
622 
+
623 static void helprec(NewHopeChaChaState *chacha, uint16_t *c, const uint16_t *v, unsigned char nonce)
+
624 {
+
625  int32_t v0[4], v1[4], v_tmp[4], k;
+
626  unsigned char rbit;
+
627  unsigned char *rand;
+
628  int i;
+
629 
+
630  chacha->input[12] = 0;
+
631  chacha->input[13] = 0;
+
632  chacha->input[14] = 0;
+
633  chacha->input[15] = (((uint32_t)nonce) << 24); // Assumes little-endian.
+
634  ChaCha::hashCore(chacha->output, chacha->input, 20);
+
635  rand = (unsigned char *)chacha->output;
+
636 
+
637  for(i=0; i<256; i++)
+
638  {
+
639  rbit = (rand[i>>3] >> (i&7)) & 1;
+
640 
+
641  k = f(v0+0, v1+0, 8*(int32_t)v[ 0+i] + 4*rbit);
+
642  k += f(v0+1, v1+1, 8*(int32_t)v[256+i] + 4*rbit);
+
643  k += f(v0+2, v1+2, 8*(int32_t)v[512+i] + 4*rbit);
+
644  k += f(v0+3, v1+3, 8*(int32_t)v[768+i] + 4*rbit);
+
645 
+
646  k = (2*PARAM_Q-1-k) >> 31;
+
647 
+
648  v_tmp[0] = ((~k) & v0[0]) ^ (k & v1[0]);
+
649  v_tmp[1] = ((~k) & v0[1]) ^ (k & v1[1]);
+
650  v_tmp[2] = ((~k) & v0[2]) ^ (k & v1[2]);
+
651  v_tmp[3] = ((~k) & v0[3]) ^ (k & v1[3]);
+
652 
+
653  c[ 0+i] = (v_tmp[0] - v_tmp[3]) & 3;
+
654  c[256+i] = (v_tmp[1] - v_tmp[3]) & 3;
+
655  c[512+i] = (v_tmp[2] - v_tmp[3]) & 3;
+
656  c[768+i] = ( -k + 2*v_tmp[3]) & 3;
+
657  }
+
658 
+
659  clean(&chacha, sizeof(chacha));
+
660 }
+
661 
+
662 static void rec(unsigned char *key, const uint16_t *v, const uint16_t *c)
+
663 {
+
664  int i;
+
665  int32_t tmp[4];
+
666 
+
667  for(i=0;i<32;i++)
+
668  key[i] = 0;
+
669 
+
670  for(i=0; i<256; i++)
+
671  {
+
672  tmp[0] = 16*PARAM_Q + 8*(int32_t)v[ 0+i] - PARAM_Q * (2*(int32_t)c[ 0+i]+c[768+i]);
+
673  tmp[1] = 16*PARAM_Q + 8*(int32_t)v[256+i] - PARAM_Q * (2*(int32_t)c[256+i]+c[768+i]);
+
674  tmp[2] = 16*PARAM_Q + 8*(int32_t)v[512+i] - PARAM_Q * (2*(int32_t)c[512+i]+c[768+i]);
+
675  tmp[3] = 16*PARAM_Q + 8*(int32_t)v[768+i] - PARAM_Q * ( c[768+i]);
+
676 
+
677  key[i>>3] |= LDDecode(tmp[0], tmp[1], tmp[2], tmp[3]) << (i & 7);
+
678  }
+
679 }
+
680 
+
681 static void poly_frombytes(uint16_t *r, const unsigned char *a)
+
682 {
+
683  int i;
+
684  for(i=0;i<PARAM_N/4;i++)
+
685  {
+
686  r[4*i+0] = a[7*i+0] | (((uint16_t)a[7*i+1] & 0x3f) << 8);
+
687  r[4*i+1] = (a[7*i+1] >> 6) | (((uint16_t)a[7*i+2]) << 2) | (((uint16_t)a[7*i+3] & 0x0f) << 10);
+
688  r[4*i+2] = (a[7*i+3] >> 4) | (((uint16_t)a[7*i+4]) << 4) | (((uint16_t)a[7*i+5] & 0x03) << 12);
+
689  r[4*i+3] = (a[7*i+5] >> 2) | (((uint16_t)a[7*i+6]) << 6);
+
690  }
+
691 }
692 
-
693  m = t3 - PARAM_Q;
-
694  c = m;
-
695  c >>= 15;
-
696  t3 = m ^ ((t3^m)&c); // <Make sure that coefficients are in [0,q]
-
697 
-
698  r[7*i+0] = t0 & 0xff;
-
699  r[7*i+1] = (t0 >> 8) | (t1 << 6);
-
700  r[7*i+2] = (t1 >> 2);
-
701  r[7*i+3] = (t1 >> 10) | (t2 << 4);
-
702  r[7*i+4] = (t2 >> 4);
-
703  r[7*i+5] = (t2 >> 12) | (t3 << 2);
-
704  r[7*i+6] = (t3 >> 6);
-
705  }
-
706 }
-
707 
-
708 static void poly_pointwise(uint16_t *r, const uint16_t *a, const uint16_t *b)
-
709 {
-
710  int i;
-
711  uint16_t t;
-
712  for(i=0;i<PARAM_N;i++)
-
713  {
-
714  t = montgomery_reduce(3186*b[i]); /* t is now in Montgomery domain */
-
715  r[i] = montgomery_reduce(a[i] * t); /* r->coeffs[i] is back in normal domain */
-
716  }
-
717 }
-
718 
-
719 static void poly_add(uint16_t *r, const uint16_t *a, const uint16_t *b)
-
720 {
-
721  int i;
-
722  for(i=0;i<PARAM_N;i++)
-
723  r[i] = barrett_reduce(a[i] + b[i]);
-
724 }
-
725 
-
726 static void poly_ntt(uint16_t *r)
-
727 {
-
728  mul_coefficients(r, psis_bitrev_montgomery);
-
729  ntt(r, omegas_montgomery);
-
730 }
-
731 
-
732 static void poly_invntt(uint16_t *r)
-
733 {
-
734  bitrev_vector(r);
-
735  ntt(r, omegas_inv_montgomery);
-
736  mul_coefficients(r, psis_inv_montgomery);
-
737 }
-
738 
-
739 static void encode_a(unsigned char *r, const uint16_t *pk, const unsigned char *seed)
-
740 {
-
741  int i;
-
742  poly_tobytes(r, pk);
-
743  for(i=0;i<NEWHOPE_SEEDBYTES;i++)
-
744  r[POLY_BYTES+i] = seed[i];
-
745 }
-
746 
-
747 static void encode_b(unsigned char *r, const uint16_t *b, const uint16_t *c)
-
748 {
-
749  int i;
-
750  poly_tobytes(r,b);
-
751  for(i=0;i<PARAM_N/4;i++)
-
752  r[POLY_BYTES+i] = c[4*i] | (c[4*i+1] << 2) | (c[4*i+2] << 4) | (c[4*i+3] << 6);
-
753 }
-
754 
-
755 static void decode_b_2nd_half(uint16_t *c, const unsigned char *r)
-
756 {
-
757  int i;
-
758  for(i=0;i<PARAM_N/4;i++)
-
759  {
-
760  c[4*i+0] = r[POLY_BYTES+i] & 0x03;
-
761  c[4*i+1] = (r[POLY_BYTES+i] >> 2) & 0x03;
-
762  c[4*i+2] = (r[POLY_BYTES+i] >> 4) & 0x03;
-
763  c[4*i+3] = (r[POLY_BYTES+i] >> 6);
-
764  }
-
765 }
-
766 
-
767 #if NEWHOPE_TORREF
-
768 
-
769 #define _5q (5*PARAM_Q)
-
770 
-
771 #define compare_and_swap(x,i,j) \
-
772  c = _5q - 1 - x[16*(i)];\
-
773  c >>= 31;\
-
774  t = x[16*(i)] ^ x[16*(j)];\
-
775  t &= c;\
-
776  x[16*(i)] ^= t;\
-
777  x[16*(j)] ^= t;
-
778 
-
779 // Code size efficient (but slower) version of the Batcher sort.
-
780 // https://en.wikipedia.org/wiki/Batcher_odd%E2%80%93even_mergesort
-
781 static void oddeven_merge(uint16_t *x, unsigned lo, unsigned hi, unsigned r)
-
782 {
-
783  unsigned step = r * 2;
-
784  unsigned i;
-
785  int32_t c;
-
786  uint16_t t;
-
787  if (lo >= 84)
-
788  return;
-
789  if (step < (hi - lo)) {
-
790  if ((step * 2) >= (hi - lo) && hi < 84) {
-
791  // The next recursion down is a leaf, so unroll a little.
-
792  compare_and_swap(x, lo, lo + step);
-
793  compare_and_swap(x, lo + r, lo + r + step);
-
794  compare_and_swap(x, lo + r, lo + step);
-
795  return;
-
796  }
-
797  oddeven_merge(x, lo, hi, step);
-
798  oddeven_merge(x, lo + r, hi, step);
-
799  for (i = lo + r; i < (hi - r) && (i + r) < 84; i += step) {
-
800  compare_and_swap(x, i, i + r);
-
801  }
-
802  } else if ((lo + r) < 84) {
-
803  compare_and_swap(x, lo, lo + r);
-
804  }
-
805 }
-
806 static void oddeven_merge_sort_range(uint16_t *x, unsigned lo, unsigned hi)
-
807 {
-
808  if (lo == hi || lo >= 84)
-
809  return;
-
810  unsigned mid = lo + ((hi - lo) / 2);
-
811  if ((hi - lo) == 3 && hi < 84) {
-
812  // Optimization for sub lists of size 4. Unroll the comparisons.
-
813  int32_t c;
-
814  uint16_t t;
-
815  compare_and_swap(x, lo , lo + 1);
-
816  compare_and_swap(x, lo + 2, lo + 3);
-
817  compare_and_swap(x, lo , lo + 2);
-
818  compare_and_swap(x, lo + 1, lo + 3);
-
819  compare_and_swap(x, lo + 1, lo + 2);
-
820  return;
-
821  }
-
822  oddeven_merge_sort_range(x, lo, mid);
-
823  oddeven_merge_sort_range(x, mid + 1, hi);
-
824  oddeven_merge(x, lo, hi, 1);
-
825 }
-
826 static void batcher84(uint16_t *x)
-
827 {
-
828  // Batcher sort is defined over a power of two list size but 84
-
829  // is not a power of two. Round up to the next power of two and
-
830  // then ignore any swap with an index that is out of range.
-
831  oddeven_merge_sort_range(x, 0, 127);
-
832 }
-
833 
-
834 static int discardtopoly(uint16_t *x)
-
835 {
-
836  int32_t i, r=0;
-
837 
-
838  for(i=0;i<16;i++)
-
839  batcher84(x+i);
-
840 
-
841  // Check whether we're safe:
-
842  for(i=1008;i<1024;i++)
-
843  r |= 61444 - x[i];
-
844  if(r >>= 31) return -1;
-
845 
-
846  return 0;
-
847 }
-
848 
-
849 #endif // NEWHOPE_TORREF
-
850 
-
851 // End of public domain code imported from the C reference code.
-
852 
-
853 // Formats the ChaCha20 input block using a key and nonce.
-
854 static void crypto_chacha20_set_key(uint32_t *block, const unsigned char *k, const unsigned char *n)
-
855 {
-
856  static const char tag256[] = "expand 32-byte k";
-
857  memcpy(block, tag256, 16);
-
858  memcpy(block + 4, k, 32);
-
859  memset(block + 12, 0, 8);
-
860  if (n)
-
861  memcpy(block + 14, n, 8);
-
862  else
-
863  memset(block + 14, 0, 8);
-
864 }
-
865 
-
866 static void poly_uniform(uint16_t *a, const unsigned char *seed)
-
867 {
-
868  SHAKE128 shake;
-
869  int ctr = 0;
-
870  int posn = PARAM_N;
-
871  uint16_t val;
-
872 
-
873  // Absorb the seed material into the SHAKE128 object.
-
874  shake.update(seed, NEWHOPE_SEEDBYTES);
-
875 
-
876  while (ctr < PARAM_N) {
-
877  // Extract data from the SHAKE128 object directly into "a".
-
878  if (posn >= PARAM_N) {
-
879  shake.extend((uint8_t *)(a + ctr),
-
880  (PARAM_N - ctr) * sizeof(uint16_t));
-
881  posn = ctr;
-
882  }
-
883 
-
884  // Process as much of the data as we can, discarding values
-
885  // that are greater than or equal to 5 * PARAM_Q.
-
886  while (posn < PARAM_N) {
-
887  val = a[posn++];
-
888  if (val < (5 * PARAM_Q))
-
889  a[ctr++] = val;
-
890  }
-
891  }
-
892 }
-
893 
-
894 #if NEWHOPE_TORREF
-
895 
-
896 // Extended version of NewHopePoly that can hold the complete
-
897 // intermediate state for poly_uniform_torref(). This allows us
-
898 // to generate the polynomial in-place and save 2k of stack space.
-
899 class NewHopePolyExtended
-
900 {
-
901 public:
-
902  ~NewHopePolyExtended() { clean(coeffs); }
-
903 
-
904  uint16_t coeffs[84 * 16];
-
905 };
-
906 
-
907 static void poly_uniform_torref(uint16_t *a, const unsigned char *seed)
-
908 {
-
909  SHAKE128 shake;
-
910  shake.update(seed, 32);
-
911  do {
-
912  shake.extend((uint8_t *)a, 84 * 16 * sizeof(uint16_t));
-
913  } while (discardtopoly(a));
-
914 }
-
915 
-
916 #else // !NEWHOPE_TORREF
-
917 
-
918 typedef NewHopePoly NewHopePolyExtended;
-
919 
-
920 static void poly_uniform_torref(uint16_t *a, const unsigned char *seed)
-
921 {
-
922  poly_uniform(a, seed);
-
923 }
-
924 
-
925 #endif // NEWHOPE_TORREF
-
926 
-
927 static void poly_getnoise(uint16_t *r, unsigned char *seed, unsigned char nonce)
-
928 {
-
929  uint32_t input[16];
-
930  uint32_t buf[16];
-
931  int i, j;
-
932  uint32_t a, b;
-
933 
-
934  // Note: The rest of this function assumes that we are running on a
-
935  // little-endian CPU. Since we're generating random noise from a
-
936  // random seed, it doesn't actually matter what the endian-ness is
-
937  // as it will be just as random in both directions. It's only a
-
938  // problem for verifying fixed test vectors.
-
939 
-
940  crypto_chacha20_set_key(input, seed, 0);
-
941  input[14] = nonce; // Assumes little-endian.
-
942 
-
943  for (i = 0; i < PARAM_N; ++i) {
-
944  // Generate a new block of random data if necessary.
-
945  j = i % 16;
-
946  if (j == 0) {
-
947  ChaCha::hashCore(buf, input, 20);
-
948  ++(input[12]); // Assumes little-endian.
-
949  }
-
950 
-
951  // This is a slightly more efficient way to count bits than in
-
952  // the reference C implementation. The technique is from:
-
953  // https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
-
954  a = buf[j] & 0xFFFF; // Assumes little-endian.
-
955  a = a - ((a >> 1) & 0x5555);
-
956  a = (a & 0x3333) + ((a >> 2) & 0x3333);
-
957  a = ((a >> 4) + a) & 0x0F0F;
-
958  a = ((a >> 8) + a) & 0x00FF;
-
959 
-
960  b = (buf[j] >> 16) & 0xFFFF; // Assumes little-endian.
-
961  b = b - ((b >> 1) & 0x5555);
-
962  b = (b & 0x3333) + ((b >> 2) & 0x3333);
-
963  b = ((b >> 4) + b) & 0x0F0F;
-
964  b = ((b >> 8) + b) & 0x00FF;
-
965 
-
966  r[i] = a + PARAM_Q - b;
-
967  }
-
968 
-
969  clean(input);
-
970  clean(buf);
-
971 }
-
972 
-
973 static void sha3256(unsigned char *output, const unsigned char *input, unsigned int inputByteLen)
-
974 {
-
975  SHA3_256 sha3;
-
976  sha3.update(input, inputByteLen);
-
977  sha3.finalize(output, 32);
-
978 }
-
979 
-
985 NewHopePoly::NewHopePoly()
-
986 {
-
987 }
-
988 
-
992 NewHopePoly::~NewHopePoly()
-
993 {
-
994  clean(coeffs);
-
995 }
-
996 
-
1000 void NewHopePoly::clear()
-
1001 {
-
1002  clean(coeffs);
-
1003 }
-
1004 
-
1039 void NewHope::keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePoly &sk,
-
1040  Variant variant, const uint8_t *random_seed)
-
1041 {
-
1042  NewHopePolyExtended a;
-
1043  NewHopePoly pk;
-
1044  uint8_t seed[NEWHOPE_SEEDBYTES];
-
1045  uint8_t noiseseed[32];
-
1046 
-
1047  if (!random_seed) {
-
1048  RNG.rand(seed, NEWHOPE_SEEDBYTES);
-
1049  RNG.rand(noiseseed, 32);
-
1050  } else {
-
1051  memcpy(seed, random_seed, NEWHOPE_SEEDBYTES);
-
1052  memcpy(noiseseed, random_seed + NEWHOPE_SEEDBYTES, 32);
-
1053  }
-
1054  sha3256(seed, seed, NEWHOPE_SEEDBYTES);
-
1055 
-
1056  // The order of calls is rearranged compared to the reference C version.
-
1057  // This allows us to get away with two temporary poly objects (a, pk)
-
1058  // instead of four (a, e, r, pk). This saves 4k of stack space.
-
1059 
+
693 static void poly_tobytes(unsigned char *r, const uint16_t *p)
+
694 {
+
695  int i;
+
696  uint16_t t0,t1,t2,t3,m;
+
697  int16_t c;
+
698  for(i=0;i<PARAM_N/4;i++)
+
699  {
+
700  t0 = barrett_reduce(p[4*i+0]); //Make sure that coefficients have only 14 bits
+
701  t1 = barrett_reduce(p[4*i+1]);
+
702  t2 = barrett_reduce(p[4*i+2]);
+
703  t3 = barrett_reduce(p[4*i+3]);
+
704 
+
705  m = t0 - PARAM_Q;
+
706  c = m;
+
707  c >>= 15;
+
708  t0 = m ^ ((t0^m)&c); // <Make sure that coefficients are in [0,q]
+
709 
+
710  m = t1 - PARAM_Q;
+
711  c = m;
+
712  c >>= 15;
+
713  t1 = m ^ ((t1^m)&c); // <Make sure that coefficients are in [0,q]
+
714 
+
715  m = t2 - PARAM_Q;
+
716  c = m;
+
717  c >>= 15;
+
718  t2 = m ^ ((t2^m)&c); // <Make sure that coefficients are in [0,q]
+
719 
+
720  m = t3 - PARAM_Q;
+
721  c = m;
+
722  c >>= 15;
+
723  t3 = m ^ ((t3^m)&c); // <Make sure that coefficients are in [0,q]
+
724 
+
725  r[7*i+0] = t0 & 0xff;
+
726  r[7*i+1] = (t0 >> 8) | (t1 << 6);
+
727  r[7*i+2] = (t1 >> 2);
+
728  r[7*i+3] = (t1 >> 10) | (t2 << 4);
+
729  r[7*i+4] = (t2 >> 4);
+
730  r[7*i+5] = (t2 >> 12) | (t3 << 2);
+
731  r[7*i+6] = (t3 >> 6);
+
732  }
+
733 }
+
734 
+
735 static void poly_pointwise(uint16_t *r, const uint16_t *a, const uint16_t *b)
+
736 {
+
737  int i;
+
738  uint16_t t;
+
739  for(i=0;i<PARAM_N;i++)
+
740  {
+
741  t = montgomery_reduce(3186*(uint32_t)b[i]); /* t is now in Montgomery domain */
+
742  r[i] = montgomery_reduce(a[i] * (uint32_t)t); /* r->coeffs[i] is back in normal domain */
+
743  }
+
744 }
+
745 
+
746 static void poly_add(uint16_t *r, const uint16_t *a, const uint16_t *b)
+
747 {
+
748  int i;
+
749  for(i=0;i<PARAM_N;i++)
+
750  r[i] = barrett_reduce(a[i] + (uint32_t)b[i]);
+
751 }
+
752 
+
753 static void poly_ntt(uint16_t *r)
+
754 {
+
755  mul_coefficients(r, psis_bitrev_montgomery);
+
756  ntt(r, omegas_montgomery);
+
757 }
+
758 
+
759 static void poly_invntt(uint16_t *r)
+
760 {
+
761  bitrev_vector(r);
+
762  ntt(r, omegas_inv_montgomery);
+
763  mul_coefficients(r, psis_inv_montgomery);
+
764 }
+
765 
+
766 static void encode_b_2nd_half(unsigned char *r, const uint16_t *c)
+
767 {
+
768  int i;
+
769  for(i=0;i<PARAM_N/4;i++)
+
770  r[POLY_BYTES+i] = c[4*i] | (c[4*i+1] << 2) | (c[4*i+2] << 4) | (c[4*i+3] << 6);
+
771 }
+
772 
+
773 static void decode_b_2nd_half(uint16_t *c, const unsigned char *r)
+
774 {
+
775  int i;
+
776  for(i=0;i<PARAM_N/4;i++)
+
777  {
+
778  c[4*i+0] = r[POLY_BYTES+i] & 0x03;
+
779  c[4*i+1] = (r[POLY_BYTES+i] >> 2) & 0x03;
+
780  c[4*i+2] = (r[POLY_BYTES+i] >> 4) & 0x03;
+
781  c[4*i+3] = (r[POLY_BYTES+i] >> 6);
+
782  }
+
783 }
+
784 
+
785 #define _5q (5*PARAM_Q)
+
786 
+
787 #define compare_and_swap(x,i,j) \
+
788  c = _5q - 1 - x[16*(i)];\
+
789  c >>= 31;\
+
790  t = x[16*(i)] ^ x[16*(j)];\
+
791  t &= c;\
+
792  x[16*(i)] ^= t;\
+
793  x[16*(j)] ^= t;
+
794 
+
795 static void batcher84(uint16_t *x);
+
796 
+
797 static int discardtopoly(uint16_t *x)
+
798 {
+
799  int32_t i, r=0;
+
800 
+
801  for(i=0;i<16;i++)
+
802  batcher84(x+i);
+
803 
+
804  // Check whether we're safe:
+
805  for(i=1008;i<1024;i++)
+
806  r |= 61444 - x[i];
+
807  if(r >>= 31) return -1;
+
808 
+
809  return 0;
+
810 }
+
811 
+
812 // End of public domain code imported from the C reference code.
+
813 
+
814 // Code size efficient (but slower) version of the Batcher sort.
+
815 // https://en.wikipedia.org/wiki/Batcher_odd%E2%80%93even_mergesort
+
816 static void oddeven_merge(uint16_t *x, unsigned lo, unsigned hi, unsigned r)
+
817 {
+
818  unsigned step = r * 2;
+
819  unsigned i;
+
820  int32_t c;
+
821  uint16_t t;
+
822  if (lo >= 84)
+
823  return;
+
824  if (step < (hi - lo)) {
+
825  if ((step * 2) >= (hi - lo) && hi < 84) {
+
826  // The next recursion down is a leaf, so unroll a little.
+
827  compare_and_swap(x, lo, lo + step);
+
828  compare_and_swap(x, lo + r, lo + r + step);
+
829  compare_and_swap(x, lo + r, lo + step);
+
830  return;
+
831  }
+
832  oddeven_merge(x, lo, hi, step);
+
833  oddeven_merge(x, lo + r, hi, step);
+
834  for (i = lo + r; i < (hi - r) && (i + r) < 84; i += step) {
+
835  compare_and_swap(x, i, i + r);
+
836  }
+
837  } else if ((lo + r) < 84) {
+
838  compare_and_swap(x, lo, lo + r);
+
839  }
+
840 }
+
841 static void oddeven_merge_sort_range(uint16_t *x, unsigned lo, unsigned hi)
+
842 {
+
843  if (lo == hi || lo >= 84)
+
844  return;
+
845  unsigned mid = lo + ((hi - lo) / 2);
+
846  if ((hi - lo) == 3 && hi < 84) {
+
847  // Optimization for sub lists of size 4. Unroll the comparisons.
+
848  int32_t c;
+
849  uint16_t t;
+
850  compare_and_swap(x, lo , lo + 1);
+
851  compare_and_swap(x, lo + 2, lo + 3);
+
852  compare_and_swap(x, lo , lo + 2);
+
853  compare_and_swap(x, lo + 1, lo + 3);
+
854  compare_and_swap(x, lo + 1, lo + 2);
+
855  return;
+
856  }
+
857  oddeven_merge_sort_range(x, lo, mid);
+
858  oddeven_merge_sort_range(x, mid + 1, hi);
+
859  oddeven_merge(x, lo, hi, 1);
+
860 }
+
861 static void batcher84(uint16_t *x)
+
862 {
+
863  // Batcher sort is defined over a power of two list size but 84
+
864  // is not a power of two. Round up to the next power of two and
+
865  // then ignore any swap with an index that is out of range.
+
866  oddeven_merge_sort_range(x, 0, 127);
+
867 }
+
868 
+
869 // Formats the ChaCha20 input block using a key.
+
870 static void crypto_chacha20_set_key(uint32_t *block, const unsigned char *k)
+
871 {
+
872  static const char tag256[] PROGMEM = "expand 32-byte k";
+
873 #if defined(__AVR__)
+
874  memcpy_P(block, tag256, 16);
+
875 #else
+
876  memcpy(block, tag256, 16);
+
877 #endif
+
878  memcpy(block + 4, k, 32);
+
879  memset(block + 12, 0, 8);
+
880 }
+
881 
+
882 static void poly_uniform(SHAKE128 *shake, uint16_t *a, const unsigned char *seed)
+
883 {
+
884  int ctr = 0;
+
885  int posn = PARAM_N;
+
886  uint16_t val;
+
887 
+
888  // Absorb the seed material into the SHAKE128 object.
+
889  shake->update(seed, NEWHOPE_SEEDBYTES);
+
890 
+
891  while (ctr < PARAM_N) {
+
892  // Extract data from the SHAKE128 object directly into "a".
+
893  if (posn >= PARAM_N) {
+
894  shake->extend((uint8_t *)(a + ctr),
+
895  (PARAM_N - ctr) * sizeof(uint16_t));
+
896  posn = ctr;
+
897  }
+
898 
+
899  // Process as much of the data as we can, discarding values
+
900  // that are greater than or equal to 5 * PARAM_Q.
+
901  while (posn < PARAM_N) {
+
902  val = a[posn++];
+
903  if (val < (5 * PARAM_Q))
+
904  a[ctr++] = val;
+
905  }
+
906  }
+
907 }
+
908 
+
909 static void poly_uniform_torref(SHAKE128 *shake, uint16_t *a, const unsigned char *seed)
+
910 {
+
911  shake->update(seed, 32);
+
912  do {
+
913  shake->extend((uint8_t *)a, 84 * 16 * sizeof(uint16_t));
+
914  } while (discardtopoly(a));
+
915 }
+
916 
+
917 static void poly_getnoise(uint16_t *r, NewHopeChaChaState *chacha, unsigned char nonce)
+
918 {
+
919  int i, j;
+
920  uint32_t a, b;
+
921 
+
922  // Note: The rest of this function assumes that we are running on a
+
923  // little-endian CPU. Since we're generating random noise from a
+
924  // random seed, it doesn't actually matter what the endian-ness is
+
925  // as it will be just as random in both directions. It's only a
+
926  // problem for verifying fixed test vectors.
+
927 
+
928  chacha->input[12] = 0;
+
929  chacha->input[13] = 0;
+
930  chacha->input[14] = nonce; // Assumes little-endian.
+
931  chacha->input[15] = 0;
+
932 
+
933  for (i = 0; i < PARAM_N; ++i) {
+
934  // Generate a new block of random data if necessary.
+
935  j = i % 16;
+
936  if (j == 0) {
+
937  ChaCha::hashCore(chacha->output, chacha->input, 20);
+
938  ++(chacha->input[12]); // Assumes little-endian.
+
939  }
+
940 
+
941  // This is a slightly more efficient way to count bits than in
+
942  // the reference C implementation. The technique is from:
+
943  // https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
+
944  a = chacha->output[j] & 0xFFFF; // Assumes little-endian.
+
945  a = a - ((a >> 1) & 0x5555);
+
946  a = (a & 0x3333) + ((a >> 2) & 0x3333);
+
947  a = ((a >> 4) + a) & 0x0F0F;
+
948  a = ((a >> 8) + a) & 0x00FF;
+
949 
+
950  b = (chacha->output[j] >> 16) & 0xFFFF; // Assumes little-endian.
+
951  b = b - ((b >> 1) & 0x5555);
+
952  b = (b & 0x3333) + ((b >> 2) & 0x3333);
+
953  b = ((b >> 4) + b) & 0x0F0F;
+
954  b = ((b >> 8) + b) & 0x00FF;
+
955 
+
956  r[i] = a + PARAM_Q - b;
+
957  }
+
958 
+
959  clean(&chacha, sizeof(chacha));
+
960 }
+
961 
+
984 #define ALLOC_OBJ(type, name) \
+
985  uint64_t name##_x[(sizeof(type) + sizeof(uint64_t) - 1) / sizeof(uint64_t)]
+
986 
+
987 #define INIT_OBJ(type, name) \
+
988  type *name = new (state.name##_x) type
+
989 
+
990 #if defined(__AVR__)
+
991 #define NEWHOPE_BYTE_ALIGNED 1
+
992 #else
+
993 #define NEWHOPE_BYTE_ALIGNED 0
+
994 #endif
+
995 
+
1014 void NewHope::keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePrivateKey &sk,
+
1015  Variant variant, const uint8_t *random_seed)
+
1016 {
+
1017  // The order of calls is rearranged compared to the reference C version.
+
1018  // This allows us to get away with two temporary poly objects (a, pk)
+
1019  // instead of four (a, e, r, pk). This saves 4k of stack space.
+
1020  //
+
1021  // We also combine most of the state into a single union, which allows
+
1022  // us to overlap some of the larger objects and reuse the stack space
+
1023  // at different points within this function.
+
1024  union {
+
1025  struct {
+
1026  uint16_t a[PARAM_N]; // Value of "a" as a "poly" object.
+
1027  uint16_t pk[PARAM_N]; // Value of "pk" as a "poly" object.
+
1028  };
+
1029  struct {
+
1030  uint16_t a_ext[84 * 16]; // Value of "a" for torref uniform.
+
1031  ALLOC_OBJ(SHAKE128, shake); // SHAKE128 object for poly_uniform().
+
1032  };
+
1033  ALLOC_OBJ(SHA3_256, sha3); // SHA3 object for hashing the seed.
+
1034  } state;
+
1035 
+
1036  // Hide the ChaCha state and the noise seed inside "send".
+
1037 #if NEWHOPE_BYTE_ALIGNED
+
1038  #define chacha (*((NewHopeChaChaState *)send))
+
1039 #else
+
1040  NewHopeChaChaState chacha;
+
1041 #endif
+
1042 #if NEWHOPE_SMALL_FOOTPRINT
+
1043  #define noiseseed (sk.seed)
+
1044 #else
+
1045  #define noiseseed (send + sizeof(NewHopeChaChaState))
+
1046 #endif
+
1047 
+
1048  if (!random_seed) {
+
1049  RNG.rand(send + POLY_BYTES, NEWHOPE_SEEDBYTES);
+
1050  RNG.rand(noiseseed, 32);
+
1051  } else {
+
1052  memcpy(send + POLY_BYTES, random_seed, NEWHOPE_SEEDBYTES);
+
1053  memcpy(noiseseed, random_seed + NEWHOPE_SEEDBYTES, 32);
+
1054  }
+
1055  INIT_OBJ(SHA3_256, sha3);
+
1056  sha3->update(send + POLY_BYTES, NEWHOPE_SEEDBYTES);
+
1057  sha3->finalize(send + POLY_BYTES, NEWHOPE_SEEDBYTES);
+
1058 
+
1059  INIT_OBJ(SHAKE128, shake);
1060  if (variant == Ref)
-
1061  poly_uniform(a.coeffs, seed);
+
1061  poly_uniform(shake, state.a, send + POLY_BYTES);
1062  else
-
1063  poly_uniform_torref(a.coeffs, seed);
+
1063  poly_uniform_torref(shake, state.a_ext, send + POLY_BYTES);
1064 
-
1065  poly_getnoise(sk.coeffs, noiseseed, 0);
-
1066  poly_ntt(sk.coeffs);
-
1067 
-
1068  poly_pointwise(pk.coeffs, sk.coeffs, a.coeffs);
-
1069 
-
1070  poly_getnoise(a.coeffs, noiseseed, 1);
-
1071  poly_ntt(a.coeffs);
-
1072 
-
1073  poly_add(pk.coeffs, a.coeffs, pk.coeffs);
-
1074 
-
1075  encode_a(send, pk.coeffs, seed);
-
1076 
-
1077  clean(seed);
-
1078  clean(noiseseed);
-
1079 }
-
1080 
-
1098 void NewHope::sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES],
-
1099  uint8_t send[NEWHOPE_SENDBBYTES],
-
1100  uint8_t received[NEWHOPE_SENDABYTES],
-
1101  Variant variant, const uint8_t *random_seed)
-
1102 {
-
1103  NewHopePolyExtended a;
-
1104  NewHopePoly v, bp;
-
1105  unsigned char noiseseed[32];
-
1106 
-
1107  if (!random_seed)
-
1108  RNG.rand(noiseseed, 32);
-
1109  else
-
1110  memcpy(noiseseed, random_seed, 32);
-
1111 
-
1112  // The order of calls is rearranged compared to the reference C version.
-
1113  // This allows us to get away with 3 temporary poly objects (v, a, bp)
-
1114  // instead of 8 (sp, ep, v, a, pka, c, epp, bp). Saves 10k of stack space.
-
1115 
-
1116  if (variant == Ref)
-
1117  poly_uniform(a.coeffs, received + POLY_BYTES);
-
1118  else
-
1119  poly_uniform_torref(a.coeffs, received + POLY_BYTES);
-
1120 
-
1121  poly_getnoise(v.coeffs, noiseseed, 0);
-
1122  poly_ntt(v.coeffs);
-
1123 
-
1124  poly_pointwise(bp.coeffs, a.coeffs, v.coeffs);
-
1125 
-
1126  poly_getnoise(a.coeffs, noiseseed, 1);
-
1127  poly_ntt(a.coeffs);
-
1128 
-
1129  poly_add(bp.coeffs, bp.coeffs, a.coeffs);
-
1130 
-
1131  poly_frombytes(a.coeffs, received);
-
1132 
-
1133  poly_pointwise(v.coeffs, a.coeffs, v.coeffs);
-
1134  poly_invntt(v.coeffs);
-
1135 
-
1136  poly_getnoise(a.coeffs, noiseseed, 2);
-
1137  poly_add(v.coeffs, v.coeffs, a.coeffs);
-
1138 
-
1139  helprec(a.coeffs, v.coeffs, noiseseed, 3);
-
1140 
-
1141  encode_b(send, bp.coeffs, a.coeffs);
-
1142 
-
1143  rec(shared_key, v.coeffs, a.coeffs);
-
1144 
-
1145  sha3256(shared_key, shared_key, 32);
-
1146 
-
1147  clean(noiseseed);
-
1148 }
-
1149 
-
1159 void NewHope::shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES],
-
1160  const NewHopePoly &sk,
-
1161  uint8_t received[NEWHOPE_SENDBBYTES])
-
1162 {
-
1163  NewHopePoly v, bp;
+
1065  crypto_chacha20_set_key(chacha.input, noiseseed);
+
1066 
+
1067 #if NEWHOPE_SMALL_FOOTPRINT
+
1068  poly_getnoise(state.pk, &chacha, 0);
+
1069  poly_ntt(state.pk);
+
1070  poly_pointwise(state.pk, state.pk, state.a);
+
1071 #else
+
1072  poly_getnoise(sk.coeffs, &chacha, 0);
+
1073  poly_ntt(sk.coeffs);
+
1074  poly_pointwise(state.pk, sk.coeffs, state.a);
+
1075 #endif
+
1076 
+
1077  poly_getnoise(state.a, &chacha, 1);
+
1078  poly_ntt(state.a);
+
1079 
+
1080  poly_add(state.pk, state.a, state.pk);
+
1081 
+
1082  poly_tobytes(send, state.pk);
+
1083 
+
1084  clean(&state, sizeof(state));
+
1085 #if !NEWHOPE_BYTE_ALIGNED
+
1086  clean(&chacha, sizeof(chacha));
+
1087 #endif
+
1088  #undef noiseseed
+
1089  #undef chacha
+
1090 }
+
1091 
+
1116 void NewHope::sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES],
+
1117  uint8_t send[NEWHOPE_SENDBBYTES],
+
1118  uint8_t received[NEWHOPE_SENDABYTES],
+
1119  Variant variant, const uint8_t *random_seed)
+
1120 {
+
1121 #if NEWHOPE_SMALL_FOOTPRINT && NEWHOPE_BYTE_ALIGNED
+
1122  // The order of calls is rearranged compared to the reference C version.
+
1123  // This allows us to get away with 2 temporary poly objects (v, a)
+
1124  // instead of 8 (sp, ep, v, a, pka, c, epp, bp). Saves 12k of stack space.
+
1125  // To achieve this, we reuse "send" as the third temporary poly object bp.
+
1126  //
+
1127  // We also combine most of the state into a single union, which allows
+
1128  // us to overlap some of the larger objects and reuse the stack space
+
1129  // at different points within this function.
+
1130  union {
+
1131  struct {
+
1132  uint16_t a[PARAM_N]; // Value of "a" as a "poly" object.
+
1133  uint16_t v[PARAM_N]; // Value of "v" as a "poly" object.
+
1134  };
+
1135  struct {
+
1136  uint16_t a_ext[84 * 16]; // Value of "a" for torref uniform.
+
1137  ALLOC_OBJ(SHAKE128, shake); // SHAKE128 object for poly_uniform().
+
1138  };
+
1139  ALLOC_OBJ(SHA3_256, sha3); // SHA3 object for hashing the result.
+
1140  } state;
+
1141  uint8_t seed[32];
+
1142  NewHopeChaChaState chacha;
+
1143  #define bp ((uint16_t *)send)
+
1144 
+
1145  if (!random_seed) {
+
1146  RNG.rand(seed, 32);
+
1147  crypto_chacha20_set_key(chacha.input, seed);
+
1148  } else {
+
1149  crypto_chacha20_set_key(chacha.input, random_seed);
+
1150  }
+
1151 
+
1152  poly_frombytes(state.a, received);
+
1153  memcpy(seed, received + POLY_BYTES, 32);
+
1154 
+
1155  poly_getnoise(bp, &chacha, 0);
+
1156  poly_ntt(bp);
+
1157 
+
1158  poly_pointwise(state.v, state.a, bp);
+
1159  poly_invntt(state.v);
+
1160 
+
1161  poly_getnoise(bp, &chacha, 2);
+
1162 
+
1163  poly_add(state.v, state.v, bp);
1164 
-
1165  // The order of calls is rearranged compared to the reference C version.
-
1166  // This allows us to get away with two temporary poly objects (v, bp)
-
1167  // instead of three (v, bp, c). This saves 2k of stack space.
-
1168 
-
1169  poly_frombytes(bp.coeffs, received);
+
1165  helprec(&chacha, state.a, state.v, 3);
+
1166 
+
1167  encode_b_2nd_half(send, state.a);
+
1168 
+
1169  rec(shared_key, state.v, state.a);
1170 
-
1171  poly_pointwise(v.coeffs, sk.coeffs, bp.coeffs);
-
1172  poly_invntt(v.coeffs);
-
1173 
-
1174  decode_b_2nd_half(bp.coeffs, received);
-
1175 
-
1176  rec(shared_key, v.coeffs, bp.coeffs);
-
1177 
-
1178  sha3256(shared_key, shared_key, 32);
-
1179 }
-
NewHopePoly::~NewHopePoly
~NewHopePoly()
Clears sensitive data and destroys this "poly" object.
Definition: NewHope.cpp:992
+
1171  INIT_OBJ(SHA3_256, sha3);
+
1172  sha3->update(shared_key, 32);
+
1173  sha3->finalize(shared_key, 32);
+
1174 
+
1175  INIT_OBJ(SHAKE128, shake);
+
1176  if (variant == Ref)
+
1177  poly_uniform(shake, state.a, seed);
+
1178  else
+
1179  poly_uniform_torref(shake, state.a_ext, seed);
+
1180 
+
1181  poly_getnoise(state.v, &chacha, 0);
+
1182  poly_ntt(state.v);
+
1183 
+
1184  poly_pointwise(state.a, state.a, state.v);
+
1185 
+
1186  poly_getnoise(state.v, &chacha, 1);
+
1187  poly_ntt(state.v);
+
1188 
+
1189  poly_add(state.a, state.a, state.v);
+
1190 
+
1191  poly_tobytes(send, state.a);
+
1192 
+
1193  clean(&state, sizeof(state));
+
1194  clean(&chacha, sizeof(chacha));
+
1195  clean(seed, sizeof(seed));
+
1196  #undef bp
+
1197 #else
+
1198  // The order of calls is rearranged compared to the reference C version.
+
1199  // This allows us to get away with 3 temporary poly objects (v, a, bp)
+
1200  // instead of 8 (sp, ep, v, a, pka, c, epp, bp). Saves 10k of stack space.
+
1201  //
+
1202  // We also combine most of the state into a single union, which allows
+
1203  // us to overlap some of the larger objects and reuse the stack space
+
1204  // at different points within this function.
+
1205  union {
+
1206  struct {
+
1207  uint16_t a[PARAM_N]; // Value of "a" as a "poly" object.
+
1208  uint16_t v[PARAM_N]; // Value of "v" as a "poly" object.
+
1209  uint16_t bp[PARAM_N]; // Value of "bp" as a "poly" object.
+
1210  };
+
1211  struct {
+
1212  uint16_t a_ext[84 * 16]; // Value of "a" for torref uniform.
+
1213  ALLOC_OBJ(SHAKE128, shake); // SHAKE128 object for poly_uniform().
+
1214  };
+
1215  ALLOC_OBJ(SHA3_256, sha3); // SHA3 object for hashing the result.
+
1216  } state;
+
1217 
+
1218  // Hide the ChaCha state and the noise seed inside "send".
+
1219  // Put them at the end of the "send" buffer in case "received"
+
1220  // overlaps with the start of "send".
+
1221 #if NEWHOPE_BYTE_ALIGNED
+
1222  #define chacha (*((NewHopeChaChaState *)(send + NEWHOPE_SENDABYTES)))
+
1223 #else
+
1224  NewHopeChaChaState chacha;
+
1225 #endif
+
1226  #define noiseseed (send + NEWHOPE_SENDABYTES + sizeof(NewHopeChaChaState))
+
1227 
+
1228  if (!random_seed)
+
1229  RNG.rand(noiseseed, 32);
+
1230  else
+
1231  memcpy(noiseseed, random_seed, 32);
+
1232 
+
1233  INIT_OBJ(SHAKE128, shake);
+
1234  if (variant == Ref)
+
1235  poly_uniform(shake, state.a, received + POLY_BYTES);
+
1236  else
+
1237  poly_uniform_torref(shake, state.a_ext, received + POLY_BYTES);
+
1238 
+
1239  crypto_chacha20_set_key(chacha.input, noiseseed);
+
1240 
+
1241  poly_getnoise(state.v, &chacha, 0);
+
1242  poly_ntt(state.v);
+
1243 
+
1244  poly_pointwise(state.bp, state.a, state.v);
+
1245 
+
1246  poly_getnoise(state.a, &chacha, 1);
+
1247  poly_ntt(state.a);
+
1248 
+
1249  poly_add(state.bp, state.bp, state.a);
+
1250 
+
1251  poly_frombytes(state.a, received);
+
1252 
+
1253  poly_pointwise(state.v, state.a, state.v);
+
1254  poly_invntt(state.v);
+
1255 
+
1256  poly_getnoise(state.a, &chacha, 2);
+
1257  poly_add(state.v, state.v, state.a);
+
1258 
+
1259  helprec(&chacha, state.a, state.v, 3);
+
1260 
+
1261  poly_tobytes(send, state.bp);
+
1262  encode_b_2nd_half(send, state.a);
+
1263 
+
1264  rec(shared_key, state.v, state.a);
+
1265 
+
1266  INIT_OBJ(SHA3_256, sha3);
+
1267  sha3->update(shared_key, 32);
+
1268  sha3->finalize(shared_key, 32);
+
1269 
+
1270  clean(&state, sizeof(state));
+
1271 #if !NEWHOPE_BYTE_ALIGNED
+
1272  clean(&chacha, sizeof(chacha));
+
1273 #endif
+
1274 #undef noiseseed
+
1275 #undef chacha
+
1276 #endif
+
1277 }
+
1278 
+
1288 void NewHope::shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES],
+
1289  const NewHopePrivateKey &sk,
+
1290  uint8_t received[NEWHOPE_SENDBBYTES])
+
1291 {
+
1292  // The order of calls is rearranged compared to the reference C version.
+
1293  // This allows us to get away with two temporary poly objects (v, bp)
+
1294  // instead of three (v, bp, c). This saves 2k of stack space.
+
1295  //
+
1296  // We also combine most of the state into a single union, which allows
+
1297  // us to overlap some of the larger objects and reuse the stack space
+
1298  // at different points within this function.
+
1299  union {
+
1300  struct {
+
1301  uint16_t v[PARAM_N]; // Value of "v" as a "poly" object.
+
1302  uint16_t bp[PARAM_N]; // Value of "bp" as a "poly" object.
+
1303  };
+
1304  struct {
+
1305  uint16_t v_alt[PARAM_N];
+
1306  ALLOC_OBJ(NewHopeChaChaState, chacha);
+
1307  };
+
1308  ALLOC_OBJ(SHA3_256, sha3); // SHA3 object for hashing the result.
+
1309  } state;
+
1310 
+
1311 #if NEWHOPE_SMALL_FOOTPRINT
+
1312  // Re-create the full private key for Alice from the seed.
+
1313  INIT_OBJ(NewHopeChaChaState, chacha);
+
1314  crypto_chacha20_set_key(chacha->input, sk.seed);
+
1315  poly_getnoise(state.v, chacha, 0);
+
1316  poly_ntt(state.v);
+
1317  poly_frombytes(state.bp, received);
+
1318  poly_pointwise(state.v, state.v, state.bp);
+
1319  poly_invntt(state.v);
+
1320 #else
+
1321  // Alice's full private key was supplied.
+
1322  poly_frombytes(state.bp, received);
+
1323  poly_pointwise(state.v, sk.coeffs, state.bp);
+
1324  poly_invntt(state.v);
+
1325 #endif
+
1326 
+
1327  decode_b_2nd_half(state.bp, received);
+
1328 
+
1329  rec(shared_key, state.v, state.bp);
+
1330 
+
1331  INIT_OBJ(SHA3_256, sha3);
+
1332  sha3->update(shared_key, 32);
+
1333  sha3->finalize(shared_key, 32);
+
1334 
+
1335  clean(&state, sizeof(state));
+
1336 }
RNGClass::rand
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:508
-
NewHope::Variant
Variant
Describes the variant of the New Hope algorithm to implement.
Definition: NewHope.h:55
+
NewHope::Variant
Variant
Describes the variant of the New Hope algorithm to implement.
Definition: NewHope.h:57
SHAKE128
SHAKE Extendable-Output Function (XOF) with 128-bit security.
Definition: SHAKE.h:52
-
NewHope::keygen
static void keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePoly &sk, Variant variant=Ref, const uint8_t *random_seed=0)
Generates the key pair for Alice in a New Hope key exchange.
Definition: NewHope.cpp:1039
-
NewHopePoly::clear
void clear()
Clears sensitive data in this "poly" object.
Definition: NewHope.cpp:1000
-
NewHope::sharedb
static void sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES], uint8_t send[NEWHOPE_SENDBBYTES], uint8_t received[NEWHOPE_SENDABYTES], Variant variant=Ref, const uint8_t *random_seed=0)
Generates the public key and shared secret for Bob.
Definition: NewHope.cpp:1098
-
SHA3_256::finalize
void finalize(void *hash, size_t len)
Finalizes the hashing process and returns the hash.
Definition: SHA3.cpp:71
-
NewHopePoly::NewHopePoly
NewHopePoly()
Constructs a new "poly" object for the NewHope algorithm.
Definition: NewHope.cpp:985
-
NewHopePoly
NewHope polynomial representation.
Definition: NewHope.h:34
+
NewHope::keygen
static void keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePrivateKey &sk, Variant variant=Ref, const uint8_t *random_seed=0)
Generates the key pair for Alice in a New Hope key exchange.
Definition: NewHope.cpp:1014
+
NewHope::shareda
static void shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES], const NewHopePrivateKey &sk, uint8_t received[NEWHOPE_SENDBBYTES])
Generates the shared secret for Alice.
Definition: NewHope.cpp:1288
+
NewHopePrivateKey
NewHope private key representation.
Definition: NewHope.h:38
+
NewHope::sharedb
static void sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES], uint8_t send[NEWHOPE_SENDBBYTES], uint8_t received[NEWHOPE_SENDABYTES], Variant variant=Ref, const uint8_t *random_seed=0)
Generates the public key and shared secret for Bob.
Definition: NewHope.cpp:1116
SHAKE::update
void update(const void *data, size_t len)
Updates the XOF with more data.
Definition: SHAKE.cpp:64
-
NewHope::shareda
static void shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES], const NewHopePoly &sk, uint8_t received[NEWHOPE_SENDBBYTES])
Generates the shared secret for Alice.
Definition: NewHope.cpp:1159
ChaCha::hashCore
static void hashCore(uint32_t *output, const uint32_t *input, uint8_t rounds)
Executes the ChaCha hash core on an input memory block.
Definition: ChaCha.cpp:253
SHA3_256
SHA3-256 hash algorithm.
Definition: SHA3.h:29
-
NewHope::Ref
The standard "reference" version of the New Hope algorithm.
Definition: NewHope.h:57
+
NewHope::Ref
The standard "reference" version of the New Hope algorithm.
Definition: NewHope.h:59
SHAKE::extend
void extend(uint8_t *data, size_t len)
Generates extendable output from this XOF.
Definition: SHAKE.cpp:71
-
SHA3_256::update
void update(const void *data, size_t len)
Updates the hash with more data.
Definition: SHA3.cpp:66
diff --git a/NewHope_8h_source.html b/NewHope_8h_source.html index feacf444..ef800adb 100644 --- a/NewHope_8h_source.html +++ b/NewHope_8h_source.html @@ -119,62 +119,59 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
29 #define NEWHOPE_SENDBBYTES 2048
30 #define NEWHOPE_SHAREDBYTES 32
31 
-
32 class NewHope;
-
33 
-
34 class NewHopePoly
-
35 {
-
36 public:
-
37  NewHopePoly();
-
38  ~NewHopePoly();
-
39 
-
40  void clear();
-
41 
-
42 private:
-
43  uint16_t coeffs[1024];
-
44 
-
45  friend class NewHope;
-
46 };
-
47 
-
48 class NewHope
-
49 {
-
50 private:
-
51  NewHope() {}
-
52  ~NewHope() {}
-
53 
-
54 public:
-
55  enum Variant
-
56  {
-
57  Ref,
-
58  Torref
-
59  };
-
60 
-
61  static void keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePoly &sk,
-
62  Variant variant = Ref, const uint8_t *random_seed = 0);
-
63  static void sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES],
-
64  uint8_t send[NEWHOPE_SENDBBYTES],
-
65  uint8_t received[NEWHOPE_SENDABYTES],
-
66  Variant variant = Ref, const uint8_t *random_seed = 0);
-
67  static void shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES],
-
68  const NewHopePoly &sk,
-
69  uint8_t received[NEWHOPE_SENDBBYTES]);
-
70 };
-
71 
-
72 #endif
-
NewHope::Torref
The alternative "torref" version of the New Hope algorithm.
Definition: NewHope.h:58
-
NewHopePoly::~NewHopePoly
~NewHopePoly()
Clears sensitive data and destroys this "poly" object.
Definition: NewHope.cpp:992
-
NewHope::Variant
Variant
Describes the variant of the New Hope algorithm to implement.
Definition: NewHope.h:55
-
NewHope
NewHope post-quantum key exchange algorithm.
Definition: NewHope.h:48
-
NewHope::keygen
static void keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePoly &sk, Variant variant=Ref, const uint8_t *random_seed=0)
Generates the key pair for Alice in a New Hope key exchange.
Definition: NewHope.cpp:1039
-
NewHopePoly::clear
void clear()
Clears sensitive data in this "poly" object.
Definition: NewHope.cpp:1000
-
NewHope::sharedb
static void sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES], uint8_t send[NEWHOPE_SENDBBYTES], uint8_t received[NEWHOPE_SENDABYTES], Variant variant=Ref, const uint8_t *random_seed=0)
Generates the public key and shared secret for Bob.
Definition: NewHope.cpp:1098
-
NewHopePoly::NewHopePoly
NewHopePoly()
Constructs a new "poly" object for the NewHope algorithm.
Definition: NewHope.cpp:985
-
NewHopePoly
NewHope polynomial representation.
Definition: NewHope.h:34
-
NewHope::shareda
static void shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES], const NewHopePoly &sk, uint8_t received[NEWHOPE_SENDBBYTES])
Generates the shared secret for Alice.
Definition: NewHope.cpp:1159
-
NewHope::Ref
The standard "reference" version of the New Hope algorithm.
Definition: NewHope.h:57
+
32 #if defined(__AVR__)
+
33 #define NEWHOPE_SMALL_FOOTPRINT 1
+
34 #else
+
35 #define NEWHOPE_SMALL_FOOTPRINT 0
+
36 #endif
+
37 
+
38 typedef struct
+
39 {
+
41 #if NEWHOPE_SMALL_FOOTPRINT
+
42  uint8_t seed[32];
+
43 #else
+
44  uint16_t coeffs[1024];
+
45 #endif
+
46 
+
48 } NewHopePrivateKey;
+
49 
+
50 class NewHope
+
51 {
+
52 private:
+
53  NewHope() {}
+
54  ~NewHope() {}
+
55 
+
56 public:
+
57  enum Variant
+
58  {
+
59  Ref,
+
60  Torref
+
61  };
+
62 
+
63  static void keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePrivateKey &sk,
+
64  Variant variant = Ref, const uint8_t *random_seed = 0);
+
65  static void sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES],
+
66  uint8_t send[NEWHOPE_SENDBBYTES],
+
67  uint8_t received[NEWHOPE_SENDABYTES],
+
68  Variant variant = Ref, const uint8_t *random_seed = 0);
+
69  static void shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES],
+
70  const NewHopePrivateKey &sk,
+
71  uint8_t received[NEWHOPE_SENDBBYTES]);
+
72 };
+
73 
+
74 #endif
+
NewHope::Torref
The alternative "torref" version of the New Hope algorithm.
Definition: NewHope.h:60
+
NewHope::Variant
Variant
Describes the variant of the New Hope algorithm to implement.
Definition: NewHope.h:57
+
NewHope
NewHope post-quantum key exchange algorithm.
Definition: NewHope.h:50
+
NewHope::keygen
static void keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePrivateKey &sk, Variant variant=Ref, const uint8_t *random_seed=0)
Generates the key pair for Alice in a New Hope key exchange.
Definition: NewHope.cpp:1014
+
NewHope::shareda
static void shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES], const NewHopePrivateKey &sk, uint8_t received[NEWHOPE_SENDBBYTES])
Generates the shared secret for Alice.
Definition: NewHope.cpp:1288
+
NewHopePrivateKey
NewHope private key representation.
Definition: NewHope.h:38
+
NewHope::sharedb
static void sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES], uint8_t send[NEWHOPE_SENDBBYTES], uint8_t received[NEWHOPE_SENDABYTES], Variant variant=Ref, const uint8_t *random_seed=0)
Generates the public key and shared secret for Bob.
Definition: NewHope.cpp:1116
+
NewHope::Ref
The standard "reference" version of the New Hope algorithm.
Definition: NewHope.h:59
diff --git a/NoiseSource_8cpp_source.html b/NoiseSource_8cpp_source.html index febfa41c..9746d325 100644 --- a/NoiseSource_8cpp_source.html +++ b/NoiseSource_8cpp_source.html @@ -138,7 +138,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/NoiseSource_8h_source.html b/NoiseSource_8h_source.html index 56e24158..0e3b7618 100644 --- a/NoiseSource_8h_source.html +++ b/NoiseSource_8h_source.html @@ -142,7 +142,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/OFB_8cpp_source.html b/OFB_8cpp_source.html index 75374eab..8552bca8 100644 --- a/OFB_8cpp_source.html +++ b/OFB_8cpp_source.html @@ -206,7 +206,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/OFB_8h_source.html b/OFB_8h_source.html index f3544ceb..2cf95bbd 100644 --- a/OFB_8h_source.html +++ b/OFB_8h_source.html @@ -171,7 +171,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/OMAC_8cpp_source.html b/OMAC_8cpp_source.html index 34b016b4..4e40f923 100644 --- a/OMAC_8cpp_source.html +++ b/OMAC_8cpp_source.html @@ -208,7 +208,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/OMAC_8h_source.html b/OMAC_8h_source.html index d0129bac..1ad42c0c 100644 --- a/OMAC_8h_source.html +++ b/OMAC_8h_source.html @@ -152,7 +152,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/P521_8cpp_source.html b/P521_8cpp_source.html index 9a184368..744a2a9a 100644 --- a/P521_8cpp_source.html +++ b/P521_8cpp_source.html @@ -1333,7 +1333,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/P521_8h_source.html b/P521_8h_source.html index ec716dd2..58b8a7e3 100644 --- a/P521_8h_source.html +++ b/P521_8h_source.html @@ -215,7 +215,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Poly1305_8cpp_source.html b/Poly1305_8cpp_source.html index 891faa48..9309443e 100644 --- a/Poly1305_8cpp_source.html +++ b/Poly1305_8cpp_source.html @@ -358,7 +358,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Poly1305_8h_source.html b/Poly1305_8h_source.html index 4786d8a0..ceee0906 100644 --- a/Poly1305_8h_source.html +++ b/Poly1305_8h_source.html @@ -153,7 +153,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/PowerSave_8cpp_source.html b/PowerSave_8cpp_source.html index 64f6257a..3adefbbb 100644 --- a/PowerSave_8cpp_source.html +++ b/PowerSave_8cpp_source.html @@ -155,7 +155,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/PowerSave_8h_source.html b/PowerSave_8h_source.html index 64aac6b9..b94a7a83 100644 --- a/PowerSave_8h_source.html +++ b/PowerSave_8h_source.html @@ -158,7 +158,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/RC5_8h_source.html b/RC5_8h_source.html index c4eb5e1c..f1d78d62 100644 --- a/RC5_8h_source.html +++ b/RC5_8h_source.html @@ -435,7 +435,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/RNG_8cpp_source.html b/RNG_8cpp_source.html index 907086e6..803dcc51 100644 --- a/RNG_8cpp_source.html +++ b/RNG_8cpp_source.html @@ -651,7 +651,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/RNG_8h_source.html b/RNG_8h_source.html index ca67fdc3..631ac31f 100644 --- a/RNG_8h_source.html +++ b/RNG_8h_source.html @@ -177,7 +177,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/RTC_8cpp_source.html b/RTC_8cpp_source.html index b5199c6e..02111500 100644 --- a/RTC_8cpp_source.html +++ b/RTC_8cpp_source.html @@ -380,7 +380,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/RTC_8h_source.html b/RTC_8h_source.html index 99e99b9c..2398d2e2 100644 --- a/RTC_8h_source.html +++ b/RTC_8h_source.html @@ -237,7 +237,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/RingOscillatorNoiseSource_8cpp_source.html b/RingOscillatorNoiseSource_8cpp_source.html index d4817f33..5501d9c3 100644 --- a/RingOscillatorNoiseSource_8cpp_source.html +++ b/RingOscillatorNoiseSource_8cpp_source.html @@ -285,7 +285,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/RingOscillatorNoiseSource_8h_source.html b/RingOscillatorNoiseSource_8h_source.html index fdc98868..815b4f69 100644 --- a/RingOscillatorNoiseSource_8h_source.html +++ b/RingOscillatorNoiseSource_8h_source.html @@ -145,7 +145,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SHA256_8cpp_source.html b/SHA256_8cpp_source.html index 44c5c296..be282a5d 100644 --- a/SHA256_8cpp_source.html +++ b/SHA256_8cpp_source.html @@ -339,7 +339,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SHA256_8h_source.html b/SHA256_8h_source.html index fb5bba5f..d866d2a8 100644 --- a/SHA256_8h_source.html +++ b/SHA256_8h_source.html @@ -160,7 +160,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SHA3_8cpp_source.html b/SHA3_8cpp_source.html index be619982..030351ef 100644 --- a/SHA3_8cpp_source.html +++ b/SHA3_8cpp_source.html @@ -257,7 +257,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SHA3_8h_source.html b/SHA3_8h_source.html index 3e74ecd1..499495c2 100644 --- a/SHA3_8h_source.html +++ b/SHA3_8h_source.html @@ -188,7 +188,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SHA512_8cpp_source.html b/SHA512_8cpp_source.html index 25586ef9..d886205c 100644 --- a/SHA512_8cpp_source.html +++ b/SHA512_8cpp_source.html @@ -355,7 +355,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SHA512_8h_source.html b/SHA512_8h_source.html index c7869233..a72e7bf2 100644 --- a/SHA512_8h_source.html +++ b/SHA512_8h_source.html @@ -166,7 +166,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SHAKE_8cpp_source.html b/SHAKE_8cpp_source.html index 146e7544..97d965a3 100644 --- a/SHAKE_8cpp_source.html +++ b/SHAKE_8cpp_source.html @@ -192,7 +192,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SHAKE_8h_source.html b/SHAKE_8h_source.html index b739ca15..5ab9594b 100644 --- a/SHAKE_8h_source.html +++ b/SHAKE_8h_source.html @@ -174,7 +174,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Shell_8cpp_source.html b/Shell_8cpp_source.html index cbcdba25..8167448a 100644 --- a/Shell_8cpp_source.html +++ b/Shell_8cpp_source.html @@ -848,7 +848,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Shell_8h_source.html b/Shell_8h_source.html index 00c4f46d..348a310a 100644 --- a/Shell_8h_source.html +++ b/Shell_8h_source.html @@ -273,7 +273,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SoftI2C_8cpp_source.html b/SoftI2C_8cpp_source.html index 65e74f8c..a820bbb7 100644 --- a/SoftI2C_8cpp_source.html +++ b/SoftI2C_8cpp_source.html @@ -283,7 +283,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SoftI2C_8h_source.html b/SoftI2C_8h_source.html index 62adb572..23642c8c 100644 --- a/SoftI2C_8h_source.html +++ b/SoftI2C_8h_source.html @@ -157,7 +157,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SpeckSmall_8cpp_source.html b/SpeckSmall_8cpp_source.html index 4e4ad488..e2ccad70 100644 --- a/SpeckSmall_8cpp_source.html +++ b/SpeckSmall_8cpp_source.html @@ -715,7 +715,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SpeckSmall_8h_source.html b/SpeckSmall_8h_source.html index 224a9256..e55d2818 100644 --- a/SpeckSmall_8h_source.html +++ b/SpeckSmall_8h_source.html @@ -141,7 +141,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SpeckTiny_8cpp_source.html b/SpeckTiny_8cpp_source.html index fde849fb..d3ae3efd 100644 --- a/SpeckTiny_8cpp_source.html +++ b/SpeckTiny_8cpp_source.html @@ -596,7 +596,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SpeckTiny_8h_source.html b/SpeckTiny_8h_source.html index c100f8d4..8d4ee0e0 100644 --- a/SpeckTiny_8h_source.html +++ b/SpeckTiny_8h_source.html @@ -154,7 +154,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Speck_8cpp_source.html b/Speck_8cpp_source.html index c5c5be05..61973bc5 100644 --- a/Speck_8cpp_source.html +++ b/Speck_8cpp_source.html @@ -679,7 +679,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Speck_8h_source.html b/Speck_8h_source.html index 9a952d11..fba35da6 100644 --- a/Speck_8h_source.html +++ b/Speck_8h_source.html @@ -149,7 +149,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/TelnetDefs_8h_source.html b/TelnetDefs_8h_source.html index b8c4e0f4..6e114718 100644 --- a/TelnetDefs_8h_source.html +++ b/TelnetDefs_8h_source.html @@ -205,7 +205,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Terminal_8cpp_source.html b/Terminal_8cpp_source.html index d2fec8b5..0bd001b6 100644 --- a/Terminal_8cpp_source.html +++ b/Terminal_8cpp_source.html @@ -1037,7 +1037,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Terminal_8h_source.html b/Terminal_8h_source.html index 939416b6..7690bf84 100644 --- a/Terminal_8h_source.html +++ b/Terminal_8h_source.html @@ -299,7 +299,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/TextField_8cpp_source.html b/TextField_8cpp_source.html index 85689cc2..531cc7d2 100644 --- a/TextField_8cpp_source.html +++ b/TextField_8cpp_source.html @@ -156,7 +156,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/TextField_8h_source.html b/TextField_8h_source.html index b3e990e8..e75a3bfd 100644 --- a/TextField_8h_source.html +++ b/TextField_8h_source.html @@ -142,7 +142,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/TimeField_8cpp_source.html b/TimeField_8cpp_source.html index dfa21cc0..b221f19f 100644 --- a/TimeField_8cpp_source.html +++ b/TimeField_8cpp_source.html @@ -325,7 +325,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/TimeField_8h_source.html b/TimeField_8h_source.html index 44fead99..3d3be857 100644 --- a/TimeField_8h_source.html +++ b/TimeField_8h_source.html @@ -167,7 +167,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/TransistorNoiseSource_8cpp_source.html b/TransistorNoiseSource_8cpp_source.html index 07e551e5..d62bd755 100644 --- a/TransistorNoiseSource_8cpp_source.html +++ b/TransistorNoiseSource_8cpp_source.html @@ -295,7 +295,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/TransistorNoiseSource_8h_source.html b/TransistorNoiseSource_8h_source.html index c9fe695a..f7be6a98 100644 --- a/TransistorNoiseSource_8h_source.html +++ b/TransistorNoiseSource_8h_source.html @@ -151,7 +151,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/USBKeysExtra_8h_source.html b/USBKeysExtra_8h_source.html index 0f347a44..70e5827e 100644 --- a/USBKeysExtra_8h_source.html +++ b/USBKeysExtra_8h_source.html @@ -215,7 +215,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/XOF_8cpp_source.html b/XOF_8cpp_source.html index 87b91702..3a12f486 100644 --- a/XOF_8cpp_source.html +++ b/XOF_8cpp_source.html @@ -125,7 +125,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/XOF_8h_source.html b/XOF_8h_source.html index ac310407..7a707575 100644 --- a/XOF_8h_source.html +++ b/XOF_8h_source.html @@ -152,7 +152,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/XTS_8cpp_source.html b/XTS_8cpp_source.html index c78a73a9..bbb7128e 100644 --- a/XTS_8cpp_source.html +++ b/XTS_8cpp_source.html @@ -290,7 +290,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/XTS_8h_source.html b/XTS_8h_source.html index fd0b0b23..ca15d1fd 100644 --- a/XTS_8h_source.html +++ b/XTS_8h_source.html @@ -217,7 +217,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/alarm-clock_8dox.html b/alarm-clock_8dox.html index 8117f875..8a2f0a74 100644 --- a/alarm-clock_8dox.html +++ b/alarm-clock_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/alarm_clock.html b/alarm_clock.html index c6f994c9..7b5bfdd5 100644 --- a/alarm_clock.html +++ b/alarm_clock.html @@ -140,7 +140,7 @@ Completed Clock diff --git a/annotated.html b/annotated.html index 08808e47..ca8057cf 100644 --- a/annotated.html +++ b/annotated.html @@ -137,7 +137,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); oCLoginShellCommand-line shell access via a login shell oCMelodyPlays a melody on a digital output pin using tone() oCNewHopeNewHope post-quantum key exchange algorithm -oCNewHopePolyNewHope polynomial representation +oCNewHopePrivateKeyNewHope private key representation oCNoiseSourceAbstract base class for random noise sources oCOFBImplementation of the Output Feedback (OFB) mode for 128-bit block ciphers oCOFBCommonConcrete base class to assist with implementing OFB for 128-bit block ciphers @@ -177,7 +177,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/blink-blink_8dox.html b/blink-blink_8dox.html index abe41046..1acc2497 100644 --- a/blink-blink_8dox.html +++ b/blink-blink_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/blink-charlieplex_8dox.html b/blink-charlieplex_8dox.html index 08a726ac..a695878e 100644 --- a/blink-charlieplex_8dox.html +++ b/blink-charlieplex_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/blink-cylon_8dox.html b/blink-cylon_8dox.html index c18a2b08..c3420d8f 100644 --- a/blink-cylon_8dox.html +++ b/blink-cylon_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/blink-startrek_8dox.html b/blink-startrek_8dox.html index da3cae6c..5c4b1f85 100644 --- a/blink-startrek_8dox.html +++ b/blink-startrek_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/blink_blink.html b/blink_blink.html index 4a9443d2..aac87850 100644 --- a/blink_blink.html +++ b/blink_blink.html @@ -120,7 +120,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/blink_charlieplex.html b/blink_charlieplex.html index 7a617743..2b686cfe 100644 --- a/blink_charlieplex.html +++ b/blink_charlieplex.html @@ -160,7 +160,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/blink_cylon.html b/blink_cylon.html index cc104b04..eee3d6c7 100644 --- a/blink_cylon.html +++ b/blink_cylon.html @@ -171,7 +171,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/blink_startrek.html b/blink_startrek.html index 2cfe6b44..66a10cc4 100644 --- a/blink_startrek.html +++ b/blink_startrek.html @@ -237,7 +237,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classAES128-members.html b/classAES128-members.html index 522423aa..029936ac 100644 --- a/classAES128-members.html +++ b/classAES128-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classAES128.html b/classAES128.html index 41a50d77..299853b7 100644 --- a/classAES128.html +++ b/classAES128.html @@ -265,7 +265,7 @@ Additional Inherited Members diff --git a/classAES192-members.html b/classAES192-members.html index 24b9e6e0..f8e1b3ed 100644 --- a/classAES192-members.html +++ b/classAES192-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classAES192.html b/classAES192.html index ef1e50bf..d0381142 100644 --- a/classAES192.html +++ b/classAES192.html @@ -265,7 +265,7 @@ Additional Inherited Members diff --git a/classAES256-members.html b/classAES256-members.html index ca8e60a3..7647940e 100644 --- a/classAES256-members.html +++ b/classAES256-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classAES256.html b/classAES256.html index 46ae68bb..65f17ac2 100644 --- a/classAES256.html +++ b/classAES256.html @@ -265,7 +265,7 @@ Additional Inherited Members diff --git a/classAESCommon-members.html b/classAESCommon-members.html index 462269e6..8bf73cd9 100644 --- a/classAESCommon-members.html +++ b/classAESCommon-members.html @@ -103,7 +103,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classAESCommon.html b/classAESCommon.html index e919ad20..9cfee979 100644 --- a/classAESCommon.html +++ b/classAESCommon.html @@ -322,7 +322,7 @@ Protected Member Functions diff --git a/classAuthenticatedCipher-members.html b/classAuthenticatedCipher-members.html index 728c3123..951dbf6e 100644 --- a/classAuthenticatedCipher-members.html +++ b/classAuthenticatedCipher-members.html @@ -108,7 +108,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classAuthenticatedCipher.html b/classAuthenticatedCipher.html index fbd782b4..7739f74c 100644 --- a/classAuthenticatedCipher.html +++ b/classAuthenticatedCipher.html @@ -351,7 +351,7 @@ virtual  diff --git a/classBLAKE2b-members.html b/classBLAKE2b-members.html index c4719fa0..94955396 100644 --- a/classBLAKE2b-members.html +++ b/classBLAKE2b-members.html @@ -113,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classBLAKE2b.html b/classBLAKE2b.html index ec68e535..5b5e6ea0 100644 --- a/classBLAKE2b.html +++ b/classBLAKE2b.html @@ -600,7 +600,7 @@ Additional Inherited Members diff --git a/classBLAKE2s-members.html b/classBLAKE2s-members.html index 1c296767..90a351af 100644 --- a/classBLAKE2s-members.html +++ b/classBLAKE2s-members.html @@ -112,7 +112,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classBLAKE2s.html b/classBLAKE2s.html index e7cc2b4d..7fdf7053 100644 --- a/classBLAKE2s.html +++ b/classBLAKE2s.html @@ -600,7 +600,7 @@ Additional Inherited Members diff --git a/classBigNumberUtil-members.html b/classBigNumberUtil-members.html index fb541456..fc62275b 100644 --- a/classBigNumberUtil-members.html +++ b/classBigNumberUtil-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classBigNumberUtil.html b/classBigNumberUtil.html index 69988cfc..2bd34db1 100644 --- a/classBigNumberUtil.html +++ b/classBigNumberUtil.html @@ -943,7 +943,7 @@ Static Public Member Functions diff --git a/classBitmap-members.html b/classBitmap-members.html index 78abf731..be22cbda 100644 --- a/classBitmap-members.html +++ b/classBitmap-members.html @@ -138,7 +138,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classBitmap.html b/classBitmap.html index e9be744b..d1ba82c6 100644 --- a/classBitmap.html +++ b/classBitmap.html @@ -1745,7 +1745,7 @@ class DMD diff --git a/classBlinkLED-members.html b/classBlinkLED-members.html index c6e0bfea..bdf6a586 100644 --- a/classBlinkLED-members.html +++ b/classBlinkLED-members.html @@ -103,7 +103,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classBlinkLED.html b/classBlinkLED.html index 571815a0..7b3c76e5 100644 --- a/classBlinkLED.html +++ b/classBlinkLED.html @@ -428,7 +428,7 @@ Public Member Functions diff --git a/classBlockCipher-members.html b/classBlockCipher-members.html index bf9a1611..b4398815 100644 --- a/classBlockCipher-members.html +++ b/classBlockCipher-members.html @@ -101,7 +101,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classBlockCipher.html b/classBlockCipher.html index 0d99afd8..98455a19 100644 --- a/classBlockCipher.html +++ b/classBlockCipher.html @@ -410,7 +410,7 @@ Public Member Functions diff --git a/classBoolField-members.html b/classBoolField-members.html index 45b0bf7e..ff56cfdf 100644 --- a/classBoolField-members.html +++ b/classBoolField-members.html @@ -113,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classBoolField.html b/classBoolField.html index 0ed8084c..e654b82d 100644 --- a/classBoolField.html +++ b/classBoolField.html @@ -506,7 +506,7 @@ LiquidCrystal *  diff --git a/classCBC-members.html b/classCBC-members.html index 4c083277..1b8b41f6 100644 --- a/classCBC-members.html +++ b/classCBC-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classCBC.html b/classCBC.html index b7af55f8..5d9b1c05 100644 --- a/classCBC.html +++ b/classCBC.html @@ -185,7 +185,7 @@ class CBC< T > diff --git a/classCBCCommon-members.html b/classCBCCommon-members.html index 0ddbcd79..a38f06cd 100644 --- a/classCBCCommon-members.html +++ b/classCBCCommon-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classCBCCommon.html b/classCBCCommon.html index 8accb960..ed6e8618 100644 --- a/classCBCCommon.html +++ b/classCBCCommon.html @@ -534,7 +534,7 @@ Protected Member Functions diff --git a/classCFB-members.html b/classCFB-members.html index bc911bf3..0de5ea8d 100644 --- a/classCFB-members.html +++ b/classCFB-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classCFB.html b/classCFB.html index 3d932eef..b1275c45 100644 --- a/classCFB.html +++ b/classCFB.html @@ -185,7 +185,7 @@ class CFB< T > diff --git a/classCFBCommon-members.html b/classCFBCommon-members.html index b2afa281..c8b0dfc2 100644 --- a/classCFBCommon-members.html +++ b/classCFBCommon-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classCFBCommon.html b/classCFBCommon.html index 099e12b8..216f6111 100644 --- a/classCFBCommon.html +++ b/classCFBCommon.html @@ -534,7 +534,7 @@ Protected Member Functions diff --git a/classCTR-members.html b/classCTR-members.html index 83c39380..7ea27047 100644 --- a/classCTR-members.html +++ b/classCTR-members.html @@ -107,7 +107,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classCTR.html b/classCTR.html index 42774150..73a87a8c 100644 --- a/classCTR.html +++ b/classCTR.html @@ -181,7 +181,7 @@ class CTR< T > diff --git a/classCTRCommon-members.html b/classCTRCommon-members.html index f329ad88..2c9a9a7e 100644 --- a/classCTRCommon-members.html +++ b/classCTRCommon-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classCTRCommon.html b/classCTRCommon.html index 6575e2ba..e0ca90c0 100644 --- a/classCTRCommon.html +++ b/classCTRCommon.html @@ -563,7 +563,7 @@ Protected Member Functions diff --git a/classChaCha-members.html b/classChaCha-members.html index 0c70005c..92c926f9 100644 --- a/classChaCha-members.html +++ b/classChaCha-members.html @@ -109,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classChaCha.html b/classChaCha.html index c1bb3748..7edadda2 100644 --- a/classChaCha.html +++ b/classChaCha.html @@ -673,7 +673,7 @@ class ChaChaPoly< diff --git a/classChaChaPoly-members.html b/classChaChaPoly-members.html index 1915a121..906adc23 100644 --- a/classChaChaPoly-members.html +++ b/classChaChaPoly-members.html @@ -115,7 +115,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classChaChaPoly.html b/classChaChaPoly.html index f409812e..448b47fc 100644 --- a/classChaChaPoly.html +++ b/classChaChaPoly.html @@ -665,7 +665,7 @@ virtual  diff --git a/classCharlieplex-members.html b/classCharlieplex-members.html index ce1b3442..b43d551e 100644 --- a/classCharlieplex-members.html +++ b/classCharlieplex-members.html @@ -104,7 +104,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classCharlieplex.html b/classCharlieplex.html index 33f596f6..067bf945 100644 --- a/classCharlieplex.html +++ b/classCharlieplex.html @@ -538,7 +538,7 @@ Public Member Functions diff --git a/classChaseLEDs-members.html b/classChaseLEDs-members.html index 575fe55b..d9541ecc 100644 --- a/classChaseLEDs-members.html +++ b/classChaseLEDs-members.html @@ -99,7 +99,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classChaseLEDs.html b/classChaseLEDs.html index 92c75f36..34d0c7e7 100644 --- a/classChaseLEDs.html +++ b/classChaseLEDs.html @@ -347,7 +347,7 @@ Protected Member Functions diff --git a/classCipher-members.html b/classCipher-members.html index 3e9dd783..06ca295b 100644 --- a/classCipher-members.html +++ b/classCipher-members.html @@ -102,7 +102,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classCipher.html b/classCipher.html index 62c8cd26..c17b456a 100644 --- a/classCipher.html +++ b/classCipher.html @@ -485,7 +485,7 @@ Public Member Functions diff --git a/classCurve25519-members.html b/classCurve25519-members.html index ae9f4c8e..df2fbfbb 100644 --- a/classCurve25519-members.html +++ b/classCurve25519-members.html @@ -97,7 +97,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classCurve25519.html b/classCurve25519.html index 4e704cd5..ff844755 100644 --- a/classCurve25519.html +++ b/classCurve25519.html @@ -303,7 +303,7 @@ class Ed25519 diff --git a/classDMD-members.html b/classDMD-members.html index a24d731a..d4b874f8 100644 --- a/classDMD-members.html +++ b/classDMD-members.html @@ -150,7 +150,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classDMD.html b/classDMD.html index edf54d71..90bc6e9e 100644 --- a/classDMD.html +++ b/classDMD.html @@ -755,7 +755,7 @@ Multiple panels diff --git a/classDS1307RTC-members.html b/classDS1307RTC-members.html index f0a1ad90..5a2136fa 100644 --- a/classDS1307RTC-members.html +++ b/classDS1307RTC-members.html @@ -125,7 +125,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classDS1307RTC.html b/classDS1307RTC.html index d7301f77..5ef278ae 100644 --- a/classDS1307RTC.html +++ b/classDS1307RTC.html @@ -598,7 +598,7 @@ static const uint8_t  diff --git a/classDS3231RTC-members.html b/classDS3231RTC-members.html index a6125367..fb4d27d3 100644 --- a/classDS3231RTC-members.html +++ b/classDS3231RTC-members.html @@ -133,7 +133,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classDS3231RTC.html b/classDS3231RTC.html index 4f154000..9e27b327 100644 --- a/classDS3231RTC.html +++ b/classDS3231RTC.html @@ -713,7 +713,7 @@ static const uint8_t  diff --git a/classDS3232RTC-members.html b/classDS3232RTC-members.html index c75f059c..a20d60cf 100644 --- a/classDS3232RTC-members.html +++ b/classDS3232RTC-members.html @@ -130,7 +130,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classDS3232RTC.html b/classDS3232RTC.html index 80f3678a..c2ae0c43 100644 --- a/classDS3232RTC.html +++ b/classDS3232RTC.html @@ -750,7 +750,7 @@ static const uint8_t  diff --git a/classEAX-members.html b/classEAX-members.html index 60e8e783..5a303d89 100644 --- a/classEAX-members.html +++ b/classEAX-members.html @@ -118,7 +118,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classEAX.html b/classEAX.html index e706fe13..1fe6b303 100644 --- a/classEAX.html +++ b/classEAX.html @@ -219,7 +219,7 @@ class EAX< T > diff --git a/classEAXCommon-members.html b/classEAXCommon-members.html index d8ff81df..3dd677dd 100644 --- a/classEAXCommon-members.html +++ b/classEAXCommon-members.html @@ -117,7 +117,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classEAXCommon.html b/classEAXCommon.html index 1315293a..910793b8 100644 --- a/classEAXCommon.html +++ b/classEAXCommon.html @@ -732,7 +732,7 @@ Protected Member Functions diff --git a/classEEPROM24-members.html b/classEEPROM24-members.html index da0124de..599269ad 100644 --- a/classEEPROM24-members.html +++ b/classEEPROM24-members.html @@ -101,7 +101,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classEEPROM24.html b/classEEPROM24.html index 3111672e..a7c86576 100644 --- a/classEEPROM24.html +++ b/classEEPROM24.html @@ -431,7 +431,7 @@ Public Member Functions diff --git a/classEd25519-members.html b/classEd25519-members.html index 09241287..b6400027 100644 --- a/classEd25519-members.html +++ b/classEd25519-members.html @@ -97,7 +97,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classEd25519.html b/classEd25519.html index 1d9d6ee4..003fecd1 100644 --- a/classEd25519.html +++ b/classEd25519.html @@ -354,7 +354,7 @@ Static Public Member Functions diff --git a/classField-members.html b/classField-members.html index be829eb6..a39aaeda 100644 --- a/classField-members.html +++ b/classField-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classField.html b/classField.html index 9f0f8148..0f71c427 100644 --- a/classField.html +++ b/classField.html @@ -424,7 +424,7 @@ class Form diff --git a/classForm-members.html b/classForm-members.html index dd46f86c..5a848cf6 100644 --- a/classForm-members.html +++ b/classForm-members.html @@ -108,7 +108,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classForm.html b/classForm.html index 0a3b2b8b..c495c190 100644 --- a/classForm.html +++ b/classForm.html @@ -485,7 +485,7 @@ class Field diff --git a/classGCM-members.html b/classGCM-members.html index 11036d37..b5af0fb8 100644 --- a/classGCM-members.html +++ b/classGCM-members.html @@ -119,7 +119,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classGCM.html b/classGCM.html index db070291..a84df50e 100644 --- a/classGCM.html +++ b/classGCM.html @@ -223,7 +223,7 @@ class GCM< T > diff --git a/classGCMCommon-members.html b/classGCMCommon-members.html index 65fad880..0fed898e 100644 --- a/classGCMCommon-members.html +++ b/classGCMCommon-members.html @@ -118,7 +118,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classGCMCommon.html b/classGCMCommon.html index d69bcdad..fd9e4418 100644 --- a/classGCMCommon.html +++ b/classGCMCommon.html @@ -736,7 +736,7 @@ Protected Member Functions diff --git a/classGF128-members.html b/classGF128-members.html index 3b1e6581..f090f783 100644 --- a/classGF128-members.html +++ b/classGF128-members.html @@ -98,7 +98,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classGF128.html b/classGF128.html index eb2d4616..6a4cc977 100644 --- a/classGF128.html +++ b/classGF128.html @@ -334,7 +334,7 @@ Static Public Member Functions diff --git a/classGHASH-members.html b/classGHASH-members.html index aec8e555..e732379e 100644 --- a/classGHASH-members.html +++ b/classGHASH-members.html @@ -103,7 +103,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classGHASH.html b/classGHASH.html index 42672895..09bdf3a8 100644 --- a/classGHASH.html +++ b/classGHASH.html @@ -265,7 +265,7 @@ void  diff --git a/classHash-members.html b/classHash-members.html index 26eda5b9..3362e388 100644 --- a/classHash-members.html +++ b/classHash-members.html @@ -104,7 +104,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classHash.html b/classHash.html index 583d7a0b..8cd71ba4 100644 --- a/classHash.html +++ b/classHash.html @@ -575,7 +575,7 @@ Protected Member Functions diff --git a/classI2CMaster-members.html b/classI2CMaster-members.html index c3bb1bb0..5d76311d 100644 --- a/classI2CMaster-members.html +++ b/classI2CMaster-members.html @@ -100,7 +100,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classI2CMaster.html b/classI2CMaster.html index 2c74efac..0ec78382 100644 --- a/classI2CMaster.html +++ b/classI2CMaster.html @@ -328,7 +328,7 @@ virtual unsigned int  diff --git a/classIRreceiver-members.html b/classIRreceiver-members.html index 4585398e..7b51aaf8 100644 --- a/classIRreceiver-members.html +++ b/classIRreceiver-members.html @@ -100,7 +100,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classIRreceiver.html b/classIRreceiver.html index f31f31b6..2a111f7f 100644 --- a/classIRreceiver.html +++ b/classIRreceiver.html @@ -328,7 +328,7 @@ void _IR_receive_interrupt diff --git a/classIntField-members.html b/classIntField-members.html index e0aa0bf5..881ef6fa 100644 --- a/classIntField-members.html +++ b/classIntField-members.html @@ -118,7 +118,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classIntField.html b/classIntField.html index 47fce208..5141da47 100644 --- a/classIntField.html +++ b/classIntField.html @@ -647,7 +647,7 @@ LiquidCrystal *  diff --git a/classKeccakCore-members.html b/classKeccakCore-members.html index 5cb36399..bc3a2d68 100644 --- a/classKeccakCore-members.html +++ b/classKeccakCore-members.html @@ -108,7 +108,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classKeccakCore.html b/classKeccakCore.html index eb524060..35a0a844 100644 --- a/classKeccakCore.html +++ b/classKeccakCore.html @@ -475,7 +475,7 @@ void  diff --git a/classLCD-members.html b/classLCD-members.html index 29b7b2de..ab5194b7 100644 --- a/classLCD-members.html +++ b/classLCD-members.html @@ -110,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classLCD.html b/classLCD.html index 4d7dc309..63b680e9 100644 --- a/classLCD.html +++ b/classLCD.html @@ -592,7 +592,7 @@ Support for DFRobot LCD Shield diff --git a/classListField-members.html b/classListField-members.html index 292821b1..323831a3 100644 --- a/classListField-members.html +++ b/classListField-members.html @@ -111,7 +111,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classListField.html b/classListField.html index 0841b98a..d5a24941 100644 --- a/classListField.html +++ b/classListField.html @@ -411,7 +411,7 @@ LiquidCrystal *  diff --git a/classLoginShell-members.html b/classLoginShell-members.html index c5a911ec..4473a77b 100644 --- a/classLoginShell-members.html +++ b/classLoginShell-members.html @@ -180,7 +180,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classLoginShell.html b/classLoginShell.html index f0de4dca..484f11bf 100644 --- a/classLoginShell.html +++ b/classLoginShell.html @@ -572,7 +572,7 @@ Additional Inherited Members diff --git a/classMelody-members.html b/classMelody-members.html index ed70d55c..88ede0b9 100644 --- a/classMelody-members.html +++ b/classMelody-members.html @@ -103,7 +103,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classMelody.html b/classMelody.html index ccd1f895..6bba2db9 100644 --- a/classMelody.html +++ b/classMelody.html @@ -371,7 +371,7 @@ bool  diff --git a/classNewHope-members.html b/classNewHope-members.html index 1f8252fc..f9becfc0 100644 --- a/classNewHope-members.html +++ b/classNewHope-members.html @@ -90,16 +90,16 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

This is the complete list of members for NewHope, including all inherited members.

- + - +
keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePoly &sk, Variant variant=Ref, const uint8_t *random_seed=0)NewHopestatic
keygen(uint8_t send[NEWHOPE_SENDABYTES], NewHopePrivateKey &sk, Variant variant=Ref, const uint8_t *random_seed=0)NewHopestatic
Ref enum valueNewHope
shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES], const NewHopePoly &sk, uint8_t received[NEWHOPE_SENDBBYTES])NewHopestatic
shareda(uint8_t shared_key[NEWHOPE_SHAREDBYTES], const NewHopePrivateKey &sk, uint8_t received[NEWHOPE_SENDBBYTES])NewHopestatic
sharedb(uint8_t shared_key[NEWHOPE_SHAREDBYTES], uint8_t send[NEWHOPE_SENDBBYTES], uint8_t received[NEWHOPE_SENDABYTES], Variant variant=Ref, const uint8_t *random_seed=0)NewHopestatic
Torref enum valueNewHope
Variant enum nameNewHope
diff --git a/classNewHope.html b/classNewHope.html index 52d4ce1e..6a720d64 100644 --- a/classNewHope.html +++ b/classNewHope.html @@ -107,41 +107,44 @@ Public Types - - - + + + - - - + + +

Static Public Member Functions

static void keygen (uint8_t send[NEWHOPE_SENDABYTES], NewHopePoly &sk, Variant variant=Ref, const uint8_t *random_seed=0)
 Generates the key pair for Alice in a New Hope key exchange. More...
 
static void keygen (uint8_t send[NEWHOPE_SENDABYTES], NewHopePrivateKey &sk, Variant variant=Ref, const uint8_t *random_seed=0)
 Generates the key pair for Alice in a New Hope key exchange. More...
 
static void sharedb (uint8_t shared_key[NEWHOPE_SHAREDBYTES], uint8_t send[NEWHOPE_SENDBBYTES], uint8_t received[NEWHOPE_SENDABYTES], Variant variant=Ref, const uint8_t *random_seed=0)
 Generates the public key and shared secret for Bob. More...
 
static void shareda (uint8_t shared_key[NEWHOPE_SHAREDBYTES], const NewHopePoly &sk, uint8_t received[NEWHOPE_SENDBBYTES])
 Generates the shared secret for Alice. More...
 
static void shareda (uint8_t shared_key[NEWHOPE_SHAREDBYTES], const NewHopePrivateKey &sk, uint8_t received[NEWHOPE_SENDBBYTES])
 Generates the shared secret for Alice. More...
 

Detailed Description

NewHope post-quantum key exchange algorithm.

New Hope is an ephemeral key exchange algorithm, similar to Diffie-Hellman, which is believed to be resistant to quantum computers.

-
Note
The functions in this class need up to 7k of stack space to store temporary intermediate values in addition to up to 4k of memory in the application to store public and private key parameters. Due to these memory requirements, this class is only suitable for use on high-end ARM-based Arduino variants like the Arduino Due. It won't fit in the available memory on AVR-based Arduino variants.
+
Note
The functions in this class need a substantial amount of memory for function parameters and stack space. On an 8-bit AVR system it is possible to operate with around 2K of parameter space and 4.5K of stack space if the parameters are in shared buffers. More information on the memory requirements and how they were reduced are on this page.

Key exchange occurs between two parties, Alice and Bob, and results in a 32-byte (256-bit) shared secret. Alice's public key is 1824 bytes in size and Bob's public key is 2048 bytes in size.

Alice, either the client or the server depending upon the application, generates a key pair as follows:

uint8_t alice_public[NEWHOPE_SENDABYTES];
-
NewHopePoly alice_private;
-
NewHope::keygen(alice_public, alice_private);
+
NewHopePrivateKey alice_private;
+
NewHope::keygen(alice_public, alice_private);

Alice's application sends the contents of alice_public to Bob, who then performs the following operations:

uint8_t bob_public[NEWHOPE_SENDABYTES];
uint8_t shared_secret[NEWHOPE_SHAREDBYTES];
NewHope::sharedb(shared_secret, bob_public, alice_public);

Bob's application sends the contents of bob_public to Alice, and can then begin encrypting session traffic with shared_secret or some transformed version of it.

-

When Alice's application receives bob_public, the application performs the folllowing final steps to generate her version of the shared secret:

+

To reduce the memory requirements, the second and third parameters to sharedb() can point to the same 2048-byte buffer. On entry, the first 1824 bytes of the buffer are filled with Alice's public key. On exit, the buffer is filled with the 2048 bytes of Bob's public key:

uint8_t shared_secret[NEWHOPE_SHAREDBYTES];
-
NewHope::shareda(shared_secret, alice_private, bob_public);
-

In the New Hope paper there are two versions of the algorithm described, referred to as "ref" and "torref" in author's reference C code. This class implements "ref" by default, but it is possible to enable the "torref" variant with an extra parameter on the keygen() and sharedb() function calls:

-
NewHope::keygen(alice_public, alice_private, NewHope::Torref);
+
NewHope::sharedb(shared_secret, public_key, public_key);
+

When Alice's application receives bob_public, the application performs the folllowing final steps to generate her version of the shared secret:

+
uint8_t shared_secret[NEWHOPE_SHAREDBYTES];
+
NewHope::shareda(shared_secret, alice_private, bob_public);
+

In the New Hope paper there are two versions of the algorithm described, referred to as "ref" and "torref" in author's reference C code. This class implements "ref" by default, but it is possible to enable the "torref" variant with an extra parameter on the keygen() and sharedb() function calls:

+
NewHope::keygen(alice_public, alice_private, NewHope::Torref);
NewHope::sharedb(shared_secret, bob_public, alice_public, NewHope::Torref);
-

The shareda() function is the same for both "ref" and "torref".

+

The shareda() function is the same for both "ref" and "torref".

The "ref" and "torref" variants are not binary-compatible. Public keys generated with one variant will not work with the other variant. The application author must make a decision as to which variant they need and then use it universally. The paper contains more information on why an application may want to use "torref" instead of "ref".

Reference: https://cryptojedi.org/crypto/#newhope

-

Definition at line 48 of file NewHope.h.

+

Definition at line 50 of file NewHope.h.

Member Enumeration Documentation

@@ -164,12 +167,12 @@ Static Public Member Functions -

Definition at line 55 of file NewHope.h.

+

Definition at line 57 of file NewHope.h.

Member Function Documentation

- +
@@ -185,7 +188,7 @@ Static Public Member Functions - + @@ -217,20 +220,20 @@ Static Public Member Functions
Parameters
NewHopePolyNewHopePrivateKey sk,
- +
sendThe public key value for Alice to be sent to Bob.
skThe secret key value for Alice to be passed to shareda() later.
skThe private key value for Alice to be passed to shareda() later.
variantThe variant of the New Hope algorithm to use, usually Ref.
random_seedPoints to 64 bytes of random data to use to generate the key pair. This is intended for test vectors only and should be set to NULL in real applications.

The send value should be sent to Bob over the communications link and then it can be discarded. The sk value must be retained until the later call to sharedb().

-
See Also
sharedb(), shareda()
+
See Also
sharedb(), shareda()
-

Definition at line 1039 of file NewHope.cpp.

+

Definition at line 1014 of file NewHope.cpp.

- +
@@ -246,7 +249,7 @@ Static Public Member Functions - + @@ -272,14 +275,14 @@ Static Public Member Functions
Parameters
const NewHopePolyconst NewHopePrivateKey sk,
- +
shared_keyThe shared secret key.
skAlice's secret private key which was generated by keygen().
skAlice's secret private key which was generated by keygen().
receivedThe public key value that was received from Bob.
-
See Also
sharedb(), keygen()
+
See Also
sharedb(), keygen()
-

Definition at line 1159 of file NewHope.cpp.

+

Definition at line 1288 of file NewHope.cpp.

@@ -337,7 +340,7 @@ Static Public Member Functions
Parameters
- + @@ -345,9 +348,10 @@ Static Public Member Functions

The send value should be sent to Alice over the communications link and then it can be discarded. Bob can immediately start encrypting session traffic with shared_key or some transformed version of it.

-
See Also
shareda(), keygen()
+

It is assumed that if send and received overlap, then they are the same pointer. The bytes at the end of send may be used for temporary storage while the leading bytes of send / received are being processed.

+
See Also
shareda(), keygen()
-

Definition at line 1098 of file NewHope.cpp.

+

Definition at line 1116 of file NewHope.cpp.

@@ -358,7 +362,7 @@ Static Public Member Functions diff --git a/classNoiseSource-members.html b/classNoiseSource-members.html index ad83eb7f..fdca8938 100644 --- a/classNoiseSource-members.html +++ b/classNoiseSource-members.html @@ -99,7 +99,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
shared_keyThe shared secret key.
sendThe public key value for Bob to be sent to Alice.
sendThe public key value for Bob to be sent to Alice. This is allowed to be the same pointer as received to replace the received value from Alice with the new value to send for Bob.
receivedThe public key value that was received from Alice.
variantThe variant of the New Hope algorithm to use, usually Ref.
random_seedPoints to 32 bytes of random data to use to generate the temporary private key for Bob. This is intended for test vectors only and should be set to NULL in real applications.
diff --git a/classNoiseSource.html b/classNoiseSource.html index 3e9f20c5..54728015 100644 --- a/classNoiseSource.html +++ b/classNoiseSource.html @@ -289,7 +289,7 @@ Protected Member Functions diff --git a/classOFB-members.html b/classOFB-members.html index 351b680c..77516583 100644 --- a/classOFB-members.html +++ b/classOFB-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classOFB.html b/classOFB.html index bfcdc867..11dd1e4c 100644 --- a/classOFB.html +++ b/classOFB.html @@ -181,7 +181,7 @@ class OFB< T > diff --git a/classOFBCommon-members.html b/classOFBCommon-members.html index db4bdd45..0763b28a 100644 --- a/classOFBCommon-members.html +++ b/classOFBCommon-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classOFBCommon.html b/classOFBCommon.html index 8ec753dd..a3585dae 100644 --- a/classOFBCommon.html +++ b/classOFBCommon.html @@ -534,7 +534,7 @@ Protected Member Functions diff --git a/classOMAC-members.html b/classOMAC-members.html index ba3fdf0f..1bfc1d89 100644 --- a/classOMAC-members.html +++ b/classOMAC-members.html @@ -102,7 +102,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classOMAC.html b/classOMAC.html index 889c3719..bc9aaa13 100644 --- a/classOMAC.html +++ b/classOMAC.html @@ -387,7 +387,7 @@ void  diff --git a/classP521-members.html b/classP521-members.html index e1755dfc..5b8070d5 100644 --- a/classP521-members.html +++ b/classP521-members.html @@ -103,7 +103,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classP521.html b/classP521.html index b56d964f..b51aa289 100644 --- a/classP521.html +++ b/classP521.html @@ -646,7 +646,7 @@ Static Public Member Functions diff --git a/classPoly1305-members.html b/classPoly1305-members.html index 68ee6507..aa2ce15a 100644 --- a/classPoly1305-members.html +++ b/classPoly1305-members.html @@ -104,7 +104,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classPoly1305.html b/classPoly1305.html index cbc89f55..ff86fb1c 100644 --- a/classPoly1305.html +++ b/classPoly1305.html @@ -280,7 +280,7 @@ void  diff --git a/classRNGClass-members.html b/classRNGClass-members.html index 817a7e28..b6782185 100644 --- a/classRNGClass-members.html +++ b/classRNGClass-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classRNGClass.html b/classRNGClass.html index c43d028b..a3df81cf 100644 --- a/classRNGClass.html +++ b/classRNGClass.html @@ -519,7 +519,7 @@ static const int  diff --git a/classRTC-members.html b/classRTC-members.html index 86d3bb8f..3f2f69c1 100644 --- a/classRTC-members.html +++ b/classRTC-members.html @@ -123,7 +123,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classRTC.html b/classRTC.html index 1978c533..63cfb941 100644 --- a/classRTC.html +++ b/classRTC.html @@ -779,7 +779,7 @@ static const uint8_t  diff --git a/classRTCAlarm-members.html b/classRTCAlarm-members.html index 1d3c24c4..7f595918 100644 --- a/classRTCAlarm-members.html +++ b/classRTCAlarm-members.html @@ -99,7 +99,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classRTCDate-members.html b/classRTCDate-members.html index 441817c5..e0e0ed6b 100644 --- a/classRTCDate-members.html +++ b/classRTCDate-members.html @@ -96,7 +96,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classRTCTime-members.html b/classRTCTime-members.html index e77292ba..38b6c030 100644 --- a/classRTCTime-members.html +++ b/classRTCTime-members.html @@ -96,7 +96,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classRingOscillatorNoiseSource-members.html b/classRingOscillatorNoiseSource-members.html index ca8cf48a..6c4b8c91 100644 --- a/classRingOscillatorNoiseSource-members.html +++ b/classRingOscillatorNoiseSource-members.html @@ -101,7 +101,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classRingOscillatorNoiseSource.html b/classRingOscillatorNoiseSource.html index b467022b..3f58578f 100644 --- a/classRingOscillatorNoiseSource.html +++ b/classRingOscillatorNoiseSource.html @@ -253,7 +253,7 @@ Additional Inherited Members diff --git a/classSHA256-members.html b/classSHA256-members.html index f990eb04..828dbc58 100644 --- a/classSHA256-members.html +++ b/classSHA256-members.html @@ -110,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSHA256.html b/classSHA256.html index fc93a8f6..e0639229 100644 --- a/classSHA256.html +++ b/classSHA256.html @@ -506,7 +506,7 @@ Additional Inherited Members diff --git a/classSHA3__256-members.html b/classSHA3__256-members.html index 6ee36635..93431bb2 100644 --- a/classSHA3__256-members.html +++ b/classSHA3__256-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSHA3__256.html b/classSHA3__256.html index 5c7ec416..83ddab16 100644 --- a/classSHA3__256.html +++ b/classSHA3__256.html @@ -506,7 +506,7 @@ Additional Inherited Members diff --git a/classSHA3__512-members.html b/classSHA3__512-members.html index a66ab38a..3636a6b7 100644 --- a/classSHA3__512-members.html +++ b/classSHA3__512-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSHA3__512.html b/classSHA3__512.html index 4a87a91b..099e57bd 100644 --- a/classSHA3__512.html +++ b/classSHA3__512.html @@ -506,7 +506,7 @@ Additional Inherited Members diff --git a/classSHA512-members.html b/classSHA512-members.html index 18fab582..f5ef6b43 100644 --- a/classSHA512-members.html +++ b/classSHA512-members.html @@ -112,7 +112,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSHA512.html b/classSHA512.html index 6bd92511..1b01b62f 100644 --- a/classSHA512.html +++ b/classSHA512.html @@ -513,7 +513,7 @@ Additional Inherited Members diff --git a/classSHAKE-members.html b/classSHAKE-members.html index 6c0c89f4..2faa0471 100644 --- a/classSHAKE-members.html +++ b/classSHAKE-members.html @@ -104,7 +104,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSHAKE.html b/classSHAKE.html index 77f8df79..c37cb65c 100644 --- a/classSHAKE.html +++ b/classSHAKE.html @@ -443,7 +443,7 @@ Protected Member Functions diff --git a/classSHAKE128-members.html b/classSHAKE128-members.html index c2dcbf4e..bbcad846 100644 --- a/classSHAKE128-members.html +++ b/classSHAKE128-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSHAKE128.html b/classSHAKE128.html index 9dbd9465..171117e6 100644 --- a/classSHAKE128.html +++ b/classSHAKE128.html @@ -171,7 +171,7 @@ Additional Inherited Members diff --git a/classSHAKE256-members.html b/classSHAKE256-members.html index 07e3d468..02d6797f 100644 --- a/classSHAKE256-members.html +++ b/classSHAKE256-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSHAKE256.html b/classSHAKE256.html index cf228c9e..806fe668 100644 --- a/classSHAKE256.html +++ b/classSHAKE256.html @@ -171,7 +171,7 @@ Additional Inherited Members diff --git a/classShell-members.html b/classShell-members.html index 82b6999b..6be146f9 100644 --- a/classShell-members.html +++ b/classShell-members.html @@ -174,7 +174,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classShell.html b/classShell.html index 46ef32e3..02c17b10 100644 --- a/classShell.html +++ b/classShell.html @@ -837,7 +837,7 @@ Additional Inherited Members diff --git a/classShellArguments-members.html b/classShellArguments-members.html index 46d60eaa..46a036c1 100644 --- a/classShellArguments-members.html +++ b/classShellArguments-members.html @@ -96,7 +96,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classShellArguments.html b/classShellArguments.html index 670050e7..a65597e9 100644 --- a/classShellArguments.html +++ b/classShellArguments.html @@ -182,7 +182,7 @@ class Shell diff --git a/classSoftI2C-members.html b/classSoftI2C-members.html index 8e24b10b..3b79298c 100644 --- a/classSoftI2C-members.html +++ b/classSoftI2C-members.html @@ -101,7 +101,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSoftI2C.html b/classSoftI2C.html index 1d17c096..c0325937 100644 --- a/classSoftI2C.html +++ b/classSoftI2C.html @@ -346,7 +346,7 @@ unsigned int  diff --git a/classSpeck-members.html b/classSpeck-members.html index 6e822eaf..e5198ce0 100644 --- a/classSpeck-members.html +++ b/classSpeck-members.html @@ -103,7 +103,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSpeck.html b/classSpeck.html index 6e33cc70..0928b712 100644 --- a/classSpeck.html +++ b/classSpeck.html @@ -415,7 +415,7 @@ Public Member Functions diff --git a/classSpeckSmall-members.html b/classSpeckSmall-members.html index fba175ef..74837d9d 100644 --- a/classSpeckSmall-members.html +++ b/classSpeckSmall-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSpeckSmall.html b/classSpeckSmall.html index 6e266dab..08ebe7ca 100644 --- a/classSpeckSmall.html +++ b/classSpeckSmall.html @@ -319,7 +319,7 @@ Public Member Functions diff --git a/classSpeckTiny-members.html b/classSpeckTiny-members.html index 0a880904..7b54a262 100644 --- a/classSpeckTiny-members.html +++ b/classSpeckTiny-members.html @@ -104,7 +104,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSpeckTiny.html b/classSpeckTiny.html index ca47b849..069597de 100644 --- a/classSpeckTiny.html +++ b/classSpeckTiny.html @@ -428,7 +428,7 @@ class SpeckSmall< diff --git a/classTerminal-members.html b/classTerminal-members.html index 452559d3..7f509598 100644 --- a/classTerminal-members.html +++ b/classTerminal-members.html @@ -156,7 +156,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classTerminal.html b/classTerminal.html index 4fd3b4fd..906a3326 100644 --- a/classTerminal.html +++ b/classTerminal.html @@ -1443,7 +1443,7 @@ Static Public Member Functions diff --git a/classTextField-members.html b/classTextField-members.html index 7dfe8b15..dae0eb31 100644 --- a/classTextField-members.html +++ b/classTextField-members.html @@ -109,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classTextField.html b/classTextField.html index 82e354fd..4f27f154 100644 --- a/classTextField.html +++ b/classTextField.html @@ -343,7 +343,7 @@ LiquidCrystal *  diff --git a/classTimeField-members.html b/classTimeField-members.html index 02abf68c..a90dbaed 100644 --- a/classTimeField-members.html +++ b/classTimeField-members.html @@ -113,7 +113,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classTimeField.html b/classTimeField.html index 1417866d..4127bedd 100644 --- a/classTimeField.html +++ b/classTimeField.html @@ -541,7 +541,7 @@ LiquidCrystal *  diff --git a/classTransistorNoiseSource-members.html b/classTransistorNoiseSource-members.html index 63747f97..c7f13fe4 100644 --- a/classTransistorNoiseSource-members.html +++ b/classTransistorNoiseSource-members.html @@ -101,7 +101,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classTransistorNoiseSource.html b/classTransistorNoiseSource.html index a4a0bf77..1938cc92 100644 --- a/classTransistorNoiseSource.html +++ b/classTransistorNoiseSource.html @@ -280,7 +280,7 @@ Additional Inherited Members diff --git a/classXOF-members.html b/classXOF-members.html index df82f1f8..be11f7b7 100644 --- a/classXOF-members.html +++ b/classXOF-members.html @@ -102,7 +102,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classXOF.html b/classXOF.html index 2046728e..ca0c8101 100644 --- a/classXOF.html +++ b/classXOF.html @@ -508,7 +508,7 @@ Public Member Functions diff --git a/classXTS-members.html b/classXTS-members.html index 3a770c70..b611f474 100644 --- a/classXTS-members.html +++ b/classXTS-members.html @@ -107,7 +107,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classXTS.html b/classXTS.html index b6c76506..be7ebf61 100644 --- a/classXTS.html +++ b/classXTS.html @@ -220,7 +220,7 @@ template<typename T1, typename T2 = T1> diff --git a/classXTSCommon-members.html b/classXTSCommon-members.html index db4f7829..6fc5fc72 100644 --- a/classXTSCommon-members.html +++ b/classXTSCommon-members.html @@ -106,7 +106,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classXTSCommon.html b/classXTSCommon.html index a119c253..5f1497f2 100644 --- a/classXTSCommon.html +++ b/classXTSCommon.html @@ -497,7 +497,7 @@ class XTSSingleKeyCommon diff --git a/classXTSSingleKey-members.html b/classXTSSingleKey-members.html index 8a1ca0b9..62087af7 100644 --- a/classXTSSingleKey-members.html +++ b/classXTSSingleKey-members.html @@ -109,7 +109,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classXTSSingleKey.html b/classXTSSingleKey.html index 0575fab8..e49d7753 100644 --- a/classXTSSingleKey.html +++ b/classXTSSingleKey.html @@ -218,7 +218,7 @@ template<typename T > diff --git a/classXTSSingleKeyCommon-members.html b/classXTSSingleKeyCommon-members.html index eae87149..9b4af14b 100644 --- a/classXTSSingleKeyCommon-members.html +++ b/classXTSSingleKeyCommon-members.html @@ -107,7 +107,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classXTSSingleKeyCommon.html b/classXTSSingleKeyCommon.html index d85a7176..6f71f59b 100644 --- a/classXTSSingleKeyCommon.html +++ b/classXTSSingleKeyCommon.html @@ -257,7 +257,7 @@ Protected Member Functions diff --git a/classes.html b/classes.html index e82095d5..0ceff76d 100644 --- a/classes.html +++ b/classes.html @@ -132,14 +132,14 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); SHA3_256    ChaCha   SHA3_512    ChaChaPoly   GCM   NewHope   SHA512    -Charlieplex   GCMCommon   NewHopePoly   SHAKE    +Charlieplex   GCMCommon   NewHopePrivateKey   SHAKE   
A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | R | S | T | X
diff --git a/crypto-rng-ring_8dox.html b/crypto-rng-ring_8dox.html index dc4c19e5..572505ff 100644 --- a/crypto-rng-ring_8dox.html +++ b/crypto-rng-ring_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/crypto-rng_8dox.html b/crypto-rng_8dox.html index 2429b0d8..e0bc7b44 100644 --- a/crypto-rng_8dox.html +++ b/crypto-rng_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/crypto.html b/crypto.html index 5b6302ea..baf62af6 100644 --- a/crypto.html +++ b/crypto.html @@ -232,9 +232,21 @@ Performance on AVR P521::verify()109078msDigital signature verification P521::derivePublicKey()46290msDerive a public key from a private key + +NewHope::keygen(), Ref639msGenerate key pair for Alice, Ref version + +NewHope::sharedb(), Ref1237msGenerate shared secret and public key for Bob, Ref version + +NewHope::shareda(), Ref496msGenerate shared secret for Alice, Ref version + +NewHope::keygen(), Torref777msGenerate key pair for Alice, Torref version + +NewHope::sharedb(), Torref1376msGenerate shared secret and public key for Bob, Torref version + +NewHope::shareda(), Torref496msGenerate shared secret for Alice, Torref version

Where a cipher supports more than one key size (such as ChaCha), the values are typically almost identical for 128-bit and 256-bit keys so only the maximum is shown above.

-

Due to the memory requirements, NewHope is not yet possible on AVR-based Arduino systems.

+

Due to the memory requirements, P521 and NewHope performance was measured on an Arduino Mega 2560 running at 16 MHz. They are too big to fit in the RAM size of the Uno.

Performance on ARM

All figures are for the Arduino Due running at 84 MHz:

@@ -364,22 +376,22 @@ Performance on ARM P521::derivePublicKey()1503msDerive a public key from a private key -NewHope::keygen(), Ref29msGenerate key pair for Alice, Ref version +NewHope::keygen(), Ref29msGenerate key pair for Alice, Ref version -NewHope::sharedb(), Ref40msGenerate shared secret and public key for Bob, Ref version +NewHope::sharedb(), Ref41msGenerate shared secret and public key for Bob, Ref version -NewHope::shareda(), Ref9msGenerate shared secret for Alice, Ref version +NewHope::shareda(), Ref9msGenerate shared secret for Alice, Ref version -NewHope::keygen(), Torref42msGenerate key pair for Alice, Torref version +NewHope::keygen(), Torref42msGenerate key pair for Alice, Torref version NewHope::sharedb(), Torref53msGenerate shared secret and public key for Bob, Torref version -NewHope::shareda(), Torref9msGenerate shared secret for Alice, Torref version +NewHope::shareda(), Torref9msGenerate shared secret for Alice, Torref version diff --git a/crypto_8dox.html b/crypto_8dox.html index ae02049f..15f27304 100644 --- a/crypto_8dox.html +++ b/crypto_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/crypto_rng.html b/crypto_rng.html index 3afd51e5..4adedd7b 100644 --- a/crypto_rng.html +++ b/crypto_rng.html @@ -190,7 +190,7 @@ Destroying secret data diff --git a/crypto_rng_ring.html b/crypto_rng_ring.html index b6666fbb..3f2f8847 100644 --- a/crypto_rng_ring.html +++ b/crypto_rng_ring.html @@ -151,7 +151,7 @@ Connecting to the Arduino diff --git a/dir_1586d320a3b1e622174530fde769cda9.html b/dir_1586d320a3b1e622174530fde769cda9.html index 228e8a29..fb156f32 100644 --- a/dir_1586d320a3b1e622174530fde769cda9.html +++ b/dir_1586d320a3b1e622174530fde769cda9.html @@ -102,7 +102,7 @@ Files diff --git a/dir_1de32c476debcefedf4aa8bb43bea551.html b/dir_1de32c476debcefedf4aa8bb43bea551.html index db42d6b1..9b674c22 100644 --- a/dir_1de32c476debcefedf4aa8bb43bea551.html +++ b/dir_1de32c476debcefedf4aa8bb43bea551.html @@ -106,7 +106,7 @@ Files diff --git a/dir_3dd03323535933fb3f714c41ff7a94da.html b/dir_3dd03323535933fb3f714c41ff7a94da.html index 445a0e05..29b22213 100644 --- a/dir_3dd03323535933fb3f714c41ff7a94da.html +++ b/dir_3dd03323535933fb3f714c41ff7a94da.html @@ -94,7 +94,7 @@ Files diff --git a/dir_470c03f38356b1f63943514897cb198b.html b/dir_470c03f38356b1f63943514897cb198b.html index ceb57a1b..306acc77 100644 --- a/dir_470c03f38356b1f63943514897cb198b.html +++ b/dir_470c03f38356b1f63943514897cb198b.html @@ -94,7 +94,7 @@ Files diff --git a/dir_48f64e79f12bd77ba047e9e436ec978c.html b/dir_48f64e79f12bd77ba047e9e436ec978c.html index 8c06d032..4148b909 100644 --- a/dir_48f64e79f12bd77ba047e9e436ec978c.html +++ b/dir_48f64e79f12bd77ba047e9e436ec978c.html @@ -122,7 +122,7 @@ Files diff --git a/dir_5e87a7229a108582288ef7eda1233dc3.html b/dir_5e87a7229a108582288ef7eda1233dc3.html index a9eddba1..3652aee5 100644 --- a/dir_5e87a7229a108582288ef7eda1233dc3.html +++ b/dir_5e87a7229a108582288ef7eda1233dc3.html @@ -94,7 +94,7 @@ Files diff --git a/dir_6591a2127a29f6cea3994dcb5b0596d1.html b/dir_6591a2127a29f6cea3994dcb5b0596d1.html index 9531602d..bbda6af9 100644 --- a/dir_6591a2127a29f6cea3994dcb5b0596d1.html +++ b/dir_6591a2127a29f6cea3994dcb5b0596d1.html @@ -106,7 +106,7 @@ Files diff --git a/dir_7e6ab9b017486261fe80629d442521f0.html b/dir_7e6ab9b017486261fe80629d442521f0.html index c52be781..99e7461f 100644 --- a/dir_7e6ab9b017486261fe80629d442521f0.html +++ b/dir_7e6ab9b017486261fe80629d442521f0.html @@ -94,7 +94,7 @@ Files diff --git a/dir_9a34040863d1190c0e01b23e6b44de01.html b/dir_9a34040863d1190c0e01b23e6b44de01.html index ad87bcb5..c910ef3b 100644 --- a/dir_9a34040863d1190c0e01b23e6b44de01.html +++ b/dir_9a34040863d1190c0e01b23e6b44de01.html @@ -96,7 +96,7 @@ Files diff --git a/dir_bc0718b08fb2015b8e59c47b2805f60c.html b/dir_bc0718b08fb2015b8e59c47b2805f60c.html index 76388b54..864d8471 100644 --- a/dir_bc0718b08fb2015b8e59c47b2805f60c.html +++ b/dir_bc0718b08fb2015b8e59c47b2805f60c.html @@ -116,7 +116,7 @@ Directories diff --git a/dir_be059bf9978ae156837504b1b8a7568c.html b/dir_be059bf9978ae156837504b1b8a7568c.html index 68befb2c..1a107615 100644 --- a/dir_be059bf9978ae156837504b1b8a7568c.html +++ b/dir_be059bf9978ae156837504b1b8a7568c.html @@ -94,7 +94,7 @@ Files diff --git a/dir_e2ce51835550ba18edf07a8311722290.html b/dir_e2ce51835550ba18edf07a8311722290.html index e8fbde18..42264c3c 100644 --- a/dir_e2ce51835550ba18edf07a8311722290.html +++ b/dir_e2ce51835550ba18edf07a8311722290.html @@ -240,7 +240,7 @@ Files diff --git a/dir_f34881fcf60f680b800190d5274dfaea.html b/dir_f34881fcf60f680b800190d5274dfaea.html index 2c360204..2f568a1d 100644 --- a/dir_f34881fcf60f680b800190d5274dfaea.html +++ b/dir_f34881fcf60f680b800190d5274dfaea.html @@ -106,7 +106,7 @@ Files diff --git a/dir_f9b96888882c2691b8eeaeafd1b9501d.html b/dir_f9b96888882c2691b8eeaeafd1b9501d.html index c53cf1f6..71730376 100644 --- a/dir_f9b96888882c2691b8eeaeafd1b9501d.html +++ b/dir_f9b96888882c2691b8eeaeafd1b9501d.html @@ -102,7 +102,7 @@ Files diff --git a/dmd-demo_8dox.html b/dmd-demo_8dox.html index 20382827..bee8c4e6 100644 --- a/dmd-demo_8dox.html +++ b/dmd-demo_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/dmd-running-figure_8dox.html b/dmd-running-figure_8dox.html index a1f2c469..53f36ab6 100644 --- a/dmd-running-figure_8dox.html +++ b/dmd-running-figure_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/dmd_demo.html b/dmd_demo.html index 259d5989..67bb1edd 100644 --- a/dmd_demo.html +++ b/dmd_demo.html @@ -236,7 +236,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/dmd_running_figure.html b/dmd_running_figure.html index d46e68be..d1c246d5 100644 --- a/dmd_running_figure.html +++ b/dmd_running_figure.html @@ -430,7 +430,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/files.html b/files.html index 74b5333b..1852f736 100644 --- a/files.html +++ b/files.html @@ -231,7 +231,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions.html b/functions.html index 7b2e7daa..1b83d08e 100644 --- a/functions.html +++ b/functions.html @@ -193,7 +193,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_b.html b/functions_b.html index d1637e9d..95ac17b7 100644 --- a/functions_b.html +++ b/functions_b.html @@ -208,7 +208,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_c.html b/functions_c.html index 821d84e0..d506d1a9 100644 --- a/functions_c.html +++ b/functions_c.html @@ -186,7 +186,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , GHASH , Hash , KeccakCore -, NewHopePoly , OFBCommon , OMAC , Poly1305 @@ -210,7 +209,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , Terminal
  • color() -: Terminal +: Terminal
  • columns() : Terminal @@ -262,7 +261,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_d.html b/functions_d.html index b2d47ead..b6197209 100644 --- a/functions_d.html +++ b/functions_d.html @@ -300,7 +300,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_e.html b/functions_e.html index e73f0453..9168e124 100644 --- a/functions_e.html +++ b/functions_e.html @@ -219,7 +219,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_enum.html b/functions_enum.html index 4fead52d..511ae1ab 100644 --- a/functions_enum.html +++ b/functions_enum.html @@ -114,7 +114,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_eval.html b/functions_eval.html index 84c74460..3bb44817 100644 --- a/functions_eval.html +++ b/functions_eval.html @@ -168,7 +168,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_f.html b/functions_f.html index 6ee953b5..d64b4015 100644 --- a/functions_f.html +++ b/functions_f.html @@ -187,7 +187,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func.html b/functions_func.html index 5dcb6ab6..adfd4863 100644 --- a/functions_func.html +++ b/functions_func.html @@ -186,7 +186,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_b.html b/functions_func_b.html index 41366fec..b9bf3701 100644 --- a/functions_func_b.html +++ b/functions_func_b.html @@ -194,7 +194,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_c.html b/functions_func_c.html index 6efe435a..43fc1d10 100644 --- a/functions_func_c.html +++ b/functions_func_c.html @@ -185,7 +185,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , GHASH , Hash , KeccakCore -, NewHopePoly , OFBCommon , OMAC , Poly1305 @@ -254,7 +253,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_d.html b/functions_func_d.html index e88424ff..0981a161 100644 --- a/functions_func_d.html +++ b/functions_func_d.html @@ -262,7 +262,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_e.html b/functions_func_e.html index 01624353..b509bdbd 100644 --- a/functions_func_e.html +++ b/functions_func_e.html @@ -218,7 +218,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_f.html b/functions_func_f.html index b5b5761a..94ff46b8 100644 --- a/functions_func_f.html +++ b/functions_func_f.html @@ -180,7 +180,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_g.html b/functions_func_g.html index 1ead187d..af2417c0 100644 --- a/functions_func_g.html +++ b/functions_func_g.html @@ -144,7 +144,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_h.html b/functions_func_h.html index 21b7972a..3e817ab0 100644 --- a/functions_func_h.html +++ b/functions_func_h.html @@ -161,7 +161,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_i.html b/functions_func_i.html index e0c73cd9..9e747128 100644 --- a/functions_func_i.html +++ b/functions_func_i.html @@ -202,7 +202,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_k.html b/functions_func_k.html index 4035c2a1..e0f74345 100644 --- a/functions_func_k.html +++ b/functions_func_k.html @@ -128,7 +128,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : KeccakCore
  • keygen() -: NewHope +: NewHope
  • keySize() : AES128 @@ -153,7 +153,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_l.html b/functions_func_l.html index c51c15b4..3b593040 100644 --- a/functions_func_l.html +++ b/functions_func_l.html @@ -157,7 +157,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_m.html b/functions_func_m.html index cf0cbf74..a5ed966d 100644 --- a/functions_func_m.html +++ b/functions_func_m.html @@ -160,7 +160,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_n.html b/functions_func_n.html index 4e81438c..1e578f4f 100644 --- a/functions_func_n.html +++ b/functions_func_n.html @@ -124,9 +124,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');  

    - n -

      -
    • NewHopePoly() -: NewHopePoly -
    • nextField() : Form
    • @@ -146,7 +143,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_o.html b/functions_func_o.html index d51cb58f..f2f778e1 100644 --- a/functions_func_o.html +++ b/functions_func_o.html @@ -149,7 +149,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_p.html b/functions_func_p.html index 05379c0f..cefbd2bc 100644 --- a/functions_func_p.html +++ b/functions_func_p.html @@ -179,7 +179,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_r.html b/functions_func_r.html index 7a053c8e..89752f23 100644 --- a/functions_func_r.html +++ b/functions_func_r.html @@ -228,7 +228,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_s.html b/functions_func_s.html index 1632a480..96353537 100644 --- a/functions_func_s.html +++ b/functions_func_s.html @@ -337,7 +337,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : SHAKE256
    • shareda() -: NewHope +: NewHope
    • sharedb() : NewHope @@ -427,7 +427,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_t.html b/functions_func_t.html index dc70561a..48f58726 100644 --- a/functions_func_t.html +++ b/functions_func_t.html @@ -161,7 +161,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_u.html b/functions_func_u.html index bb4c67b5..6323fb3f 100644 --- a/functions_func_u.html +++ b/functions_func_u.html @@ -167,7 +167,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_v.html b/functions_func_v.html index f960932a..4d18e9ed 100644 --- a/functions_func_v.html +++ b/functions_func_v.html @@ -139,7 +139,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_w.html b/functions_func_w.html index 4e64d989..ce8ee67d 100644 --- a/functions_func_w.html +++ b/functions_func_w.html @@ -166,7 +166,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_x.html b/functions_func_x.html index 33edc65c..d7890a49 100644 --- a/functions_func_x.html +++ b/functions_func_x.html @@ -143,7 +143,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_func_~.html b/functions_func_~.html index ffa4bf1d..bbf66b87 100644 --- a/functions_func_~.html +++ b/functions_func_~.html @@ -181,9 +181,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    • ~LoginShell() : LoginShell
    • -
    • ~NewHopePoly() -: NewHopePoly -
    • ~NoiseSource() : NoiseSource
    • @@ -245,7 +242,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_g.html b/functions_g.html index 67f1e765..3658c9af 100644 --- a/functions_g.html +++ b/functions_g.html @@ -148,7 +148,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_h.html b/functions_h.html index 129abaa7..6daaec61 100644 --- a/functions_h.html +++ b/functions_h.html @@ -166,7 +166,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_i.html b/functions_i.html index dacd890e..5b850151 100644 --- a/functions_i.html +++ b/functions_i.html @@ -206,7 +206,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_k.html b/functions_k.html index f227298c..8498b8e7 100644 --- a/functions_k.html +++ b/functions_k.html @@ -129,7 +129,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : KeccakCore
    • keygen() -: NewHope +: NewHope
    • keySize() : AES128 @@ -154,7 +154,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_l.html b/functions_l.html index f7052cac..a4fcf214 100644 --- a/functions_l.html +++ b/functions_l.html @@ -161,7 +161,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_m.html b/functions_m.html index 09399b7c..d079c298 100644 --- a/functions_m.html +++ b/functions_m.html @@ -174,7 +174,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_n.html b/functions_n.html index 01859918..5b7f85be 100644 --- a/functions_n.html +++ b/functions_n.html @@ -125,9 +125,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
      Here is a list of all documented class members with links to the class documentation for each member:

      - n -

        -
      • NewHopePoly() -: NewHopePoly -
      • nextField() : Form
      • @@ -153,7 +150,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_o.html b/functions_o.html index 36de4718..be817c78 100644 --- a/functions_o.html +++ b/functions_o.html @@ -150,7 +150,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_p.html b/functions_p.html index 1f1765e6..2b4366dc 100644 --- a/functions_p.html +++ b/functions_p.html @@ -183,7 +183,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_r.html b/functions_r.html index 72bf2c7d..f7fb5ebe 100644 --- a/functions_r.html +++ b/functions_r.html @@ -235,7 +235,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_rela.html b/functions_rela.html index 422282d0..6df85f18 100644 --- a/functions_rela.html +++ b/functions_rela.html @@ -102,7 +102,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_s.html b/functions_s.html index 41d6b961..a09a6418 100644 --- a/functions_s.html +++ b/functions_s.html @@ -351,7 +351,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : SHAKE256
      • shareda() -: NewHope +: NewHope
      • sharedb() : NewHope @@ -444,7 +444,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_t.html b/functions_t.html index c21aee36..4eb695a3 100644 --- a/functions_t.html +++ b/functions_t.html @@ -168,7 +168,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_type.html b/functions_type.html index 51a45af4..e075d2fd 100644 --- a/functions_type.html +++ b/functions_type.html @@ -108,7 +108,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_u.html b/functions_u.html index 76c5ed8f..8bdcddd2 100644 --- a/functions_u.html +++ b/functions_u.html @@ -168,7 +168,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_v.html b/functions_v.html index 10923f1c..4895b6a7 100644 --- a/functions_v.html +++ b/functions_v.html @@ -143,7 +143,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_vars.html b/functions_vars.html index 483223a9..6e3a5faa 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -157,7 +157,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_w.html b/functions_w.html index 10bfd69c..562c7008 100644 --- a/functions_w.html +++ b/functions_w.html @@ -174,7 +174,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_x.html b/functions_x.html index 58036699..6c11eb31 100644 --- a/functions_x.html +++ b/functions_x.html @@ -144,7 +144,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_y.html b/functions_y.html index dda017fa..3bdaefde 100644 --- a/functions_y.html +++ b/functions_y.html @@ -135,7 +135,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/functions_~.html b/functions_~.html index b8d6d0d8..c3e594b5 100644 --- a/functions_~.html +++ b/functions_~.html @@ -182,9 +182,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
      • ~LoginShell() : LoginShell
      • -
      • ~NewHopePoly() -: NewHopePoly -
      • ~NoiseSource() : NoiseSource
      • @@ -246,7 +243,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/group__power__save.html b/group__power__save.html index 187cff9c..b3dd18ab 100644 --- a/group__power__save.html +++ b/group__power__save.html @@ -201,7 +201,7 @@ void  diff --git a/hierarchy.html b/hierarchy.html index db16f4cd..232e22f3 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -146,7 +146,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); |\CLCDEnhanced library for Freetronics 16x2 LCD shields oCMelodyPlays a melody on a digital output pin using tone() oCNewHopeNewHope post-quantum key exchange algorithm -oCNewHopePolyNewHope polynomial representation +oCNewHopePrivateKeyNewHope private key representation oCNoiseSourceAbstract base class for random noise sources |oCRingOscillatorNoiseSourceProcesses the signal from a ring oscillator based noise source |\CTransistorNoiseSourceProcesses the signal from a transistor-based noise source @@ -179,7 +179,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/index.html b/index.html index feb54ab6..ec1bc237 100644 --- a/index.html +++ b/index.html @@ -165,7 +165,7 @@ Other diff --git a/ir-dumpir_8dox.html b/ir-dumpir_8dox.html index e153264f..5ab07b8f 100644 --- a/ir-dumpir_8dox.html +++ b/ir-dumpir_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ir-snake_8dox.html b/ir-snake_8dox.html index 73c5402c..7157aca8 100644 --- a/ir-snake_8dox.html +++ b/ir-snake_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ir_dumpir.html b/ir_dumpir.html index c37f54c3..bc850256 100644 --- a/ir_dumpir.html +++ b/ir_dumpir.html @@ -283,7 +283,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ir_snake.html b/ir_snake.html index ee7cb23e..73743ff3 100644 --- a/ir_snake.html +++ b/ir_snake.html @@ -273,7 +273,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/lcd-form_8dox.html b/lcd-form_8dox.html index cb8af479..2c82e353 100644 --- a/lcd-form_8dox.html +++ b/lcd-form_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/lcd-helloworld_8dox.html b/lcd-helloworld_8dox.html index 18a33943..21155eac 100644 --- a/lcd-helloworld_8dox.html +++ b/lcd-helloworld_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/lcd_form.html b/lcd_form.html index b99ce9d1..464b8692 100644 --- a/lcd_form.html +++ b/lcd_form.html @@ -216,7 +216,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/lcd_hello_world.html b/lcd_hello_world.html index a426f65e..9b73738c 100644 --- a/lcd_hello_world.html +++ b/lcd_hello_world.html @@ -166,7 +166,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/mainpage_8dox.html b/mainpage_8dox.html index f8977937..72976aea 100644 --- a/mainpage_8dox.html +++ b/mainpage_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/modules.html b/modules.html index 4689b777..960a6656 100644 --- a/modules.html +++ b/modules.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/newhope-small_8dox.html b/newhope-small_8dox.html new file mode 100644 index 00000000..b30744b6 --- /dev/null +++ b/newhope-small_8dox.html @@ -0,0 +1,95 @@ + + + + + + +ArduinoLibs: newhope-small.dox File Reference + + + + + + + + + +
        +
        + + + + + + +
        +
        ArduinoLibs +
        +
        +
        + + + + + + + + + +
        + +
        + +
        +
        +
        +
        newhope-small.dox File Reference
        +
        +
        +
        + + + + diff --git a/newhope_small.html b/newhope_small.html new file mode 100644 index 00000000..125b9740 --- /dev/null +++ b/newhope_small.html @@ -0,0 +1,258 @@ + + + + + + +ArduinoLibs: Small Memory Footprint New Hope + + + + + + + + + +
        +
        + + + + + + +
        +
        ArduinoLibs +
        +
        +
        + + + + + + + + +
        + +
        + +
        +
        +
        +
        Small Memory Footprint New Hope
        +
        +
        +

        This page describes the techniques that were used to reduce the post-quantum New Hope key exchange algorithm in size for running on Arduino systems with limited amounts of RAM. It is intended to help other implementors of New Hope save time in figuring out how to reduce the memory size of the algorithm.

        +

        On systems like AVR and x86 that allow byte-aligned access to 16-bit values, this implementation requires around 2K of memory for the function parameters and up to 4.5K of temporary stack space for intermediate values. On systems like ARM, the sizes are similar but the sharedb() function requires another 2K of temporary stack space if the input parameters are not aligned on a 16-bit boundary.

        +

        +keygen()

        +

        In pseudo-code, the keygen() function from the reference C implementation of New Hope from the algorithm authors performs the following operations (the size in bytes of all parameters and local variables are indicated):

        +
        keygen(send[1824], sk[2048]):
        +
        locals: seed[32], noiseseed[32], a[2048], e[2048], r[2048], pk[2048]
        +
        seed = sha3(randombytes(32))
        +
        noiseseed = randombytes(32)
        +
        a = uniform(seed)
        +
        sk = ntt(getnoise(noiseseed, 0))
        +
        e = ntt(getnoise(noiseseed, 1))
        +
        r = pointwise(sk, a)
        +
        pk = e + r
        +
        send = encode_a(pk, seed)
        +

        This requires a total of 3872 bytes of parameter space and 8256 bytes of stack space. There is also additional stack space for temporary SHA3, SHAKE128, and ChaCha20 objects and output buffers. Those objects can easily account for another 400 to 500 bytes of stack space.

        +

        We note that some of the local variables in the pseudo-code above are only live in some parts of function. For example, pk is not touched until the second-last statement and by that time sk and a are no longer required. We can rearrange the function to reuse local variables that are no longer live as follows:

        +
        keygen(send[1824], sk[2048]):
        +
        locals: seed[32], noiseseed[32], a[2048], pk[2048]
        +
        seed = sha3(randombytes(32))
        +
        noiseseed = randombytes(32)
        +
        a = uniform(seed)
        +
        sk = ntt(getnoise(noiseseed, 0))
        +
        pk = pointwise(sk, a)
        +
        a = ntt(getnoise(noiseseed, 1))
        +
        pk = a + pk
        +
        send = encode_a(pk, seed)
        +

        This saves 4096 bytes of stack space. It is possible to save the 64 bytes for seed and noiseseed by directly writing them to the send buffer:

        +
        keygen(send[1824], sk[2048]):
        +
        locals: a[2048], pk[2048]
        +
        send(1792:1823) = sha3(randombytes(32))
        +
        send(0:31) = randombytes(32)
        +
        a = uniform(send(1792:1823))
        +
        sk = ntt(getnoise(send(0:31), 0))
        +
        pk = pointwise(sk, a)
        +
        a = ntt(getnoise(send(0:31), 1))
        +
        pk = a + pk
        +
        send(0:1791) = tobytes(pk)
        +

        Packing temporary values into the caller-supplied parameters is a common feature of the optimizations described on this page. Since the caller has already supplied a big chunk of free memory to the function, it would be a shame not to make use of it.

        +

        The Arduino implementation also packs the temporary SHA3, SHAKE128, and ChaCha20 objects into the send buffer and unused local variables at different points in the function. This considerably reduces the stack footprint of sub-functions like uniform(), getnoise(), and helprec().

        +

        At this point we are using 3872 of parameter space and 4096 bytes of stack space. We can reduce the parameter space even further by noticing that the sk value is wholely determined by the 32-byte noiseseed value. The shareda() function could regenerate sk itself from the 32-byte noiseseed, trading off time for memory:

        +
        keygen(send[1824], noiseseed[32]):
        +
        locals: a[2048], pk[2048]
        +
        send(1792:1823) = sha3(randombytes(32))
        +
        noiseseed = randombytes(32)
        +
        a = uniform(send(1792:1823))
        +
        pk = ntt(getnoise(noiseseed, 0))
        +
        pk = pointwise(pk, a)
        +
        a = ntt(getnoise(noiseseed, 1))
        +
        pk = a + pk
        +
        send(0:1791) = tobytes(pk)
        +

        Now we have 1856 bytes of parameter space and 4096 bytes of stack space. Plus a few hundred bytes of stack frame overhead for sub-functions (the Arduino version of SHA3/SHAKE128 requires 200 bytes of stack space for temporary values - other sub-functions are similar). The Arduino version of New Hope uses up to 400 bytes of stack space overhead in the worst case.

        +

        The uniform() function has two variants for the "ref" and "torref" versions of the New Hope algorithm. The "torref" variant requires 2688 bytes to represent the a value before sorting reduces it to 2048 bytes. This isn't actually a problem because we can lay out the stack space with a union:

        +
        struct {
        +
        union {
        +
        uint16_t a[PARAM_N];
        +
        uint16_t pk[PARAM_N];
        +
        };
        +
        uint16_t a_ext[84 * 16];
        +
        } state;
        +

        The uniform data derived from the seed is generated into a_ext, sorted, and then the trailing 640 bytes of a_ext are discarded. The trailing space is then used to store pk later in the function.

        +

        +shareda()

        +

        Before tackling the more difficult sharedb(), we will move onto the final New Hope step for generating the shared secret for Alice. In pseudo-code, the original reference C implementation is as follows:

        +
        shareda(shared[32], sk[2048], received[2048]):
        +
        locals: v[2048], bp[2048], c[2048]
        +
        (bp, c) = decode_b(received)
        +
        v = invntt(pointwise(sk, bp))
        +
        shared = sha3(rec(v, c))
        +

        We can eliminate c by splitting the decode_b() step:

        +
        shareda(shared[32], sk[2048], received[2048]):
        +
        locals: v[2048], bp[2048]
        +
        bp = decode_b_1st_half(received(0:1791))
        +
        v = invntt(pointwise(sk, bp))
        +
        bp = decode_b_2nd_half(received(1792:2047))
        +
        shared = sha3(rec(v, bp))
        +

        We now have 4128 bytes of parameter space and 4096 bytes of stack space. The shared buffer can overlap with either sk or received in the caller to save another 32 bytes of parameter space.

        +

        Earlier we replaced sk with the 32-byte noiseseed. We can regenerate sk within shareda() as follows:

        +
        shareda(shared[32], noiseseed[32], received[2048]):
        +
        locals: v[2048], bp[2048]
        +
        v = ntt(getnoise(noiseseed, 0))
        +
        bp = decode_b_1st_half(received(0:1791))
        +
        v = invntt(pointwise(v, bp))
        +
        bp = decode_b_2nd_half(received(1792:2047))
        +
        shared = sha3(rec(v, bp))
        +

        This results in 2112 bytes of parameter space (2080 if shared overlaps with noiseseed or received) and 4096 bytes of direct stack space. Plus up to 400 bytes of stack overhead for sub-functions as before.

        +

        +sharedb()

        +

        As before we start with the pseudo-code for the reference C implementation of sharedb():

        +
        sharedb(shared[32], send[2048], received[1824]):
        +
        locals: sp[2048], ep[2048], v[2048], a[2048], pka[2048],
        +
        c[2048], epp[2048], bp[2048], seed[32], noiseseed[32]
        +
        noiseseed = randombytes(32)
        +
        (pka, seed) = decode_a(received)
        +
        a = uniform(seed)
        +
        sp = ntt(getnoise(noiseseed, 0))
        +
        ep = ntt(getnoise(noiseseed, 1))
        +
        bp = pointwise(a, sp)
        +
        bp = bp + ep
        +
        v = invntt(pointwise(pka, sp))
        +
        epp = getnoise(noiseseed, 2))
        +
        v = v + epp
        +
        c = helprec(v, noiseseed, 3)
        +
        send = encode_b(bp, c)
        +
        shared = sha3(rec(v, c))
        +

        This requires a massive 3904 bytes of parameter space and 16448 bytes of stack space! We start by doing liveness analysis on the local variables and hiding seed and noiseseed inside parameters:

        +
        sharedb(shared[32], send[2048], received[1824]):
        +
        locals: a[2048], v[2048], bp[2048]
        +
        send(1824:1855) = randombytes(32)
        +
        a = uniform(received(1792:1823))
        +
        v = ntt(getnoise(send(1824:1855), 0))
        +
        bp = pointwise(a, v)
        +
        a = ntt(getnoise(send(1824:1855), 1))
        +
        bp = bp + a
        +
        a = frombytes(received(0:1791))
        +
        v = invntt(pointwise(a, v))
        +
        a = getnoise(send(1824:1855), 2)
        +
        v = v + a
        +
        a = helprec(v, send(1824:1855), 3)
        +
        send = encode_b(bp, a)
        +
        shared = sha3(rec(v, a))
        +

        Now we are down to 3904 bytes of parameter space and 6144 bytes of stack space. We can save 1824 bytes of parameter space by combining the send and received buffers into one 2048 buffer. On entry, this combined buffer contains Alice's public key and on exit it contains Bob's public key. Now it is 2080 bytes of parameter space.

        +

        Note above that noiseseed was placed into bytes 1824-1855 of send. This was to ensure that it did not overwrite the received value if the buffers were shared.

        +

        This is the best we can do on systems that require that 16-bit values are aligned on 16-bit address boundaries. If however we are operating on an 8-bit system like the AVR, we can do even better. The send buffer is the same size as bp: 2048 bytes. As long as we are careful to move the incoming values in received out of the way before-hand, we can use the send buffer as a temporary poly object:

        +
        sharedb(shared[32], send[2048], received[1824]):
        +
        locals: a[2048], v[2048], seed[32], noiseseed[32]
        +
        noiseseed = randombytes(32)
        +
        (a, seed) = decode_a(received)
        +
        send = ntt(getnoise(noiseseed, 0))
        +
        v = invntt(pointwise(a, send))
        +
        send = getnoise(noiseseed, 2)
        +
        v = v + send
        +
        a = helprec(v, noiseseed, 3)
        +
        send(1792:2047) = encode_b_2nd_half(a)
        +
        shared = sha3(rec(v, a))
        +
        a = uniform(seed)
        +
        v = ntt(getnoise(noiseseed, 0))
        +
        a = pointwise(a, v)
        +
        v = ntt(getnoise(noiseseed, 1))
        +
        a = a + v
        +
        send(0:1791) = encode_b_1st_half(a)
        +

        This requires 3904 bytes of parameter space and 4160 bytes of stack space. The parameter space can be further reduced to 2080 bytes if send and received occupy the same buffer. Plus up to 400 bytes of stack overhead for sub-functions as before.

        +

        Note that "ntt(getnoise(noiseseed, 0))" is evaluated twice. This frees up a local variable earlier in the function, at the cost of some speed.

        +

        +Summary

        +

        In summary, the three primitives of New Hope require the following amounts of memory on systems with byte alignment and buffer sharing:

        + + + + + + + + + +
        PrimitiveParameter SpaceDirect Stack SpaceStack with Overhead (400 bytes)Parameters + Stack + Overhead
        keygen()1856409644966352
        sharedb()2080416045606640
        shareda()2080409644966576
        +

        On 16-bit, 32-bit, or 64-bit systems that lack byte alignment, with a full 2048-byte public key for Alice, and no buffer sharing, the maximum memory requirements are:

        + + + + + + + + + +
        PrimitiveParameter SpaceDirect Stack SpaceStack with Overhead (400 bytes)Parameters + Stack + Overhead
        keygen()3872409644968368
        sharedb()39046144654410448
        shareda()4128409644968624
        +

        All operations can be performed in around 6.5K of memory on an 8-bit AVR Arduino system, and with at most 10.2K of memory on a 32-bit ARM Arduino system.

        +
        + + + + diff --git a/pages.html b/pages.html index 902e86ed..946b1e78 100644 --- a/pages.html +++ b/pages.html @@ -95,14 +95,15 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); oSnake Video Game Using an Infrared Remote Control oForm example for LCD displays oHello World for Freetronics LCD -oSerial port Shell example -\Telnet server example +oSmall Memory Footprint New Hope +oSerial port Shell example +\Telnet server example diff --git a/search/all_10.js b/search/all_10.js index fa2fe0ca..2c85e2ef 100644 --- a/search/all_10.js +++ b/search/all_10.js @@ -2,6 +2,7 @@ var searchData= [ ['star_20trek_20example',['Star Trek Example',['../blink_startrek.html',1,'']]], ['snake_20video_20game_20using_20an_20infrared_20remote_20control',['Snake Video Game Using an Infrared Remote Control',['../ir_snake.html',1,'']]], + ['small_20memory_20footprint_20new_20hope',['Small Memory Footprint New Hope',['../newhope_small.html',1,'']]], ['save',['save',['../classRNGClass.html#a139584fb249148e2058d1d645d090db7',1,'RNGClass']]], ['screensavermode',['ScreenSaverMode',['../classLCD.html#a264bf94308c95d8598426e13dc8cdb28',1,'LCD::ScreenSaverMode()'],['../classLCD.html#a1917fa285f81f476b4c7cc20d15456b8',1,'LCD::screenSaverMode() const ']]], ['scroll',['scroll',['../classBitmap.html#ae08eb6f9086f9923d8dc83a469ae4c4a',1,'Bitmap::scroll(int dx, int dy, Color fillColor=Black)'],['../classBitmap.html#af79ad4432297ff453fddc55625fec485',1,'Bitmap::scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)']]], @@ -64,7 +65,7 @@ var searchData= ['shake',['SHAKE',['../classSHAKE.html',1,'SHAKE'],['../classSHAKE.html#a9346e4d53a9d7d686911ab772fc23387',1,'SHAKE::SHAKE()']]], ['shake128',['SHAKE128',['../classSHAKE128.html',1,'SHAKE128'],['../classSHAKE128.html#a7d9d435780157e944eea931b3a13df0d',1,'SHAKE128::SHAKE128()']]], ['shake256',['SHAKE256',['../classSHAKE256.html',1,'SHAKE256'],['../classSHAKE256.html#abbc01bc6798da9479e2da105f6661c22',1,'SHAKE256::SHAKE256()']]], - ['shareda',['shareda',['../classNewHope.html#ae490ebcfcbc18179b03c1a1ae8874458',1,'NewHope']]], + ['shareda',['shareda',['../classNewHope.html#ac8128e0799fe74a6c69c541e0d6bd66e',1,'NewHope']]], ['sharedb',['sharedb',['../classNewHope.html#a2f09529f5f73cf9763c28b58b13bbd14',1,'NewHope']]], ['shell',['Shell',['../classShell.html',1,'Shell'],['../classShell.html#ad613444a902075e8fd26b1f51c4d3b63',1,'Shell::Shell()']]], ['shell_2dserial_2edox',['shell-serial.dox',['../shell-serial_8dox.html',1,'']]], diff --git a/search/all_17.js b/search/all_17.js index a3323192..daef7e68 100644 --- a/search/all_17.js +++ b/search/all_17.js @@ -19,7 +19,6 @@ var searchData= ['_7ehash',['~Hash',['../classHash.html#a4e4b4797dda8678aaed058bae155813e',1,'Hash']]], ['_7ekeccakcore',['~KeccakCore',['../classKeccakCore.html#a4579e3a9b24f1d615fa8d660c23e77a4',1,'KeccakCore']]], ['_7eloginshell',['~LoginShell',['../classLoginShell.html#aaae466b141c9ea50870b66509402a2f9',1,'LoginShell']]], - ['_7enewhopepoly',['~NewHopePoly',['../classNewHopePoly.html#ad7c3c83cb078be4e6f136eeea7e21250',1,'NewHopePoly']]], ['_7enoisesource',['~NoiseSource',['../classNoiseSource.html#a4eca1e894a5d719fb9bf4df34a791cdb',1,'NoiseSource']]], ['_7eofbcommon',['~OFBCommon',['../classOFBCommon.html#aae7435157e51bf977d3481e94e17ae01',1,'OFBCommon']]], ['_7eomac',['~OMAC',['../classOMAC.html#a6bb2222c997608ec68b25831da965e8f',1,'OMAC']]], diff --git a/search/all_2.js b/search/all_2.js index 8021347b..ee043e76 100644 --- a/search/all_2.js +++ b/search/all_2.js @@ -15,7 +15,7 @@ var searchData= ['chaseleds',['ChaseLEDs',['../classChaseLEDs.html',1,'ChaseLEDs'],['../classChaseLEDs.html#ab6bb3da371d3730a6552e93a9b2eab78',1,'ChaseLEDs::ChaseLEDs()']]], ['checktag',['checkTag',['../classAuthenticatedCipher.html#a4bb33d194e2c7d30c4e5a713e59786ff',1,'AuthenticatedCipher::checkTag()'],['../classChaChaPoly.html#aeffb3e0df0b4da03f72f30251243d953',1,'ChaChaPoly::checkTag()'],['../classEAXCommon.html#a72c403f52cefab57566bc5f634c1b963',1,'EAXCommon::checkTag()'],['../classGCMCommon.html#a70229be2fe2274c4109fe7511481075a',1,'GCMCommon::checkTag()']]], ['cipher',['Cipher',['../classCipher.html',1,'Cipher'],['../classCipher.html#a6a61077eca3ccd5900f92ceac58fb09c',1,'Cipher::Cipher()']]], - ['clear',['clear',['../classBitmap.html#a839dc8fab05a5ebf7a6b2e61436b2fa1',1,'Bitmap::clear()'],['../classAESCommon.html#a83e43f7d07e31d90fd7b768a93ecfce6',1,'AESCommon::clear()'],['../classBLAKE2b.html#a21623759bd381285ebf7e75a00c9c8a9',1,'BLAKE2b::clear()'],['../classBLAKE2s.html#a0848885f52df51dc53949d32a206e72d',1,'BLAKE2s::clear()'],['../classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b',1,'BlockCipher::clear()'],['../classCBCCommon.html#a7befadfe7384e0e857a96a59bf3845e9',1,'CBCCommon::clear()'],['../classCFBCommon.html#a847d320b0fe7f329385f26511b42c40d',1,'CFBCommon::clear()'],['../classChaCha.html#af533905f679066c41f4d6cd76bddb4cb',1,'ChaCha::clear()'],['../classChaChaPoly.html#a2d7fc3fd05a0b6c7c9c21fff6e939c9a',1,'ChaChaPoly::clear()'],['../classCipher.html#a4b7c3965646441a70d9ab934a7c92ab1',1,'Cipher::clear()'],['../classCTRCommon.html#ac0d6381c02fe2a8a017ad66d006a6ef2',1,'CTRCommon::clear()'],['../classEAXCommon.html#afa88b0f589e09103e9c69ace081db0af',1,'EAXCommon::clear()'],['../classGCMCommon.html#a06868ebd67a571aa68d88d5d072cece9',1,'GCMCommon::clear()'],['../classGHASH.html#a4b1ee789debf56f7f24807960ef0556e',1,'GHASH::clear()'],['../classHash.html#a4a959469433cd9348ab7f3ac6228bb34',1,'Hash::clear()'],['../classKeccakCore.html#aeff1df56e4a3103c99c1fe4307e60c66',1,'KeccakCore::clear()'],['../classOFBCommon.html#a55bf2396beb91c457bfc4c20ef5c8123',1,'OFBCommon::clear()'],['../classOMAC.html#a072715dbda39dc9c360cfcaab31d6aa7',1,'OMAC::clear()'],['../classPoly1305.html#ae3f3392b9a2bd0f3472e7e50dd7e21dd',1,'Poly1305::clear()'],['../classSHA256.html#add0d1649d533b27005ccd8508398c689',1,'SHA256::clear()'],['../classSHA3__256.html#a531467f995ef6fc901ad8c2b5776a8d1',1,'SHA3_256::clear()'],['../classSHA3__512.html#acfbc5e9b4d394f011d5132a2b156d260',1,'SHA3_512::clear()'],['../classSHA512.html#a0a9104dce5f099aeba216e5fbcb1ee1a',1,'SHA512::clear()'],['../classSHAKE.html#ab86f52425c1d5b0e5c924b4f96121fe0',1,'SHAKE::clear()'],['../classSpeck.html#aa3866273282addabb9d3703c41fdc95f',1,'Speck::clear()'],['../classSpeckSmall.html#aa93d9f0b5153425dc04e8fb8faff7513',1,'SpeckSmall::clear()'],['../classSpeckTiny.html#a303ecc2639459e47c6eeb21991d52ccf',1,'SpeckTiny::clear()'],['../classXOF.html#ac34cb22f251642b58b3dd78a6480aff3',1,'XOF::clear()'],['../classXTSCommon.html#a96e3cb4a3d35dc4e3a5acbae19b4465b',1,'XTSCommon::clear()'],['../classNewHopePoly.html#a842db1796a45ba78f279e008210df304',1,'NewHopePoly::clear()'],['../classTerminal.html#a4be741767b27739eec98901477e1c3d4',1,'Terminal::clear()']]], + ['clear',['clear',['../classBitmap.html#a839dc8fab05a5ebf7a6b2e61436b2fa1',1,'Bitmap::clear()'],['../classAESCommon.html#a83e43f7d07e31d90fd7b768a93ecfce6',1,'AESCommon::clear()'],['../classBLAKE2b.html#a21623759bd381285ebf7e75a00c9c8a9',1,'BLAKE2b::clear()'],['../classBLAKE2s.html#a0848885f52df51dc53949d32a206e72d',1,'BLAKE2s::clear()'],['../classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b',1,'BlockCipher::clear()'],['../classCBCCommon.html#a7befadfe7384e0e857a96a59bf3845e9',1,'CBCCommon::clear()'],['../classCFBCommon.html#a847d320b0fe7f329385f26511b42c40d',1,'CFBCommon::clear()'],['../classChaCha.html#af533905f679066c41f4d6cd76bddb4cb',1,'ChaCha::clear()'],['../classChaChaPoly.html#a2d7fc3fd05a0b6c7c9c21fff6e939c9a',1,'ChaChaPoly::clear()'],['../classCipher.html#a4b7c3965646441a70d9ab934a7c92ab1',1,'Cipher::clear()'],['../classCTRCommon.html#ac0d6381c02fe2a8a017ad66d006a6ef2',1,'CTRCommon::clear()'],['../classEAXCommon.html#afa88b0f589e09103e9c69ace081db0af',1,'EAXCommon::clear()'],['../classGCMCommon.html#a06868ebd67a571aa68d88d5d072cece9',1,'GCMCommon::clear()'],['../classGHASH.html#a4b1ee789debf56f7f24807960ef0556e',1,'GHASH::clear()'],['../classHash.html#a4a959469433cd9348ab7f3ac6228bb34',1,'Hash::clear()'],['../classKeccakCore.html#aeff1df56e4a3103c99c1fe4307e60c66',1,'KeccakCore::clear()'],['../classOFBCommon.html#a55bf2396beb91c457bfc4c20ef5c8123',1,'OFBCommon::clear()'],['../classOMAC.html#a072715dbda39dc9c360cfcaab31d6aa7',1,'OMAC::clear()'],['../classPoly1305.html#ae3f3392b9a2bd0f3472e7e50dd7e21dd',1,'Poly1305::clear()'],['../classSHA256.html#add0d1649d533b27005ccd8508398c689',1,'SHA256::clear()'],['../classSHA3__256.html#a531467f995ef6fc901ad8c2b5776a8d1',1,'SHA3_256::clear()'],['../classSHA3__512.html#acfbc5e9b4d394f011d5132a2b156d260',1,'SHA3_512::clear()'],['../classSHA512.html#a0a9104dce5f099aeba216e5fbcb1ee1a',1,'SHA512::clear()'],['../classSHAKE.html#ab86f52425c1d5b0e5c924b4f96121fe0',1,'SHAKE::clear()'],['../classSpeck.html#aa3866273282addabb9d3703c41fdc95f',1,'Speck::clear()'],['../classSpeckSmall.html#aa93d9f0b5153425dc04e8fb8faff7513',1,'SpeckSmall::clear()'],['../classSpeckTiny.html#a303ecc2639459e47c6eeb21991d52ccf',1,'SpeckTiny::clear()'],['../classXOF.html#ac34cb22f251642b58b3dd78a6480aff3',1,'XOF::clear()'],['../classXTSCommon.html#a96e3cb4a3d35dc4e3a5acbae19b4465b',1,'XTSCommon::clear()'],['../classTerminal.html#a4be741767b27739eec98901477e1c3d4',1,'Terminal::clear()']]], ['cleartoeol',['clearToEOL',['../classTerminal.html#aeb93d71925cdfb17065e7f1ef2e83414',1,'Terminal']]], ['color',['Color',['../classTerminal.html#a7a03a2e94316da7b2144dad5ba95ac20',1,'Terminal::Color()'],['../classBitmap.html#a88d386944a7017aa776a177b10d8b2ba',1,'Bitmap::Color()'],['../classTerminal.html#ad1fc2be31d49124a1d32e8afddaa57b8',1,'Terminal::color(Color fg)'],['../classTerminal.html#ae22436e478a854e8b559fe73182bc329',1,'Terminal::color(Color fg, Color bg)']]], ['columns',['columns',['../classTerminal.html#aed25b5a884f89dcd2bb269a8e356e5d6',1,'Terminal']]], diff --git a/search/all_9.js b/search/all_9.js index eff2d137..b693d5ac 100644 --- a/search/all_9.js +++ b/search/all_9.js @@ -1,6 +1,6 @@ var searchData= [ ['keccakcore',['KeccakCore',['../classKeccakCore.html',1,'KeccakCore'],['../classKeccakCore.html#a850c8e85bdb6b347411239716535d9c9',1,'KeccakCore::KeccakCore()']]], - ['keygen',['keygen',['../classNewHope.html#ae8f821867bce309220aee7a43c2d4f51',1,'NewHope']]], + ['keygen',['keygen',['../classNewHope.html#a335b17b40949f66aa579d1035384662c',1,'NewHope']]], ['keysize',['keySize',['../classAES128.html#aa871832a156f0ea61b964e489670ae9d',1,'AES128::keySize()'],['../classAES192.html#ade28843e51e262b30eb55791c83fd791',1,'AES192::keySize()'],['../classAES256.html#af8ed6412bae6fc78274f60344899366a',1,'AES256::keySize()'],['../classBlockCipher.html#afde6004a859e015d877eab3c37042a0f',1,'BlockCipher::keySize()'],['../classCBCCommon.html#adb7daacfe2a4fca3d13b62b75372fe4e',1,'CBCCommon::keySize()'],['../classCFBCommon.html#a82899da983bc70bc8152ee67f424552e',1,'CFBCommon::keySize()'],['../classChaCha.html#af286083291fab2bd36dc7ad1f54d5cd7',1,'ChaCha::keySize()'],['../classChaChaPoly.html#a666760e68cb53f28ba0a8dc09039c0fb',1,'ChaChaPoly::keySize()'],['../classCipher.html#a4cea432ea0278c865441f17cbb88b1ab',1,'Cipher::keySize()'],['../classCTRCommon.html#a29ce8e13a302350397fc6790a686bea2',1,'CTRCommon::keySize()'],['../classEAXCommon.html#a027956913eecfa0bc760f20f3b62df29',1,'EAXCommon::keySize()'],['../classGCMCommon.html#a134ba35e740a18bee3c45502b4149eae',1,'GCMCommon::keySize()'],['../classOFBCommon.html#a76ea9f9ea9dd137778338813e534a8ce',1,'OFBCommon::keySize()'],['../classSpeck.html#a061e43c1363178cda088c3f46e07d87b',1,'Speck::keySize()'],['../classSpeckTiny.html#a5587909ba48776b01bbd40b339b1262e',1,'SpeckTiny::keySize()'],['../classXTSCommon.html#a2da350825a438355665683ab9eb57aa7',1,'XTSCommon::keySize()'],['../classXTSSingleKeyCommon.html#ac017d457a08001a3ea44a9900dee2b64',1,'XTSSingleKeyCommon::keySize()']]] ]; diff --git a/search/all_c.js b/search/all_c.js index f98dfbd7..b7c9d4e4 100644 --- a/search/all_c.js +++ b/search/all_c.js @@ -1,7 +1,8 @@ var searchData= [ ['newhope',['NewHope',['../classNewHope.html',1,'']]], - ['newhopepoly',['NewHopePoly',['../classNewHopePoly.html',1,'NewHopePoly'],['../classNewHopePoly.html#aec9804046c753436ffbe88afd175bb39',1,'NewHopePoly::NewHopePoly()']]], + ['newhope_2dsmall_2edox',['newhope-small.dox',['../newhope-small_8dox.html',1,'']]], + ['newhopeprivatekey',['NewHopePrivateKey',['../structNewHopePrivateKey.html',1,'']]], ['nextfield',['nextField',['../classForm.html#a788a186ea4a7ebd75283a948ca45f4d1',1,'Form']]], ['no_5ftemperature',['NO_TEMPERATURE',['../classRTC.html#a9ed5480b362a83f1f45c4d3bcf7c3bf8',1,'RTC']]], ['nodisplay',['noDisplay',['../classLCD.html#af3974da6d988ba2d21c25135ada12108',1,'LCD']]], diff --git a/search/classes_c.js b/search/classes_c.js index 53946c31..e67d0bbb 100644 --- a/search/classes_c.js +++ b/search/classes_c.js @@ -1,6 +1,6 @@ var searchData= [ ['newhope',['NewHope',['../classNewHope.html',1,'']]], - ['newhopepoly',['NewHopePoly',['../classNewHopePoly.html',1,'']]], + ['newhopeprivatekey',['NewHopePrivateKey',['../structNewHopePrivateKey.html',1,'']]], ['noisesource',['NoiseSource',['../classNoiseSource.html',1,'']]] ]; diff --git a/search/files_7.js b/search/files_7.js index 300a0095..ae65b71a 100644 --- a/search/files_7.js +++ b/search/files_7.js @@ -1,5 +1,4 @@ var searchData= [ - ['shell_2dserial_2edox',['shell-serial.dox',['../shell-serial_8dox.html',1,'']]], - ['shell_2dtelnet_2edox',['shell-telnet.dox',['../shell-telnet_8dox.html',1,'']]] + ['newhope_2dsmall_2edox',['newhope-small.dox',['../newhope-small_8dox.html',1,'']]] ]; diff --git a/search/files_8.html b/search/files_8.html new file mode 100644 index 00000000..21c328af --- /dev/null +++ b/search/files_8.html @@ -0,0 +1,26 @@ + + + + + + + + + +
        +
        Loading...
        +
        + +
        Searching...
        +
        No Matches
        + +
        + + diff --git a/search/files_8.js b/search/files_8.js new file mode 100644 index 00000000..300a0095 --- /dev/null +++ b/search/files_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['shell_2dserial_2edox',['shell-serial.dox',['../shell-serial_8dox.html',1,'']]], + ['shell_2dtelnet_2edox',['shell-telnet.dox',['../shell-telnet_8dox.html',1,'']]] +]; diff --git a/search/functions_10.js b/search/functions_10.js index c3d33f61..a98c2d17 100644 --- a/search/functions_10.js +++ b/search/functions_10.js @@ -59,7 +59,7 @@ var searchData= ['shake',['SHAKE',['../classSHAKE.html#a9346e4d53a9d7d686911ab772fc23387',1,'SHAKE']]], ['shake128',['SHAKE128',['../classSHAKE128.html#a7d9d435780157e944eea931b3a13df0d',1,'SHAKE128']]], ['shake256',['SHAKE256',['../classSHAKE256.html#abbc01bc6798da9479e2da105f6661c22',1,'SHAKE256']]], - ['shareda',['shareda',['../classNewHope.html#ae490ebcfcbc18179b03c1a1ae8874458',1,'NewHope']]], + ['shareda',['shareda',['../classNewHope.html#ac8128e0799fe74a6c69c541e0d6bd66e',1,'NewHope']]], ['sharedb',['sharedb',['../classNewHope.html#a2f09529f5f73cf9763c28b58b13bbd14',1,'NewHope']]], ['shell',['Shell',['../classShell.html#ad613444a902075e8fd26b1f51c4d3b63',1,'Shell']]], ['shellcommandfunc',['ShellCommandFunc',['../classShell.html#ad5bac6a4033cd81e24c1345650bca744',1,'Shell']]], diff --git a/search/functions_16.js b/search/functions_16.js index a3323192..daef7e68 100644 --- a/search/functions_16.js +++ b/search/functions_16.js @@ -19,7 +19,6 @@ var searchData= ['_7ehash',['~Hash',['../classHash.html#a4e4b4797dda8678aaed058bae155813e',1,'Hash']]], ['_7ekeccakcore',['~KeccakCore',['../classKeccakCore.html#a4579e3a9b24f1d615fa8d660c23e77a4',1,'KeccakCore']]], ['_7eloginshell',['~LoginShell',['../classLoginShell.html#aaae466b141c9ea50870b66509402a2f9',1,'LoginShell']]], - ['_7enewhopepoly',['~NewHopePoly',['../classNewHopePoly.html#ad7c3c83cb078be4e6f136eeea7e21250',1,'NewHopePoly']]], ['_7enoisesource',['~NoiseSource',['../classNoiseSource.html#a4eca1e894a5d719fb9bf4df34a791cdb',1,'NoiseSource']]], ['_7eofbcommon',['~OFBCommon',['../classOFBCommon.html#aae7435157e51bf977d3481e94e17ae01',1,'OFBCommon']]], ['_7eomac',['~OMAC',['../classOMAC.html#a6bb2222c997608ec68b25831da965e8f',1,'OMAC']]], diff --git a/search/functions_2.js b/search/functions_2.js index 751d4787..1b8d5303 100644 --- a/search/functions_2.js +++ b/search/functions_2.js @@ -13,7 +13,7 @@ var searchData= ['chaseleds',['ChaseLEDs',['../classChaseLEDs.html#ab6bb3da371d3730a6552e93a9b2eab78',1,'ChaseLEDs']]], ['checktag',['checkTag',['../classAuthenticatedCipher.html#a4bb33d194e2c7d30c4e5a713e59786ff',1,'AuthenticatedCipher::checkTag()'],['../classChaChaPoly.html#aeffb3e0df0b4da03f72f30251243d953',1,'ChaChaPoly::checkTag()'],['../classEAXCommon.html#a72c403f52cefab57566bc5f634c1b963',1,'EAXCommon::checkTag()'],['../classGCMCommon.html#a70229be2fe2274c4109fe7511481075a',1,'GCMCommon::checkTag()']]], ['cipher',['Cipher',['../classCipher.html#a6a61077eca3ccd5900f92ceac58fb09c',1,'Cipher']]], - ['clear',['clear',['../classBitmap.html#a839dc8fab05a5ebf7a6b2e61436b2fa1',1,'Bitmap::clear()'],['../classAESCommon.html#a83e43f7d07e31d90fd7b768a93ecfce6',1,'AESCommon::clear()'],['../classBLAKE2b.html#a21623759bd381285ebf7e75a00c9c8a9',1,'BLAKE2b::clear()'],['../classBLAKE2s.html#a0848885f52df51dc53949d32a206e72d',1,'BLAKE2s::clear()'],['../classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b',1,'BlockCipher::clear()'],['../classCBCCommon.html#a7befadfe7384e0e857a96a59bf3845e9',1,'CBCCommon::clear()'],['../classCFBCommon.html#a847d320b0fe7f329385f26511b42c40d',1,'CFBCommon::clear()'],['../classChaCha.html#af533905f679066c41f4d6cd76bddb4cb',1,'ChaCha::clear()'],['../classChaChaPoly.html#a2d7fc3fd05a0b6c7c9c21fff6e939c9a',1,'ChaChaPoly::clear()'],['../classCipher.html#a4b7c3965646441a70d9ab934a7c92ab1',1,'Cipher::clear()'],['../classCTRCommon.html#ac0d6381c02fe2a8a017ad66d006a6ef2',1,'CTRCommon::clear()'],['../classEAXCommon.html#afa88b0f589e09103e9c69ace081db0af',1,'EAXCommon::clear()'],['../classGCMCommon.html#a06868ebd67a571aa68d88d5d072cece9',1,'GCMCommon::clear()'],['../classGHASH.html#a4b1ee789debf56f7f24807960ef0556e',1,'GHASH::clear()'],['../classHash.html#a4a959469433cd9348ab7f3ac6228bb34',1,'Hash::clear()'],['../classKeccakCore.html#aeff1df56e4a3103c99c1fe4307e60c66',1,'KeccakCore::clear()'],['../classOFBCommon.html#a55bf2396beb91c457bfc4c20ef5c8123',1,'OFBCommon::clear()'],['../classOMAC.html#a072715dbda39dc9c360cfcaab31d6aa7',1,'OMAC::clear()'],['../classPoly1305.html#ae3f3392b9a2bd0f3472e7e50dd7e21dd',1,'Poly1305::clear()'],['../classSHA256.html#add0d1649d533b27005ccd8508398c689',1,'SHA256::clear()'],['../classSHA3__256.html#a531467f995ef6fc901ad8c2b5776a8d1',1,'SHA3_256::clear()'],['../classSHA3__512.html#acfbc5e9b4d394f011d5132a2b156d260',1,'SHA3_512::clear()'],['../classSHA512.html#a0a9104dce5f099aeba216e5fbcb1ee1a',1,'SHA512::clear()'],['../classSHAKE.html#ab86f52425c1d5b0e5c924b4f96121fe0',1,'SHAKE::clear()'],['../classSpeck.html#aa3866273282addabb9d3703c41fdc95f',1,'Speck::clear()'],['../classSpeckSmall.html#aa93d9f0b5153425dc04e8fb8faff7513',1,'SpeckSmall::clear()'],['../classSpeckTiny.html#a303ecc2639459e47c6eeb21991d52ccf',1,'SpeckTiny::clear()'],['../classXOF.html#ac34cb22f251642b58b3dd78a6480aff3',1,'XOF::clear()'],['../classXTSCommon.html#a96e3cb4a3d35dc4e3a5acbae19b4465b',1,'XTSCommon::clear()'],['../classNewHopePoly.html#a842db1796a45ba78f279e008210df304',1,'NewHopePoly::clear()'],['../classTerminal.html#a4be741767b27739eec98901477e1c3d4',1,'Terminal::clear()']]], + ['clear',['clear',['../classBitmap.html#a839dc8fab05a5ebf7a6b2e61436b2fa1',1,'Bitmap::clear()'],['../classAESCommon.html#a83e43f7d07e31d90fd7b768a93ecfce6',1,'AESCommon::clear()'],['../classBLAKE2b.html#a21623759bd381285ebf7e75a00c9c8a9',1,'BLAKE2b::clear()'],['../classBLAKE2s.html#a0848885f52df51dc53949d32a206e72d',1,'BLAKE2s::clear()'],['../classBlockCipher.html#a6f27d46e9dfa7761d014d828ad5f955b',1,'BlockCipher::clear()'],['../classCBCCommon.html#a7befadfe7384e0e857a96a59bf3845e9',1,'CBCCommon::clear()'],['../classCFBCommon.html#a847d320b0fe7f329385f26511b42c40d',1,'CFBCommon::clear()'],['../classChaCha.html#af533905f679066c41f4d6cd76bddb4cb',1,'ChaCha::clear()'],['../classChaChaPoly.html#a2d7fc3fd05a0b6c7c9c21fff6e939c9a',1,'ChaChaPoly::clear()'],['../classCipher.html#a4b7c3965646441a70d9ab934a7c92ab1',1,'Cipher::clear()'],['../classCTRCommon.html#ac0d6381c02fe2a8a017ad66d006a6ef2',1,'CTRCommon::clear()'],['../classEAXCommon.html#afa88b0f589e09103e9c69ace081db0af',1,'EAXCommon::clear()'],['../classGCMCommon.html#a06868ebd67a571aa68d88d5d072cece9',1,'GCMCommon::clear()'],['../classGHASH.html#a4b1ee789debf56f7f24807960ef0556e',1,'GHASH::clear()'],['../classHash.html#a4a959469433cd9348ab7f3ac6228bb34',1,'Hash::clear()'],['../classKeccakCore.html#aeff1df56e4a3103c99c1fe4307e60c66',1,'KeccakCore::clear()'],['../classOFBCommon.html#a55bf2396beb91c457bfc4c20ef5c8123',1,'OFBCommon::clear()'],['../classOMAC.html#a072715dbda39dc9c360cfcaab31d6aa7',1,'OMAC::clear()'],['../classPoly1305.html#ae3f3392b9a2bd0f3472e7e50dd7e21dd',1,'Poly1305::clear()'],['../classSHA256.html#add0d1649d533b27005ccd8508398c689',1,'SHA256::clear()'],['../classSHA3__256.html#a531467f995ef6fc901ad8c2b5776a8d1',1,'SHA3_256::clear()'],['../classSHA3__512.html#acfbc5e9b4d394f011d5132a2b156d260',1,'SHA3_512::clear()'],['../classSHA512.html#a0a9104dce5f099aeba216e5fbcb1ee1a',1,'SHA512::clear()'],['../classSHAKE.html#ab86f52425c1d5b0e5c924b4f96121fe0',1,'SHAKE::clear()'],['../classSpeck.html#aa3866273282addabb9d3703c41fdc95f',1,'Speck::clear()'],['../classSpeckSmall.html#aa93d9f0b5153425dc04e8fb8faff7513',1,'SpeckSmall::clear()'],['../classSpeckTiny.html#a303ecc2639459e47c6eeb21991d52ccf',1,'SpeckTiny::clear()'],['../classXOF.html#ac34cb22f251642b58b3dd78a6480aff3',1,'XOF::clear()'],['../classXTSCommon.html#a96e3cb4a3d35dc4e3a5acbae19b4465b',1,'XTSCommon::clear()'],['../classTerminal.html#a4be741767b27739eec98901477e1c3d4',1,'Terminal::clear()']]], ['cleartoeol',['clearToEOL',['../classTerminal.html#aeb93d71925cdfb17065e7f1ef2e83414',1,'Terminal']]], ['color',['color',['../classTerminal.html#ad1fc2be31d49124a1d32e8afddaa57b8',1,'Terminal::color(Color fg)'],['../classTerminal.html#ae22436e478a854e8b559fe73182bc329',1,'Terminal::color(Color fg, Color bg)']]], ['columns',['columns',['../classTerminal.html#aed25b5a884f89dcd2bb269a8e356e5d6',1,'Terminal']]], diff --git a/search/functions_9.js b/search/functions_9.js index 12d7c18d..e434f252 100644 --- a/search/functions_9.js +++ b/search/functions_9.js @@ -1,6 +1,6 @@ var searchData= [ ['keccakcore',['KeccakCore',['../classKeccakCore.html#a850c8e85bdb6b347411239716535d9c9',1,'KeccakCore']]], - ['keygen',['keygen',['../classNewHope.html#ae8f821867bce309220aee7a43c2d4f51',1,'NewHope']]], + ['keygen',['keygen',['../classNewHope.html#a335b17b40949f66aa579d1035384662c',1,'NewHope']]], ['keysize',['keySize',['../classAES128.html#aa871832a156f0ea61b964e489670ae9d',1,'AES128::keySize()'],['../classAES192.html#ade28843e51e262b30eb55791c83fd791',1,'AES192::keySize()'],['../classAES256.html#af8ed6412bae6fc78274f60344899366a',1,'AES256::keySize()'],['../classBlockCipher.html#afde6004a859e015d877eab3c37042a0f',1,'BlockCipher::keySize()'],['../classCBCCommon.html#adb7daacfe2a4fca3d13b62b75372fe4e',1,'CBCCommon::keySize()'],['../classCFBCommon.html#a82899da983bc70bc8152ee67f424552e',1,'CFBCommon::keySize()'],['../classChaCha.html#af286083291fab2bd36dc7ad1f54d5cd7',1,'ChaCha::keySize()'],['../classChaChaPoly.html#a666760e68cb53f28ba0a8dc09039c0fb',1,'ChaChaPoly::keySize()'],['../classCipher.html#a4cea432ea0278c865441f17cbb88b1ab',1,'Cipher::keySize()'],['../classCTRCommon.html#a29ce8e13a302350397fc6790a686bea2',1,'CTRCommon::keySize()'],['../classEAXCommon.html#a027956913eecfa0bc760f20f3b62df29',1,'EAXCommon::keySize()'],['../classGCMCommon.html#a134ba35e740a18bee3c45502b4149eae',1,'GCMCommon::keySize()'],['../classOFBCommon.html#a76ea9f9ea9dd137778338813e534a8ce',1,'OFBCommon::keySize()'],['../classSpeck.html#a061e43c1363178cda088c3f46e07d87b',1,'Speck::keySize()'],['../classSpeckTiny.html#a5587909ba48776b01bbd40b339b1262e',1,'SpeckTiny::keySize()'],['../classXTSCommon.html#a2da350825a438355665683ab9eb57aa7',1,'XTSCommon::keySize()'],['../classXTSSingleKeyCommon.html#ac017d457a08001a3ea44a9900dee2b64',1,'XTSSingleKeyCommon::keySize()']]] ]; diff --git a/search/functions_c.js b/search/functions_c.js index 6781c4f5..1802e35b 100644 --- a/search/functions_c.js +++ b/search/functions_c.js @@ -1,6 +1,5 @@ var searchData= [ - ['newhopepoly',['NewHopePoly',['../classNewHopePoly.html#aec9804046c753436ffbe88afd175bb39',1,'NewHopePoly']]], ['nextfield',['nextField',['../classForm.html#a788a186ea4a7ebd75283a948ca45f4d1',1,'Form']]], ['nodisplay',['noDisplay',['../classLCD.html#af3974da6d988ba2d21c25135ada12108',1,'LCD']]], ['noisesource',['NoiseSource',['../classNoiseSource.html#a601479b7d8cc215f97f2f8a18d3ef4c2',1,'NoiseSource']]], diff --git a/search/pages_8.js b/search/pages_8.js index caff712b..6f884279 100644 --- a/search/pages_8.js +++ b/search/pages_8.js @@ -2,5 +2,6 @@ var searchData= [ ['star_20trek_20example',['Star Trek Example',['../blink_startrek.html',1,'']]], ['snake_20video_20game_20using_20an_20infrared_20remote_20control',['Snake Video Game Using an Infrared Remote Control',['../ir_snake.html',1,'']]], + ['small_20memory_20footprint_20new_20hope',['Small Memory Footprint New Hope',['../newhope_small.html',1,'']]], ['serial_20port_20shell_20example',['Serial port Shell example',['../shell_serial.html',1,'']]] ]; diff --git a/search/search.js b/search/search.js index 8b12b0f3..74006a55 100644 --- a/search/search.js +++ b/search/search.js @@ -9,7 +9,7 @@ var indexSectionsWithContent = { 0: "abcdefghiklmnoprstuvwxy~", 1: "abcdefghiklmnoprstx", - 2: "abcdilms", + 2: "abcdilmns", 3: "abcdefghiklmnoprstuvwx~", 4: "abdfhimnswy", 5: "cfp", diff --git a/shell-serial_8dox.html b/shell-serial_8dox.html index 7513a2fd..4a0cc7a6 100644 --- a/shell-serial_8dox.html +++ b/shell-serial_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/shell-telnet_8dox.html b/shell-telnet_8dox.html index 054c3b57..4f7bdf98 100644 --- a/shell-telnet_8dox.html +++ b/shell-telnet_8dox.html @@ -87,7 +87,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/shell_serial.html b/shell_serial.html index f52f8dc9..6a385eda 100644 --- a/shell_serial.html +++ b/shell_serial.html @@ -156,7 +156,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/shell_telnet.html b/shell_telnet.html index ec657dbb..6a163292 100644 --- a/shell_telnet.html +++ b/shell_telnet.html @@ -165,7 +165,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/structNewHopePrivateKey.html b/structNewHopePrivateKey.html new file mode 100644 index 00000000..3f5700ab --- /dev/null +++ b/structNewHopePrivateKey.html @@ -0,0 +1,112 @@ + + + + + + +ArduinoLibs: NewHopePrivateKey Class Reference + + + + + + + + + +
        +
        + + + + + + +
        +
        ArduinoLibs +
        +
        +
        + + + + + + + + + +
        + +
        + +
        +
        +
        +
        NewHopePrivateKey Class Reference
        +
        +
        + +

        NewHope private key representation. + More...

        + +

        #include <NewHope.h>

        +

        Detailed Description

        +

        NewHope private key representation.

        +

        Instances of NewHopePrivateKey are used to hold the private key value for alice between the calls to keygen() and shareda(). It should be treated as opaque.

        +

        Reference: https://cryptojedi.org/crypto/#newhope

        + +

        Definition at line 38 of file NewHope.h.

        +

        The documentation for this class was generated from the following file: +
        + + + + diff --git a/structRTCAlarm.html b/structRTCAlarm.html index 9dc3612e..457f6e79 100644 --- a/structRTCAlarm.html +++ b/structRTCAlarm.html @@ -200,7 +200,7 @@ uint8_t  diff --git a/structRTCDate.html b/structRTCDate.html index 5bc367f4..8c8ea468 100644 --- a/structRTCDate.html +++ b/structRTCDate.html @@ -123,7 +123,7 @@ uint8_t  diff --git a/structRTCTime.html b/structRTCTime.html index c0b7d8c1..68f6fcd5 100644 --- a/structRTCTime.html +++ b/structRTCTime.html @@ -123,7 +123,7 @@ uint8_t