From 9a10977cecb3571581e66531fe09d59ec8ad2433 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Sat, 2 May 2015 10:17:44 +1000 Subject: [PATCH] Update docs --- AES128_8cpp_source.html | 2 +- AES192_8cpp_source.html | 2 +- AES256_8cpp_source.html | 2 +- AESCommon_8cpp_source.html | 2 +- AES_8h_source.html | 2 +- AuthenticatedCipher_8cpp_source.html | 2 +- AuthenticatedCipher_8h_source.html | 2 +- BLAKE2b_8cpp_source.html | 2 +- BLAKE2b_8h_source.html | 2 +- BLAKE2s_8cpp_source.html | 2 +- BLAKE2s_8h_source.html | 2 +- BigNumberUtil_8cpp_source.html | 2 +- BigNumberUtil_8h_source.html | 127 ++-- Bitmap_8cpp_source.html | 2 +- Bitmap_8h_source.html | 2 +- BlinkLED_8cpp_source.html | 2 +- BlinkLED_8h_source.html | 2 +- BlockCipher_8cpp_source.html | 2 +- BlockCipher_8h_source.html | 2 +- BoolField_8cpp_source.html | 2 +- BoolField_8h_source.html | 2 +- CBC_8cpp_source.html | 2 +- CBC_8h_source.html | 2 +- CFB_8cpp_source.html | 2 +- CFB_8h_source.html | 2 +- CTR_8cpp_source.html | 2 +- CTR_8h_source.html | 2 +- ChaChaPoly_8cpp_source.html | 2 +- ChaChaPoly_8h_source.html | 2 +- ChaCha_8cpp_source.html | 2 +- ChaCha_8h_source.html | 2 +- Charlieplex_8cpp_source.html | 2 +- Charlieplex_8h_source.html | 2 +- ChaseLEDs_8cpp_source.html | 2 +- ChaseLEDs_8h_source.html | 2 +- Cipher_8cpp_source.html | 2 +- Cipher_8h_source.html | 2 +- Crypto_8cpp_source.html | 2 +- Crypto_8h_source.html | 2 +- Curve25519_8cpp_source.html | 4 +- Curve25519_8h_source.html | 2 +- DMD_8cpp_source.html | 2 +- DMD_8h_source.html | 2 +- DS1307RTC_8cpp_source.html | 2 +- DS1307RTC_8h_source.html | 2 +- DS3231RTC_8cpp_source.html | 2 +- DS3231RTC_8h_source.html | 2 +- DS3232RTC_8cpp_source.html | 2 +- DS3232RTC_8h_source.html | 2 +- DejaVuSans9_8h_source.html | 2 +- DejaVuSansBold9_8h_source.html | 2 +- DejaVuSansItalic9_8h_source.html | 2 +- EEPROM24_8cpp_source.html | 2 +- EEPROM24_8h_source.html | 2 +- Ed25519_8cpp_source.html | 4 +- Ed25519_8h_source.html | 2 +- Field_8cpp_source.html | 2 +- Field_8h_source.html | 2 +- Form_8cpp_source.html | 2 +- Form_8h_source.html | 2 +- GCM_8cpp_source.html | 2 +- GCM_8h_source.html | 2 +- GHASH_8cpp_source.html | 2 +- GHASH_8h_source.html | 2 +- Hash_8cpp_source.html | 2 +- Hash_8h_source.html | 2 +- I2CMaster_8cpp_source.html | 2 +- I2CMaster_8h_source.html | 2 +- IRreceiver_8cpp_source.html | 2 +- IRreceiver_8h_source.html | 2 +- IntField_8cpp_source.html | 2 +- IntField_8h_source.html | 2 +- KeccakCore_8cpp_source.html | 2 +- KeccakCore_8h_source.html | 2 +- LCD_8cpp_source.html | 2 +- LCD_8h_source.html | 2 +- ListField_8cpp_source.html | 2 +- ListField_8h_source.html | 2 +- Melody_8cpp_source.html | 2 +- Melody_8h_source.html | 2 +- Mono5x7_8h_source.html | 2 +- NoiseSource_8cpp_source.html | 4 +- NoiseSource_8h_source.html | 2 +- OFB_8cpp_source.html | 2 +- OFB_8h_source.html | 2 +- Poly1305_8cpp_source.html | 2 +- Poly1305_8h_source.html | 2 +- PowerSave_8cpp_source.html | 2 +- PowerSave_8h_source.html | 2 +- RC5_8h_source.html | 2 +- RNG_8cpp_source.html | 662 ++++++++++++-------- RNG_8h_source.html | 39 +- RTC_8cpp_source.html | 2 +- RTC_8h_source.html | 2 +- RingOscillatorNoiseSource_8cpp_source.html | 2 +- RingOscillatorNoiseSource_8h_source.html | 2 +- SHA1_8cpp_source.html | 2 +- SHA1_8h_source.html | 2 +- SHA256_8cpp_source.html | 2 +- SHA256_8h_source.html | 2 +- SHA3_8cpp_source.html | 2 +- SHA3_8h_source.html | 2 +- SHA512_8cpp_source.html | 2 +- SHA512_8h_source.html | 2 +- SoftI2C_8cpp_source.html | 2 +- SoftI2C_8h_source.html | 2 +- TextField_8cpp_source.html | 2 +- TextField_8h_source.html | 2 +- TimeField_8cpp_source.html | 2 +- TimeField_8h_source.html | 2 +- TransistorNoiseSource_8cpp_source.html | 2 +- TransistorNoiseSource_8h_source.html | 2 +- alarm-clock_8dox.html | 2 +- alarm_clock.html | 2 +- annotated.html | 2 +- blink-blink_8dox.html | 2 +- blink-charlieplex_8dox.html | 2 +- blink-cylon_8dox.html | 2 +- blink-startrek_8dox.html | 2 +- blink_blink.html | 2 +- blink_charlieplex.html | 2 +- blink_cylon.html | 2 +- blink_startrek.html | 2 +- classAES128-members.html | 2 +- classAES128.html | 2 +- classAES192-members.html | 2 +- classAES192.html | 2 +- classAES256-members.html | 2 +- classAES256.html | 2 +- classAESCommon-members.html | 2 +- classAESCommon.html | 2 +- classAuthenticatedCipher-members.html | 2 +- classAuthenticatedCipher.html | 2 +- classBLAKE2b-members.html | 2 +- classBLAKE2b.html | 2 +- classBLAKE2s-members.html | 2 +- classBLAKE2s.html | 2 +- classBigNumberUtil-members.html | 2 +- classBigNumberUtil.html | 4 +- classBitmap-members.html | 2 +- classBitmap.html | 2 +- classBlinkLED-members.html | 2 +- classBlinkLED.html | 2 +- classBlockCipher-members.html | 2 +- classBlockCipher.html | 2 +- classBoolField-members.html | 2 +- classBoolField.html | 2 +- classCBC-members.html | 2 +- classCBC.html | 2 +- classCBCCommon-members.html | 2 +- classCBCCommon.html | 2 +- classCFB-members.html | 2 +- classCFB.html | 2 +- classCFBCommon-members.html | 2 +- classCFBCommon.html | 2 +- classCTR-members.html | 2 +- classCTR.html | 2 +- classCTRCommon-members.html | 2 +- classCTRCommon.html | 2 +- classChaCha-members.html | 2 +- classChaCha.html | 2 +- classChaChaPoly-members.html | 2 +- classChaChaPoly.html | 2 +- classCharlieplex-members.html | 2 +- classCharlieplex.html | 2 +- classChaseLEDs-members.html | 2 +- classChaseLEDs.html | 2 +- classCipher-members.html | 2 +- classCipher.html | 2 +- classCurve25519-members.html | 2 +- classCurve25519.html | 2 +- classDMD-members.html | 2 +- classDMD.html | 2 +- classDS1307RTC-members.html | 2 +- classDS1307RTC.html | 2 +- classDS3231RTC-members.html | 2 +- classDS3231RTC.html | 2 +- classDS3232RTC-members.html | 2 +- classDS3232RTC.html | 2 +- classEEPROM24-members.html | 2 +- classEEPROM24.html | 2 +- classEd25519-members.html | 2 +- classEd25519.html | 2 +- classField-members.html | 2 +- classField.html | 2 +- classForm-members.html | 2 +- classForm.html | 2 +- classGCM-members.html | 2 +- classGCM.html | 2 +- classGCMCommon-members.html | 2 +- classGCMCommon.html | 2 +- classGHASH-members.html | 2 +- classGHASH.html | 2 +- classHash-members.html | 2 +- classHash.html | 2 +- classI2CMaster-members.html | 2 +- classI2CMaster.html | 2 +- classIRreceiver-members.html | 2 +- classIRreceiver.html | 2 +- classIntField-members.html | 2 +- classIntField.html | 2 +- classKeccakCore-members.html | 2 +- classKeccakCore.html | 2 +- classLCD-members.html | 2 +- classLCD.html | 2 +- classListField-members.html | 2 +- classListField.html | 2 +- classMelody-members.html | 2 +- classMelody.html | 2 +- classNoiseSource-members.html | 2 +- classNoiseSource.html | 2 +- classOFB-members.html | 2 +- classOFB.html | 2 +- classOFBCommon-members.html | 2 +- classOFBCommon.html | 2 +- classPoly1305-members.html | 2 +- classPoly1305.html | 2 +- classRNGClass-members.html | 2 +- classRNGClass.html | 24 +- classRTC-members.html | 2 +- classRTC.html | 2 +- classRTCAlarm-members.html | 2 +- classRTCDate-members.html | 2 +- classRTCTime-members.html | 2 +- classRingOscillatorNoiseSource-members.html | 2 +- classRingOscillatorNoiseSource.html | 2 +- classSHA1-members.html | 2 +- classSHA1.html | 2 +- classSHA256-members.html | 2 +- classSHA256.html | 2 +- classSHA3__256-members.html | 2 +- classSHA3__256.html | 2 +- classSHA3__512-members.html | 2 +- classSHA3__512.html | 2 +- classSHA512-members.html | 2 +- classSHA512.html | 2 +- classSoftI2C-members.html | 2 +- classSoftI2C.html | 2 +- classTextField-members.html | 2 +- classTextField.html | 2 +- classTimeField-members.html | 2 +- classTimeField.html | 2 +- classTransistorNoiseSource-members.html | 2 +- classTransistorNoiseSource.html | 2 +- classes.html | 2 +- crypto-rng-ring_8dox.html | 2 +- crypto-rng_8dox.html | 2 +- crypto.html | 85 ++- crypto_8dox.html | 2 +- crypto_rng.html | 4 +- crypto_rng_ring.html | 2 +- dir_1586d320a3b1e622174530fde769cda9.html | 2 +- dir_3dd03323535933fb3f714c41ff7a94da.html | 2 +- dir_48f64e79f12bd77ba047e9e436ec978c.html | 2 +- dir_5e87a7229a108582288ef7eda1233dc3.html | 2 +- dir_6591a2127a29f6cea3994dcb5b0596d1.html | 2 +- dir_7e6ab9b017486261fe80629d442521f0.html | 2 +- dir_9a34040863d1190c0e01b23e6b44de01.html | 2 +- dir_bc0718b08fb2015b8e59c47b2805f60c.html | 2 +- dir_be059bf9978ae156837504b1b8a7568c.html | 2 +- dir_e2ce51835550ba18edf07a8311722290.html | 2 +- dir_f34881fcf60f680b800190d5274dfaea.html | 2 +- dir_f9b96888882c2691b8eeaeafd1b9501d.html | 2 +- dmd-demo_8dox.html | 2 +- dmd-running-figure_8dox.html | 2 +- dmd_demo.html | 2 +- dmd_running_figure.html | 2 +- files.html | 2 +- functions.html | 2 +- functions_b.html | 2 +- functions_c.html | 2 +- functions_d.html | 2 +- functions_e.html | 2 +- functions_enum.html | 2 +- functions_eval.html | 2 +- functions_f.html | 2 +- functions_func.html | 2 +- functions_func_b.html | 2 +- functions_func_c.html | 2 +- functions_func_d.html | 2 +- functions_func_e.html | 2 +- functions_func_f.html | 2 +- functions_func_g.html | 2 +- functions_func_h.html | 2 +- functions_func_i.html | 2 +- functions_func_k.html | 2 +- functions_func_l.html | 4 +- functions_func_m.html | 2 +- functions_func_n.html | 2 +- functions_func_o.html | 2 +- functions_func_p.html | 2 +- functions_func_r.html | 2 +- functions_func_s.html | 2 +- functions_func_t.html | 2 +- functions_func_u.html | 2 +- functions_func_v.html | 2 +- functions_func_w.html | 2 +- functions_func_~.html | 2 +- functions_g.html | 2 +- functions_h.html | 2 +- functions_i.html | 2 +- functions_k.html | 2 +- functions_l.html | 4 +- functions_m.html | 2 +- functions_n.html | 2 +- functions_o.html | 2 +- functions_p.html | 2 +- functions_r.html | 2 +- functions_s.html | 8 +- functions_t.html | 2 +- functions_type.html | 2 +- functions_u.html | 2 +- functions_v.html | 2 +- functions_vars.html | 2 +- functions_w.html | 2 +- functions_y.html | 2 +- functions_~.html | 2 +- group__power__save.html | 2 +- hierarchy.html | 2 +- index.html | 2 +- ir-dumpir_8dox.html | 2 +- ir-snake_8dox.html | 2 +- ir_dumpir.html | 2 +- ir_snake.html | 2 +- lcd-form_8dox.html | 2 +- lcd-helloworld_8dox.html | 2 +- lcd_form.html | 2 +- lcd_hello_world.html | 2 +- mainpage_8dox.html | 2 +- modules.html | 2 +- pages.html | 2 +- search/all_10.js | 2 +- search/all_a.js | 2 +- search/functions_a.js | 2 +- structRTCAlarm.html | 2 +- structRTCDate.html | 2 +- structRTCTime.html | 2 +- 337 files changed, 941 insertions(+), 680 deletions(-) diff --git a/AES128_8cpp_source.html b/AES128_8cpp_source.html index 59f4576e..043ba847 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 71024276..f94fa8d5 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 ac29064e..d30381c5 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 c18c191c..c5fbc770 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 6bf45c98..1b2bd932 100644 --- a/AES_8h_source.html +++ b/AES_8h_source.html @@ -206,7 +206,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/AuthenticatedCipher_8cpp_source.html b/AuthenticatedCipher_8cpp_source.html index 29f57afe..f05c0e0b 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 9a9439c5..eaebf075 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 394f1c1f..d16948fc 100644 --- a/BLAKE2b_8cpp_source.html +++ b/BLAKE2b_8cpp_source.html @@ -330,7 +330,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BLAKE2b_8h_source.html b/BLAKE2b_8h_source.html index e580e47b..f7fa9b99 100644 --- a/BLAKE2b_8h_source.html +++ b/BLAKE2b_8h_source.html @@ -163,7 +163,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BLAKE2s_8cpp_source.html b/BLAKE2s_8cpp_source.html index c0060ca5..2fe858c9 100644 --- a/BLAKE2s_8cpp_source.html +++ b/BLAKE2s_8cpp_source.html @@ -322,7 +322,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BLAKE2s_8h_source.html b/BLAKE2s_8h_source.html index e1c0ee19..7b7804cf 100644 --- a/BLAKE2s_8h_source.html +++ b/BLAKE2s_8h_source.html @@ -162,7 +162,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BigNumberUtil_8cpp_source.html b/BigNumberUtil_8cpp_source.html index 4aa65ae2..839ac14c 100644 --- a/BigNumberUtil_8cpp_source.html +++ b/BigNumberUtil_8cpp_source.html @@ -557,7 +557,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/BigNumberUtil_8h_source.html b/BigNumberUtil_8h_source.html index 83ffcac6..1a8248ba 100644 --- a/BigNumberUtil_8h_source.html +++ b/BigNumberUtil_8h_source.html @@ -118,70 +118,77 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
28 
29 // Define exactly one of these to 1 to set the size of the basic limb type.
30 // 16-bit limbs seem to give the best performance on 8-bit AVR micros.
-
31 #define BIGNUMBER_LIMB_8BIT 0
-
32 #define BIGNUMBER_LIMB_16BIT 1
-
33 #define BIGNUMBER_LIMB_32BIT 0
-
34 
-
35 // Define the limb types to use on this platform.
-
36 #if BIGNUMBER_LIMB_8BIT
-
37 typedef uint8_t limb_t;
-
38 typedef int8_t slimb_t;
-
39 typedef uint16_t dlimb_t;
-
40 #elif BIGNUMBER_LIMB_16BIT
-
41 typedef uint16_t limb_t;
-
42 typedef int16_t slimb_t;
-
43 typedef uint32_t dlimb_t;
-
44 #elif BIGNUMBER_LIMB_32BIT
-
45 typedef uint32_t limb_t;
-
46 typedef int32_t slimb_t;
-
47 typedef uint64_t dlimb_t;
-
48 #else
-
49 #error "limb_t must be 8, 16, or 32 bits in size"
-
50 #endif
-
51 
-
52 class BigNumberUtil
-
53 {
-
54 public:
-
55  static void unpackLE(limb_t *limbs, size_t count,
-
56  const uint8_t *bytes, size_t len);
-
57  static void unpackBE(limb_t *limbs, size_t count,
-
58  const uint8_t *bytes, size_t len);
-
59  static void packLE(uint8_t *bytes, size_t len,
-
60  const limb_t *limbs, size_t count);
-
61  static void packBE(uint8_t *bytes, size_t len,
-
62  const limb_t *limbs, size_t count);
-
63 
-
64  static limb_t add(limb_t *result, const limb_t *x,
-
65  const limb_t *y, size_t size);
-
66  static limb_t sub(limb_t *result, const limb_t *x,
-
67  const limb_t *y, size_t size);
-
68  static void mul(limb_t *result, const limb_t *x, size_t xcount,
-
69  const limb_t *y, size_t ycount);
-
70  static void reduceQuick(limb_t *result, const limb_t *x,
-
71  const limb_t *y, size_t size);
-
72 
-
73  static limb_t add_P(limb_t *result, const limb_t *x,
-
74  const limb_t *y, size_t size);
-
75  static limb_t sub_P(limb_t *result, const limb_t *x,
-
76  const limb_t *y, size_t size);
-
77  static void mul_P(limb_t *result, const limb_t *x, size_t xcount,
-
78  const limb_t *y, size_t ycount);
-
79  static void reduceQuick_P(limb_t *result, const limb_t *x,
-
80  const limb_t *y, size_t size);
-
81 
-
82 private:
-
83  // Constructor and destructor are private - cannot instantiate this class.
-
84  BigNumberUtil() {}
-
85  ~BigNumberUtil() {}
-
86 };
-
87 
-
88 #endif
+
31 #if defined(__AVR__)
+
32 #define BIGNUMBER_LIMB_8BIT 0
+
33 #define BIGNUMBER_LIMB_16BIT 1
+
34 #define BIGNUMBER_LIMB_32BIT 0
+
35 #else
+
36 // On all other platforms, assume 32-bit is best (e.g. ARM).
+
37 #define BIGNUMBER_LIMB_8BIT 0
+
38 #define BIGNUMBER_LIMB_16BIT 0
+
39 #define BIGNUMBER_LIMB_32BIT 1
+
40 #endif
+
41 
+
42 // Define the limb types to use on this platform.
+
43 #if BIGNUMBER_LIMB_8BIT
+
44 typedef uint8_t limb_t;
+
45 typedef int8_t slimb_t;
+
46 typedef uint16_t dlimb_t;
+
47 #elif BIGNUMBER_LIMB_16BIT
+
48 typedef uint16_t limb_t;
+
49 typedef int16_t slimb_t;
+
50 typedef uint32_t dlimb_t;
+
51 #elif BIGNUMBER_LIMB_32BIT
+
52 typedef uint32_t limb_t;
+
53 typedef int32_t slimb_t;
+
54 typedef uint64_t dlimb_t;
+
55 #else
+
56 #error "limb_t must be 8, 16, or 32 bits in size"
+
57 #endif
+
58 
+
59 class BigNumberUtil
+
60 {
+
61 public:
+
62  static void unpackLE(limb_t *limbs, size_t count,
+
63  const uint8_t *bytes, size_t len);
+
64  static void unpackBE(limb_t *limbs, size_t count,
+
65  const uint8_t *bytes, size_t len);
+
66  static void packLE(uint8_t *bytes, size_t len,
+
67  const limb_t *limbs, size_t count);
+
68  static void packBE(uint8_t *bytes, size_t len,
+
69  const limb_t *limbs, size_t count);
+
70 
+
71  static limb_t add(limb_t *result, const limb_t *x,
+
72  const limb_t *y, size_t size);
+
73  static limb_t sub(limb_t *result, const limb_t *x,
+
74  const limb_t *y, size_t size);
+
75  static void mul(limb_t *result, const limb_t *x, size_t xcount,
+
76  const limb_t *y, size_t ycount);
+
77  static void reduceQuick(limb_t *result, const limb_t *x,
+
78  const limb_t *y, size_t size);
+
79 
+
80  static limb_t add_P(limb_t *result, const limb_t *x,
+
81  const limb_t *y, size_t size);
+
82  static limb_t sub_P(limb_t *result, const limb_t *x,
+
83  const limb_t *y, size_t size);
+
84  static void mul_P(limb_t *result, const limb_t *x, size_t xcount,
+
85  const limb_t *y, size_t ycount);
+
86  static void reduceQuick_P(limb_t *result, const limb_t *x,
+
87  const limb_t *y, size_t size);
+
88 
+
89 private:
+
90  // Constructor and destructor are private - cannot instantiate this class.
+
91  BigNumberUtil() {}
+
92  ~BigNumberUtil() {}
+
93 };
+
94 
+
95 #endif
static void reduceQuick_P(limb_t *result, const limb_t *x, const limb_t *y, size_t size)
Reduces x modulo y using subtraction where y is in program memory.
static limb_t add(limb_t *result, const limb_t *x, const limb_t *y, size_t size)
Adds two big numbers.
static limb_t sub_P(limb_t *result, const limb_t *x, const limb_t *y, size_t size)
Subtracts one big number from another where one is in program memory.
static void reduceQuick(limb_t *result, const limb_t *x, const limb_t *y, size_t size)
Reduces x modulo y using subtraction.
static limb_t sub(limb_t *result, const limb_t *x, const limb_t *y, size_t size)
Subtracts one big number from another.
-
Utilities to assist with implementing big number arithmetic.
Definition: BigNumberUtil.h:52
+
Utilities to assist with implementing big number arithmetic.
Definition: BigNumberUtil.h:59
static void mul_P(limb_t *result, const limb_t *x, size_t xcount, const limb_t *y, size_t ycount)
Multiplies two big numbers where one is in program memory.
static void packBE(uint8_t *bytes, size_t len, const limb_t *limbs, size_t count)
Packs the big-endian byte representation of a big number into a byte array.
static void unpackLE(limb_t *limbs, size_t count, const uint8_t *bytes, size_t len)
Unpacks the little-endian byte representation of a big number into a limb array.
@@ -192,7 +199,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Bitmap_8cpp_source.html b/Bitmap_8cpp_source.html index 39c7a19b..80b9c3d5 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 5402b0c4..df4f6526 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 d74b5019..af0b91dd 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 5e4d1229..13945c19 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 a2b9f5ba..1df54eaa 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 00890dc8..779a74e1 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 de66a05b..b6a5d240 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 0db57a03..d83e7386 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 d5bb13ed..1f705436 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 32db72ae..8cbe3390 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 3d59c645..acac1fd0 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 301b500a..c6b45023 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 cc56776c..a1e2123f 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 5b669f21..089a4e09 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 365ade70..92d6ed13 100644 --- a/ChaChaPoly_8cpp_source.html +++ b/ChaChaPoly_8cpp_source.html @@ -262,7 +262,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/ChaChaPoly_8h_source.html b/ChaChaPoly_8h_source.html index bac49f7e..f34a81e3 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 f54bd0fc..0dc3b169 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 8fa6cea9..3996dee7 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 99c1ed6c..dfdd4af4 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 635ce841..f10ff5df 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 0eae2696..2406c9e0 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 7343c6ef..e4171886 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 c8388ca7..d00133da 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 eccfdb30..e759b7ab 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 2932e1e6..dbd7d735 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 e2e60ba0..7aa9ee72 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 d6c01bcd..95ab7073 100644 --- a/Curve25519_8cpp_source.html +++ b/Curve25519_8cpp_source.html @@ -803,7 +803,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
961  clean(y);
962  return false;
963 }
-
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:298
+
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:428
static bool eval(uint8_t result[32], const uint8_t s[32], const uint8_t x[32])
Evaluates the raw Curve25519 function.
Definition: Curve25519.cpp:74
static void unpackLE(limb_t *limbs, size_t count, const uint8_t *bytes, size_t len)
Unpacks the little-endian byte representation of a big number into a limb array.
static void packLE(uint8_t *bytes, size_t len, const limb_t *limbs, size_t count)
Packs the little-endian byte representation of a big number into a byte array.
@@ -812,7 +812,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Curve25519_8h_source.html b/Curve25519_8h_source.html index 9fb8584c..9d58b0ae 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 a3ffb870..a23b0cd9 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 ad7b29d1..d1225444 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 1ffff0ba..ae5a651f 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 bc093575..966b340c 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 37f97d13..3a982183 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 24978977..cf5bad98 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 90b389fe..74b656fe 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 a67bbce4..9ed79e32 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 f83d39f0..234f3b95 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 a1aed297..77077f59 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 1d4b3f5d..72594550 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/EEPROM24_8cpp_source.html b/EEPROM24_8cpp_source.html index 047497c4..2f8a556b 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 1dcf41b3..4660a35f 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 c5dc2925..705c8b2a 100644 --- a/Ed25519_8cpp_source.html +++ b/Ed25519_8cpp_source.html @@ -557,7 +557,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
static void reduceQuick_P(limb_t *result, const limb_t *x, const limb_t *y, size_t size)
Reduces x modulo y using subtraction where y is in program memory.
static void generatePrivateKey(uint8_t privateKey[32])
Generates a private key for Ed25519 signing operations.
Definition: Ed25519.cpp:243
static limb_t add(limb_t *result, const limb_t *x, const limb_t *y, size_t size)
Adds two big numbers.
-
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:298
+
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:428
static bool verify(const uint8_t signature[64], const uint8_t publicKey[32], const void *message, size_t len)
Verifies a signature using a specific Ed25519 public key.
Definition: Ed25519.cpp:189
SHA-512 hash algorithm.
Definition: SHA512.h:30
void reset()
Resets the hash ready for a new hashing process.
Definition: SHA512.cpp:66
@@ -572,7 +572,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Ed25519_8h_source.html b/Ed25519_8h_source.html index 7fa5430b..fd634079 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 8e99aae5..d12eccfe 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 33f254a1..360e00a0 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 60be9a98..90958eba 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 fd3a060b..a57f4794 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 d43afcfd..b90824ce 100644 --- a/GCM_8cpp_source.html +++ b/GCM_8cpp_source.html @@ -352,7 +352,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/GCM_8h_source.html b/GCM_8h_source.html index 9f57a7ee..492c3a79 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/GHASH_8cpp_source.html b/GHASH_8cpp_source.html index ba49cb2b..4c0f2ae3 100644 --- a/GHASH_8cpp_source.html +++ b/GHASH_8cpp_source.html @@ -239,7 +239,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/GHASH_8h_source.html b/GHASH_8h_source.html index e6b04711..b43ceee1 100644 --- a/GHASH_8h_source.html +++ b/GHASH_8h_source.html @@ -152,7 +152,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Hash_8cpp_source.html b/Hash_8cpp_source.html index 55cd34a6..fa4636c9 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 40526873..8c1d5f36 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 a1cdee6c..0bdd207c 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 2726a169..2b28eebe 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 f4fe5e9d..2d515d91 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 73bf9e30..651245fc 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 76631d50..30d7c3c2 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 e2a119d4..d2414bf9 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 e97fd80d..d45de28c 100644 --- a/KeccakCore_8cpp_source.html +++ b/KeccakCore_8cpp_source.html @@ -358,7 +358,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/KeccakCore_8h_source.html b/KeccakCore_8h_source.html index 454bb93e..9ea8e781 100644 --- a/KeccakCore_8h_source.html +++ b/KeccakCore_8h_source.html @@ -166,7 +166,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/LCD_8cpp_source.html b/LCD_8cpp_source.html index b976e359..223ad391 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 c9ddfd9d..dd0cbc6c 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 11876106..d1d3f4b9 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 f5a73098..90ed3ead 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/Melody_8cpp_source.html b/Melody_8cpp_source.html index 3eeea7e7..a540a88f 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 d7d2144d..9021c7d7 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 f124bd8a..4557f23a 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/NoiseSource_8cpp_source.html b/NoiseSource_8cpp_source.html index 3f21b91f..1a3363a4 100644 --- a/NoiseSource_8cpp_source.html +++ b/NoiseSource_8cpp_source.html @@ -134,11 +134,11 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
virtual void added()
Called when the noise source is added to RNG with RNG.addNoiseSource().
Definition: NoiseSource.cpp:95
virtual void output(const uint8_t *data, size_t len, unsigned int credit)
Called from subclasses to output noise to the global random number pool.
virtual ~NoiseSource()
Destroys this random noise source.
Definition: NoiseSource.cpp:43
-
void stir(const uint8_t *data, size_t len, unsigned int credit=0)
Stirs additional entropy data into the random pool.
Definition: RNG.cpp:408
+
void stir(const uint8_t *data, size_t len, unsigned int credit=0)
Stirs additional entropy data into the random pool.
Definition: RNG.cpp:538
diff --git a/NoiseSource_8h_source.html b/NoiseSource_8h_source.html index 7829d3b0..dccf3089 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 0e245ac6..6e802fce 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 00509463..9cc255d3 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/Poly1305_8cpp_source.html b/Poly1305_8cpp_source.html index 908c0137..c132e342 100644 --- a/Poly1305_8cpp_source.html +++ b/Poly1305_8cpp_source.html @@ -352,7 +352,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/Poly1305_8h_source.html b/Poly1305_8h_source.html index e38620d1..50a8138e 100644 --- a/Poly1305_8h_source.html +++ b/Poly1305_8h_source.html @@ -154,7 +154,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/PowerSave_8cpp_source.html b/PowerSave_8cpp_source.html index d69531f6..44cb71ff 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 5e01a728..d7f13e9c 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 15e4e9fd..16e019eb 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 0297fb58..a7346785 100644 --- a/RNG_8cpp_source.html +++ b/RNG_8cpp_source.html @@ -116,266 +116,434 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
26 #include "Crypto.h"
27 #include "utility/ProgMemUtil.h"
28 #include <Arduino.h>
-
29 #include <avr/eeprom.h>
-
30 #include <string.h>
-
31 
-
117 RNGClass RNG;
-
118 
-
124 // Number of ChaCha hash rounds to use for random number generation.
-
125 #define RNG_ROUNDS 20
-
126 
-
127 // Force a rekey after this many blocks of random data.
-
128 #define RNG_REKEY_BLOCKS 16
-
129 
-
130 // Maximum entropy credit that can be contained in the pool.
-
131 #define RNG_MAX_CREDITS 384
-
132 
-
135 // Tag for 256-bit ChaCha20 keys. This will always appear in the
-
136 // first 16 bytes of the block. The remaining 48 bytes are the seed.
-
137 static const char tagRNG[16] PROGMEM = {
-
138  'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
-
139  '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
-
140 };
-
141 
-
142 // Initialization seed. This is the ChaCha20 output of hashing
-
143 // "expand 32-byte k" followed by 48 bytes set to the numbers 1 to 48.
-
144 // The ChaCha20 output block is then truncated to the first 48 bytes.
-
145 //
-
146 // This value is intended to start the RNG in a semi-chaotic state if
-
147 // we don't have a previously saved seed in EEPROM.
-
148 static const uint8_t initRNG[48] PROGMEM = {
-
149  0xB0, 0x2A, 0xAE, 0x7D, 0xEE, 0xCB, 0xBB, 0xB1,
-
150  0xFC, 0x03, 0x6F, 0xDD, 0xDC, 0x7D, 0x76, 0x67,
-
151  0x0C, 0xE8, 0x1F, 0x0D, 0xA3, 0xA0, 0xAA, 0x1E,
-
152  0xB0, 0xBD, 0x72, 0x6B, 0x2B, 0x4C, 0x8A, 0x7E,
-
153  0x34, 0xFC, 0x37, 0x60, 0xF4, 0x1E, 0x22, 0xA0,
-
154  0x0B, 0xFB, 0x18, 0x84, 0x60, 0xA5, 0x77, 0x72
+
29 #if defined (__arm__) && defined (__SAM3X8E__)
+
30 // The Arduino Due does not have any EEPROM natively on the main chip.
+
31 // However, it does have a TRNG and flash memory.
+
32 #define RNG_DUE_TRNG 1
+
33 #else
+
34 #define RNG_EEPROM 1
+
35 #include <avr/eeprom.h>
+
36 #endif
+
37 #include <string.h>
+
38 
+
132 RNGClass RNG;
+
133 
+
139 // Number of ChaCha hash rounds to use for random number generation.
+
140 #define RNG_ROUNDS 20
+
141 
+
142 // Force a rekey after this many blocks of random data.
+
143 #define RNG_REKEY_BLOCKS 16
+
144 
+
145 // Maximum entropy credit that can be contained in the pool.
+
146 #define RNG_MAX_CREDITS 384
+
147 
+
150 // Tag for 256-bit ChaCha20 keys. This will always appear in the
+
151 // first 16 bytes of the block. The remaining 48 bytes are the seed.
+
152 static const char tagRNG[16] PROGMEM = {
+
153  'e', 'x', 'p', 'a', 'n', 'd', ' ', '3',
+
154  '2', '-', 'b', 'y', 't', 'e', ' ', 'k'
155 };
156 
-
167 RNGClass::RNGClass()
-
168  : address(0)
-
169  , credits(0)
-
170  , firstSave(1)
-
171  , timer(0)
-
172  , timeout(3600000UL) // 1 hour in milliseconds
-
173  , count(0)
-
174 {
-
175 }
-
176 
-
180 RNGClass::~RNGClass()
-
181 {
-
182  clean(block);
-
183  clean(stream);
-
184 }
-
185 
-
202 void RNGClass::begin(const char *tag, int eepromAddress)
-
203 {
-
204  // Save the EEPROM address for use by save().
-
205  address = eepromAddress;
-
206 
-
207  // Initialize the ChaCha20 input block from the saved seed.
-
208  memcpy_P(block, tagRNG, sizeof(tagRNG));
-
209  memcpy_P(block + 4, initRNG, sizeof(initRNG));
-
210  if (eeprom_read_byte((const uint8_t *)address) == 'S') {
-
211  // We have a saved seed: XOR it with the initialization block.
-
212  for (int posn = 0; posn < 12; ++posn) {
-
213  block[posn + 4] ^=
-
214  eeprom_read_dword((const uint32_t *)(address + posn * 4 + 1));
-
215  }
-
216  }
-
217 
-
218  // No entropy credits for the saved seed.
-
219  credits = 0;
-
220 
-
221  // Trigger an automatic save once the entropy credits max out.
-
222  firstSave = 1;
-
223 
-
224  // Rekey the random number generator immediately.
-
225  rekey();
-
226 
-
227  // Stir in the supplied tag data but don't credit any entropy to it.
-
228  if (tag)
-
229  stir((const uint8_t *)tag, strlen(tag));
-
230 
-
231  // Re-save the seed to obliterate the previous value and to ensure
-
232  // that if the system is reset without a call to save() that we won't
-
233  // accidentally generate the same sequence of random data again.
-
234  save();
-
235 }
-
236 
-
249 void RNGClass::addNoiseSource(NoiseSource &source)
-
250 {
-
251  #define MAX_NOISE_SOURCES (sizeof(noiseSources) / sizeof(noiseSources[0]))
-
252  if (count < MAX_NOISE_SOURCES) {
-
253  noiseSources[count++] = &source;
-
254  source.added();
-
255  }
-
256 }
+
157 // Initialization seed. This is the ChaCha20 output of hashing
+
158 // "expand 32-byte k" followed by 48 bytes set to the numbers 1 to 48.
+
159 // The ChaCha20 output block is then truncated to the first 48 bytes.
+
160 //
+
161 // This value is intended to start the RNG in a semi-chaotic state if
+
162 // we don't have a previously saved seed in EEPROM.
+
163 static const uint8_t initRNG[48] PROGMEM = {
+
164  0xB0, 0x2A, 0xAE, 0x7D, 0xEE, 0xCB, 0xBB, 0xB1,
+
165  0xFC, 0x03, 0x6F, 0xDD, 0xDC, 0x7D, 0x76, 0x67,
+
166  0x0C, 0xE8, 0x1F, 0x0D, 0xA3, 0xA0, 0xAA, 0x1E,
+
167  0xB0, 0xBD, 0x72, 0x6B, 0x2B, 0x4C, 0x8A, 0x7E,
+
168  0x34, 0xFC, 0x37, 0x60, 0xF4, 0x1E, 0x22, 0xA0,
+
169  0x0B, 0xFB, 0x18, 0x84, 0x60, 0xA5, 0x77, 0x72
+
170 };
+
171 
+
182 RNGClass::RNGClass()
+
183  : address(0)
+
184  , credits(0)
+
185  , firstSave(1)
+
186  , timer(0)
+
187  , timeout(3600000UL) // 1 hour in milliseconds
+
188  , count(0)
+
189  , trngPosn(0)
+
190 {
+
191 }
+
192 
+
196 RNGClass::~RNGClass()
+
197 {
+
198 #if defined(RNG_DUE_TRNG)
+
199  // Disable the TRNG in the Arduino Due.
+
200  REG_TRNG_CR = TRNG_CR_KEY(0x524E47);
+
201 #endif
+
202  clean(block);
+
203  clean(stream);
+
204 }
+
205 
+
206 #if defined(RNG_DUE_TRNG)
+
207 
+
208 // Find the flash memory of interest. Allow for the possibility
+
209 // of other SAM-based Arduino variants in the future.
+
210 #if defined(IFLASH1_ADDR)
+
211 #define RNG_FLASH_ADDR IFLASH1_ADDR
+
212 #define RNG_FLASH_SIZE IFLASH1_SIZE
+
213 #define RNG_FLASH_PAGE_SIZE IFLASH1_PAGE_SIZE
+
214 #define RNG_EFC EFC1
+
215 #elif defined(IFLASH0_ADDR)
+
216 #define RNG_FLASH_ADDR IFLASH0_ADDR
+
217 #define RNG_FLASH_SIZE IFLASH0_SIZE
+
218 #define RNG_FLASH_PAGE_SIZE IFLASH0_PAGE_SIZE
+
219 #define RNG_EFC EFC0
+
220 #else
+
221 #define RNG_FLASH_ADDR IFLASH_ADDR
+
222 #define RNG_FLASH_SIZE IFLASH_SIZE
+
223 #define RNG_FLASH_PAGE_SIZE IFLASH_PAGE_SIZE
+
224 #define RNG_EFC EFC
+
225 #endif
+
226 
+
227 // Address of the flash page to use for saving the seed on the Due.
+
228 // All SAM variants have a page size of 256 bytes or greater so there is
+
229 // plenty of room for the 48 byte seed in the last page of flash memory.
+
230 #define RNG_SEED_ADDR (RNG_FLASH_ADDR + RNG_FLASH_SIZE - RNG_FLASH_PAGE_SIZE)
+
231 #define RNG_SEED_PAGE ((RNG_FLASH_SIZE / RNG_FLASH_PAGE_SIZE) - 1)
+
232 
+
233 // Stir in the unique identifier for the Arduino Due's CPU.
+
234 // This function must be in RAM because programs running out of
+
235 // flash memory are not allowed to access the unique identifier.
+
236 // Info from: http://forum.arduino.cc/index.php?topic=289190.0
+
237 __attribute__((section(".ramfunc")))
+
238 static void stirUniqueIdentifier(void)
+
239 {
+
240  uint32_t id[4];
+
241 
+
242  // Start Read Unique Identifier.
+
243  RNG_EFC->EEFC_FCR = (0x5A << 24) | EFC_FCMD_STUI;
+
244  while ((RNG_EFC->EEFC_FSR & EEFC_FSR_FRDY) != 0)
+
245  ; // do nothing until FRDY falls.
+
246 
+
247  // Read the identifier.
+
248  id[0] = *((const uint32_t *)RNG_FLASH_ADDR);
+
249  id[1] = *((const uint32_t *)(RNG_FLASH_ADDR + 4));
+
250  id[2] = *((const uint32_t *)(RNG_FLASH_ADDR + 8));
+
251  id[3] = *((const uint32_t *)(RNG_FLASH_ADDR + 12));
+
252 
+
253  // Stop Read Unique Identifier.
+
254  RNG_EFC->EEFC_FCR = (0x5A << 24) | EFC_FCMD_SPUI;
+
255  while ((RNG_EFC->EEFC_FSR & EEFC_FSR_FRDY) == 0)
+
256  ; // do nothing until FRDY rises.
257 
-
274 void RNGClass::setAutoSaveTime(uint16_t minutes)
-
275 {
-
276  if (!minutes)
-
277  minutes = 1; // Just in case.
-
278  timeout = ((uint32_t)minutes) * 60000U;
-
279 }
-
280 
-
298 void RNGClass::rand(uint8_t *data, size_t len)
-
299 {
-
300  // Decrease the amount of entropy in the pool.
-
301  if (len > (credits / 8))
-
302  credits = 0;
-
303  else
-
304  credits -= len * 8;
-
305 
-
306  // Generate the random data.
-
307  uint8_t count = 0;
-
308  while (len > 0) {
-
309  // Force a rekey if we have generated too many blocks in this request.
-
310  if (count >= RNG_REKEY_BLOCKS) {
-
311  rekey();
-
312  count = 1;
-
313  } else {
-
314  ++count;
-
315  }
-
316 
-
317  // Increment the low counter word and generate a new keystream block.
-
318  ++(block[12]);
-
319  ChaCha::hashCore(stream, block, RNG_ROUNDS);
+
258  // Stir the unique identifier into the entropy pool.
+
259  RNG.stir((uint8_t *)id, sizeof(id));
+
260 }
+
261 
+
262 // Erases the flash page containing the seed and then writes the new seed.
+
263 // It is assumed the seed has already been loaded into the latch registers.
+
264 __attribute__((section(".ramfunc")))
+
265 static void eraseAndWriteSeed()
+
266 {
+
267  // Execute the "Erase and Write Page" command.
+
268  RNG_EFC->EEFC_FCR = (0x5A << 24) | (RNG_SEED_PAGE << 8) | EFC_FCMD_EWP;
+
269 
+
270  // Wait for the FRDY bit to be raised.
+
271  while ((RNG_EFC->EEFC_FSR & EEFC_FSR_FRDY) == 0)
+
272  ; // do nothing until FRDY rises.
+
273 }
+
274 
+
275 #endif
+
276 
+
296 void RNGClass::begin(const char *tag, int eepromAddress)
+
297 {
+
298  // Save the EEPROM address for use by save().
+
299  address = eepromAddress;
+
300 
+
301  // Initialize the ChaCha20 input block from the saved seed.
+
302  memcpy_P(block, tagRNG, sizeof(tagRNG));
+
303  memcpy_P(block + 4, initRNG, sizeof(initRNG));
+
304 #if defined(RNG_EEPROM)
+
305  if (eeprom_read_byte((const uint8_t *)address) == 'S') {
+
306  // We have a saved seed: XOR it with the initialization block.
+
307  for (int posn = 0; posn < 12; ++posn) {
+
308  block[posn + 4] ^=
+
309  eeprom_read_dword((const uint32_t *)(address + posn * 4 + 1));
+
310  }
+
311  }
+
312 #elif defined(RNG_DUE_TRNG)
+
313  // Do we have a seed saved in the last page of flash memory on the Due?
+
314  int posn, counter;
+
315  if (((const uint32_t *)RNG_SEED_ADDR)[0] == 'S') {
+
316  // XOR the saved seed with the initialization block.
+
317  for (posn = 0; posn < 12; ++posn)
+
318  block[posn + 4] ^= ((const uint32_t *)RNG_SEED_ADDR)[posn + 1];
+
319  }
320 
-
321  // Copy the data to the return buffer.
-
322  if (len < 64) {
-
323  memcpy(data, stream, len);
-
324  break;
-
325  } else {
-
326  memcpy(data, stream, 64);
-
327  data += 64;
-
328  len -= 64;
-
329  }
-
330  }
-
331 
-
332  // Force a rekey after every request.
-
333  rekey();
-
334 }
-
335 
-
375 bool RNGClass::available(size_t len) const
-
376 {
-
377  if (len >= (RNG_MAX_CREDITS / 8))
-
378  return credits >= RNG_MAX_CREDITS;
-
379  else
-
380  return len <= (credits / 8);
-
381 }
-
382 
-
408 void RNGClass::stir(const uint8_t *data, size_t len, unsigned int credit)
-
409 {
-
410  // Increase the entropy credit.
-
411  if ((credit / 8) >= len)
-
412  credit = len * 8;
-
413  if ((RNG_MAX_CREDITS - credits) > credit)
-
414  credits += credit;
-
415  else
-
416  credits = RNG_MAX_CREDITS;
-
417 
-
418  // Process the supplied input data.
-
419  if (len > 0) {
-
420  // XOR the data with the ChaCha input block in 48 byte
-
421  // chunks and rekey the ChaCha cipher for each chunk to mix
-
422  // the data in. This should scatter any "true entropy" in
-
423  // the input across the entire block.
-
424  while (len > 0) {
-
425  size_t templen = len;
-
426  if (templen > 48)
-
427  templen = 48;
-
428  uint8_t *output = ((uint8_t *)block) + 16;
-
429  len -= templen;
-
430  while (templen > 0) {
-
431  *output++ ^= *data++;
-
432  --templen;
-
433  }
-
434  rekey();
-
435  }
-
436  } else {
-
437  // There was no input data, so just force a rekey so we
-
438  // get some mixing of the state even without new data.
-
439  rekey();
-
440  }
-
441 
-
442  // Save if this is the first time we have reached max entropy.
-
443  // This provides some protection if the system is powered off before
-
444  // the first auto-save timeout occurs.
-
445  if (firstSave && credits >= RNG_MAX_CREDITS) {
-
446  firstSave = 0;
-
447  save();
-
448  }
-
449 }
+
321  // If the device has just been reprogrammed, there will be no saved seed.
+
322  // XOR the initialization block with some output from the CPU's TRNG
+
323  // to permute the state in a first boot situation after reprogramming.
+
324  pmc_enable_periph_clk(ID_TRNG);
+
325  REG_TRNG_CR = TRNG_CR_KEY(0x524E47) | TRNG_CR_ENABLE;
+
326  REG_TRNG_IDR = TRNG_IDR_DATRDY; // Disable interrupts - we will poll.
+
327  for (posn = 0; posn < 12; ++posn) {
+
328  // According to the documentation the TRNG should produce a new
+
329  // 32-bit random value every 84 clock cycles. If it still hasn't
+
330  // produced a value after 200 iterations, then assume that the
+
331  // TRNG is not producing output and stop.
+
332  for (counter = 0; counter < 200; ++counter) {
+
333  if ((REG_TRNG_ISR & TRNG_ISR_DATRDY) != 0)
+
334  break;
+
335  }
+
336  if (counter >= 200)
+
337  break;
+
338  block[posn + 4] ^= REG_TRNG_ODATA;
+
339  }
+
340 #endif
+
341 
+
342  // No entropy credits for the saved seed.
+
343  credits = 0;
+
344 
+
345  // Trigger an automatic save once the entropy credits max out.
+
346  firstSave = 1;
+
347 
+
348  // Rekey the random number generator immediately.
+
349  rekey();
+
350 
+
351  // Stir in the supplied tag data but don't credit any entropy to it.
+
352  if (tag)
+
353  stir((const uint8_t *)tag, strlen(tag));
+
354 
+
355 #if defined(RNG_DUE_TRNG)
+
356  // Stir in the unique identifier for the CPU so that different
+
357  // devices will give different outputs even without seeding.
+
358  stirUniqueIdentifier();
+
359 #endif
+
360 
+
361  // Re-save the seed to obliterate the previous value and to ensure
+
362  // that if the system is reset without a call to save() that we won't
+
363  // accidentally generate the same sequence of random data again.
+
364  save();
+
365 }
+
366 
+
379 void RNGClass::addNoiseSource(NoiseSource &source)
+
380 {
+
381  #define MAX_NOISE_SOURCES (sizeof(noiseSources) / sizeof(noiseSources[0]))
+
382  if (count < MAX_NOISE_SOURCES) {
+
383  noiseSources[count++] = &source;
+
384  source.added();
+
385  }
+
386 }
+
387 
+
404 void RNGClass::setAutoSaveTime(uint16_t minutes)
+
405 {
+
406  if (!minutes)
+
407  minutes = 1; // Just in case.
+
408  timeout = ((uint32_t)minutes) * 60000U;
+
409 }
+
410 
+
428 void RNGClass::rand(uint8_t *data, size_t len)
+
429 {
+
430  // Decrease the amount of entropy in the pool.
+
431  if (len > (credits / 8))
+
432  credits = 0;
+
433  else
+
434  credits -= len * 8;
+
435 
+
436  // Generate the random data.
+
437  uint8_t count = 0;
+
438  while (len > 0) {
+
439  // Force a rekey if we have generated too many blocks in this request.
+
440  if (count >= RNG_REKEY_BLOCKS) {
+
441  rekey();
+
442  count = 1;
+
443  } else {
+
444  ++count;
+
445  }
+
446 
+
447  // Increment the low counter word and generate a new keystream block.
+
448  ++(block[12]);
+
449  ChaCha::hashCore(stream, block, RNG_ROUNDS);
450 
-
477 void RNGClass::save()
-
478 {
-
479  // Generate random data from the current state and save
-
480  // that as the seed. Then force a rekey.
-
481  ++(block[12]);
-
482  ChaCha::hashCore(stream, block, RNG_ROUNDS);
-
483  eeprom_write_block(stream, (void *)(address + 1), 48);
-
484  eeprom_update_byte((uint8_t *)address, 'S');
-
485  rekey();
-
486  timer = millis();
-
487 }
-
488 
-
495 void RNGClass::loop()
-
496 {
-
497  // Stir in the entropy from all registered noise sources.
-
498  for (uint8_t posn = 0; posn < count; ++posn)
-
499  noiseSources[posn]->stir();
-
500 
-
501  // Save the seed if the auto-save timer has expired.
-
502  if ((millis() - timer) >= timeout)
-
503  save();
-
504 }
-
505 
-
525 void RNGClass::destroy()
-
526 {
-
527  clean(block);
-
528  clean(stream);
-
529  for (int posn = 0; posn < SEED_SIZE; ++posn)
-
530  eeprom_write_byte((uint8_t *)(address + posn), 0xFF);
-
531 }
-
532 
-
536 void RNGClass::rekey()
-
537 {
-
538  // Rekey the cipher for the next request by generating a new block.
-
539  // This is intended to make it difficult to wind the random number
-
540  // backwards if the state is captured later. The first 16 bytes of
-
541  // "block" remain set to "tagRNG".
-
542  ++(block[12]);
-
543  ChaCha::hashCore(stream, block, RNG_ROUNDS);
-
544  memcpy(block + 4, stream, 48);
-
545 
-
546  // Permute the high word of the counter using the system microsecond
-
547  // counter to introduce a little bit of non-stir randomness for each
-
548  // request. Note: If random data is requested on a predictable schedule
-
549  // then this may not help very much. It is still necessary to stir in
-
550  // high quality entropy data on a regular basis using stir().
-
551  block[13] ^= micros();
-
552 }
-
void save()
Saves the random seed to EEPROM.
Definition: RNG.cpp:477
-
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:298
-
void begin(const char *tag, int eepromAddress)
Initializes the random number generator.
Definition: RNG.cpp:202
+
451  // Copy the data to the return buffer.
+
452  if (len < 64) {
+
453  memcpy(data, stream, len);
+
454  break;
+
455  } else {
+
456  memcpy(data, stream, 64);
+
457  data += 64;
+
458  len -= 64;
+
459  }
+
460  }
+
461 
+
462  // Force a rekey after every request.
+
463  rekey();
+
464 }
+
465 
+
505 bool RNGClass::available(size_t len) const
+
506 {
+
507  if (len >= (RNG_MAX_CREDITS / 8))
+
508  return credits >= RNG_MAX_CREDITS;
+
509  else
+
510  return len <= (credits / 8);
+
511 }
+
512 
+
538 void RNGClass::stir(const uint8_t *data, size_t len, unsigned int credit)
+
539 {
+
540  // Increase the entropy credit.
+
541  if ((credit / 8) >= len)
+
542  credit = len * 8;
+
543  if ((RNG_MAX_CREDITS - credits) > credit)
+
544  credits += credit;
+
545  else
+
546  credits = RNG_MAX_CREDITS;
+
547 
+
548  // Process the supplied input data.
+
549  if (len > 0) {
+
550  // XOR the data with the ChaCha input block in 48 byte
+
551  // chunks and rekey the ChaCha cipher for each chunk to mix
+
552  // the data in. This should scatter any "true entropy" in
+
553  // the input across the entire block.
+
554  while (len > 0) {
+
555  size_t templen = len;
+
556  if (templen > 48)
+
557  templen = 48;
+
558  uint8_t *output = ((uint8_t *)block) + 16;
+
559  len -= templen;
+
560  while (templen > 0) {
+
561  *output++ ^= *data++;
+
562  --templen;
+
563  }
+
564  rekey();
+
565  }
+
566  } else {
+
567  // There was no input data, so just force a rekey so we
+
568  // get some mixing of the state even without new data.
+
569  rekey();
+
570  }
+
571 
+
572  // Save if this is the first time we have reached max entropy.
+
573  // This provides some protection if the system is powered off before
+
574  // the first auto-save timeout occurs.
+
575  if (firstSave && credits >= RNG_MAX_CREDITS) {
+
576  firstSave = 0;
+
577  save();
+
578  }
+
579 }
+
580 
+
607 void RNGClass::save()
+
608 {
+
609  // Generate random data from the current state and save
+
610  // that as the seed. Then force a rekey.
+
611  ++(block[12]);
+
612  ChaCha::hashCore(stream, block, RNG_ROUNDS);
+
613 #if defined(RNG_EEPROM)
+
614  eeprom_write_block(stream, (void *)(address + 1), 48);
+
615  eeprom_update_byte((uint8_t *)address, 'S');
+
616 #elif defined(RNG_DUE_TRNG)
+
617  unsigned posn;
+
618  ((uint32_t *)(RNG_SEED_ADDR))[0] = 'S';
+
619  for (posn = 0; posn < 12; ++posn)
+
620  ((uint32_t *)(RNG_SEED_ADDR))[posn + 1] = stream[posn];
+
621  for (posn = 13; posn < (RNG_FLASH_PAGE_SIZE / 4); ++posn)
+
622  ((uint32_t *)(RNG_SEED_ADDR))[posn + 13] = 0xFFFFFFFF;
+
623  eraseAndWriteSeed();
+
624 #endif
+
625  rekey();
+
626  timer = millis();
+
627 }
+
628 
+
635 void RNGClass::loop()
+
636 {
+
637  // Stir in the entropy from all registered noise sources.
+
638  for (uint8_t posn = 0; posn < count; ++posn)
+
639  noiseSources[posn]->stir();
+
640 
+
641 #if defined(RNG_DUE_TRNG)
+
642  // If there is data available from the Arudino Due's TRNG, then XOR
+
643  // it with the state block and increase the entropy credit. We don't
+
644  // call stir() yet because that will seriously slow down the system
+
645  // given how fast the TRNG is. Instead we save up the XOR'ed TRNG
+
646  // data until the next rand() call and then hash it to generate the
+
647  // desired output.
+
648  //
+
649  // The CPU documentation claims that the TRNG output is very good so
+
650  // this should only make the pool more and more random as time goes on.
+
651  // However there is a risk that the CPU manufacturer was pressured by
+
652  // government or intelligence agencies to insert a back door that
+
653  // generates predictable output. Or the manufacturer was overly
+
654  // optimistic about their TRNG design and it is actually flawed in a
+
655  // way they don't realise.
+
656  //
+
657  // If you are concerned about such threats, then make sure to mix in
+
658  // data from other noise sources. By hashing together the TRNG with
+
659  // the other noise data, rand() should produce unpredictable data even
+
660  // if one of the sources is actually predictable.
+
661  if ((REG_TRNG_ISR & TRNG_ISR_DATRDY) != 0) {
+
662  block[4 + trngPosn] ^= REG_TRNG_ODATA;
+
663  if (++trngPosn >= 12)
+
664  trngPosn = 0;
+
665  if (credits < RNG_MAX_CREDITS) {
+
666  // Credit 1 bit of entropy for the word. The TRNG should be
+
667  // better than this but it is so fast that we want to collect
+
668  // up more data before passing it to the application.
+
669  ++credits;
+
670  }
+
671  }
+
672 #endif
+
673 
+
674  // Save the seed if the auto-save timer has expired.
+
675  if ((millis() - timer) >= timeout)
+
676  save();
+
677 }
+
678 
+
698 void RNGClass::destroy()
+
699 {
+
700  clean(block);
+
701  clean(stream);
+
702 #if defined(RNG_EEPROM)
+
703  for (int posn = 0; posn < SEED_SIZE; ++posn)
+
704  eeprom_write_byte((uint8_t *)(address + posn), 0xFF);
+
705 #elif defined(RNG_DUE_TRNG)
+
706  for (unsigned posn = 0; posn < (RNG_FLASH_PAGE_SIZE / 4); ++posn)
+
707  ((uint32_t *)(RNG_SEED_ADDR))[posn] = 0xFFFFFFFF;
+
708  eraseAndWriteSeed();
+
709 #endif
+
710 }
+
711 
+
715 void RNGClass::rekey()
+
716 {
+
717  // Rekey the cipher for the next request by generating a new block.
+
718  // This is intended to make it difficult to wind the random number
+
719  // backwards if the state is captured later. The first 16 bytes of
+
720  // "block" remain set to "tagRNG".
+
721  ++(block[12]);
+
722  ChaCha::hashCore(stream, block, RNG_ROUNDS);
+
723  memcpy(block + 4, stream, 48);
+
724 
+
725  // Permute the high word of the counter using the system microsecond
+
726  // counter to introduce a little bit of non-stir randomness for each
+
727  // request. Note: If random data is requested on a predictable schedule
+
728  // then this may not help very much. It is still necessary to stir in
+
729  // high quality entropy data on a regular basis using stir().
+
730  block[13] ^= micros();
+
731 }
+
void save()
Saves the random seed to EEPROM.
Definition: RNG.cpp:607
+
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:428
+
void begin(const char *tag, int eepromAddress)
Initializes the random number generator.
Definition: RNG.cpp:296
Abstract base class for random noise sources.
Definition: NoiseSource.h:29
-
~RNGClass()
Destroys this random number generator instance.
Definition: RNG.cpp:180
+
~RNGClass()
Destroys this random number generator instance.
Definition: RNG.cpp:196
virtual void added()
Called when the noise source is added to RNG with RNG.addNoiseSource().
Definition: NoiseSource.cpp:95
-
void addNoiseSource(NoiseSource &source)
Adds a noise source to the random number generator.
Definition: RNG.cpp:249
-
RNGClass()
Constructs a new random number generator instance.
Definition: RNG.cpp:167
-
void destroy()
Destroys the data in the random number pool and the saved seed in EEPROM.
Definition: RNG.cpp:525
-
bool available(size_t len) const
Determine if there is sufficient entropy available for a specific request size.
Definition: RNG.cpp:375
-
void loop()
Run periodic housekeeping tasks on the random number generator.
Definition: RNG.cpp:495
+
void addNoiseSource(NoiseSource &source)
Adds a noise source to the random number generator.
Definition: RNG.cpp:379
+
RNGClass()
Constructs a new random number generator instance.
Definition: RNG.cpp:182
+
void destroy()
Destroys the data in the random number pool and the saved seed in EEPROM.
Definition: RNG.cpp:698
+
bool available(size_t len) const
Determine if there is sufficient entropy available for a specific request size.
Definition: RNG.cpp:505
+
void loop()
Run periodic housekeeping tasks on the random number generator.
Definition: RNG.cpp:635
Pseudo random number generator suitable for cryptography.
Definition: RNG.h:31
static const int SEED_SIZE
Size of a saved random number seed in EEPROM space.
Definition: RNG.h:53
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
-
void stir(const uint8_t *data, size_t len, unsigned int credit=0)
Stirs additional entropy data into the random pool.
Definition: RNG.cpp:408
-
void setAutoSaveTime(uint16_t minutes)
Sets the amount of time between automatic seed saves.
Definition: RNG.cpp:274
+
void stir(const uint8_t *data, size_t len, unsigned int credit=0)
Stirs additional entropy data into the random pool.
Definition: RNG.cpp:538
+
void setAutoSaveTime(uint16_t minutes)
Sets the amount of time between automatic seed saves.
Definition: RNG.cpp:404
diff --git a/RNG_8h_source.html b/RNG_8h_source.html index 35602b53..da1bff7b 100644 --- a/RNG_8h_source.html +++ b/RNG_8h_source.html @@ -152,31 +152,32 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
62  unsigned long timeout;
63  NoiseSource *noiseSources[4];
64  uint8_t count;
-
65 
-
66  void rekey();
-
67 };
-
68 
-
69 extern RNGClass RNG;
-
70 
-
71 #endif
-
void save()
Saves the random seed to EEPROM.
Definition: RNG.cpp:477
-
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:298
-
void begin(const char *tag, int eepromAddress)
Initializes the random number generator.
Definition: RNG.cpp:202
+
65  uint8_t trngPosn;
+
66 
+
67  void rekey();
+
68 };
+
69 
+
70 extern RNGClass RNG;
+
71 
+
72 #endif
+
void save()
Saves the random seed to EEPROM.
Definition: RNG.cpp:607
+
void rand(uint8_t *data, size_t len)
Generates random bytes into a caller-supplied buffer.
Definition: RNG.cpp:428
+
void begin(const char *tag, int eepromAddress)
Initializes the random number generator.
Definition: RNG.cpp:296
Abstract base class for random noise sources.
Definition: NoiseSource.h:29
-
~RNGClass()
Destroys this random number generator instance.
Definition: RNG.cpp:180
-
void addNoiseSource(NoiseSource &source)
Adds a noise source to the random number generator.
Definition: RNG.cpp:249
-
RNGClass()
Constructs a new random number generator instance.
Definition: RNG.cpp:167
-
void destroy()
Destroys the data in the random number pool and the saved seed in EEPROM.
Definition: RNG.cpp:525
-
bool available(size_t len) const
Determine if there is sufficient entropy available for a specific request size.
Definition: RNG.cpp:375
-
void loop()
Run periodic housekeeping tasks on the random number generator.
Definition: RNG.cpp:495
+
~RNGClass()
Destroys this random number generator instance.
Definition: RNG.cpp:196
+
void addNoiseSource(NoiseSource &source)
Adds a noise source to the random number generator.
Definition: RNG.cpp:379
+
RNGClass()
Constructs a new random number generator instance.
Definition: RNG.cpp:182
+
void destroy()
Destroys the data in the random number pool and the saved seed in EEPROM.
Definition: RNG.cpp:698
+
bool available(size_t len) const
Determine if there is sufficient entropy available for a specific request size.
Definition: RNG.cpp:505
+
void loop()
Run periodic housekeeping tasks on the random number generator.
Definition: RNG.cpp:635
Pseudo random number generator suitable for cryptography.
Definition: RNG.h:31
static const int SEED_SIZE
Size of a saved random number seed in EEPROM space.
Definition: RNG.h:53
-
void stir(const uint8_t *data, size_t len, unsigned int credit=0)
Stirs additional entropy data into the random pool.
Definition: RNG.cpp:408
-
void setAutoSaveTime(uint16_t minutes)
Sets the amount of time between automatic seed saves.
Definition: RNG.cpp:274
+
void stir(const uint8_t *data, size_t len, unsigned int credit=0)
Stirs additional entropy data into the random pool.
Definition: RNG.cpp:538
+
void setAutoSaveTime(uint16_t minutes)
Sets the amount of time between automatic seed saves.
Definition: RNG.cpp:404
diff --git a/RTC_8cpp_source.html b/RTC_8cpp_source.html index e2fb98a5..130b3630 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 9aca11d4..be51331e 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 276ad964..0491daa0 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 dee12fbc..8eb27654 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/SHA1_8cpp_source.html b/SHA1_8cpp_source.html index 567317b7..3d4eef7d 100644 --- a/SHA1_8cpp_source.html +++ b/SHA1_8cpp_source.html @@ -323,7 +323,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SHA1_8h_source.html b/SHA1_8h_source.html index 4bf274f4..dd0368e4 100644 --- a/SHA1_8h_source.html +++ b/SHA1_8h_source.html @@ -160,7 +160,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/SHA256_8cpp_source.html b/SHA256_8cpp_source.html index cb7d8098..63beda13 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 d0e17956..1e268912 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 fbd7b1b2..6fcce220 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 0f2c0fba..1b728472 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 6e3c4b8f..78dbf63a 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 fc785d10..d663b78d 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/SoftI2C_8cpp_source.html b/SoftI2C_8cpp_source.html index 022c53f4..46e5db28 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 cb86ec52..3e0935ae 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/TextField_8cpp_source.html b/TextField_8cpp_source.html index 0334c54a..8e1746ae 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 b6deb3e5..b12a8b89 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 53e775bc..90f02fa5 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 c6623e63..fee4f985 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 2edd55b8..5be5662a 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 d4d87b84..50ec0874 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/alarm-clock_8dox.html b/alarm-clock_8dox.html index 1a71d663..6171215e 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 4e77fee0..86d2dff7 100644 --- a/alarm_clock.html +++ b/alarm_clock.html @@ -140,7 +140,7 @@ Completed Clock diff --git a/annotated.html b/annotated.html index acd503ee..d6a16a32 100644 --- a/annotated.html +++ b/annotated.html @@ -156,7 +156,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/blink-blink_8dox.html b/blink-blink_8dox.html index 5252d303..7a68f6d5 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 f08d20a0..73480491 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 ccbd7d89..0376f9d8 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 b537d8de..e0508094 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 51813c81..ddc8cc88 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 ea115652..c4a5546a 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 9cd872bf..48cac7ba 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 77a535df..c583ff64 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 497f5ecd..00242eb0 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 c326400f..f9671fca 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 72982183..72e22eb3 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 3c72af60..077d82db 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 38a98598..5c327ff9 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 f83ec311..8ed9fa1e 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 7b308e72..a95b4824 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 86eb40f8..cb1b1359 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 d0770e9c..b739c552 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 3a4e7741..8dbb5389 100644 --- a/classAuthenticatedCipher.html +++ b/classAuthenticatedCipher.html @@ -349,7 +349,7 @@ virtual  diff --git a/classBLAKE2b-members.html b/classBLAKE2b-members.html index 2e329a94..667365ac 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 4d73d148..78dc02c6 100644 --- a/classBLAKE2b.html +++ b/classBLAKE2b.html @@ -536,7 +536,7 @@ Additional Inherited Members diff --git a/classBLAKE2s-members.html b/classBLAKE2s-members.html index af272dc9..fc134ca5 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 864ee690..430e5ac3 100644 --- a/classBLAKE2s.html +++ b/classBLAKE2s.html @@ -536,7 +536,7 @@ Additional Inherited Members diff --git a/classBigNumberUtil-members.html b/classBigNumberUtil-members.html index c239209e..65e6372b 100644 --- a/classBigNumberUtil-members.html +++ b/classBigNumberUtil-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classBigNumberUtil.html b/classBigNumberUtil.html index f2f90e68..6e70687f 100644 --- a/classBigNumberUtil.html +++ b/classBigNumberUtil.html @@ -140,7 +140,7 @@ Static Public Member Functions

Big numbers are represented as arrays of limb_t words, which may be 8 bits, 16 bits, or 32 bits in size depending upon how the library was configured. For AVR, 16 bit limbs usually give the best performance.

Limb arrays are ordered from the least significant word to the most significant.

-

Definition at line 52 of file BigNumberUtil.h.

+

Definition at line 59 of file BigNumberUtil.h.

Member Function Documentation

@@ -893,7 +893,7 @@ Static Public Member Functions
diff --git a/classBitmap-members.html b/classBitmap-members.html index 017c07f0..cfe93184 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 647963f5..f170e997 100644 --- a/classBitmap.html +++ b/classBitmap.html @@ -1745,7 +1745,7 @@ class DMD diff --git a/classBlinkLED-members.html b/classBlinkLED-members.html index c0cd8919..83235b69 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 6fb1c1e1..98118632 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 cb3b6c13..6e5d8f77 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 a0c4fcb1..0e354985 100644 --- a/classBlockCipher.html +++ b/classBlockCipher.html @@ -407,7 +407,7 @@ Public Member Functions diff --git a/classBoolField-members.html b/classBoolField-members.html index 81d40247..76d125f7 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 13f04b19..f886a123 100644 --- a/classBoolField.html +++ b/classBoolField.html @@ -506,7 +506,7 @@ LiquidCrystal *  diff --git a/classCBC-members.html b/classCBC-members.html index e9964d37..c5dbbfb2 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 64d57ea8..549972d0 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 3c4b3b51..78199a96 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 23a70408..763c1a19 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 58008bbb..0d242c2d 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 bba0b646..72051765 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 e3911e85..17557697 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 4226b4b7..8c9b15e1 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 94b0e31e..ccff66ac 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 2b43d14c..e356d131 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 075d8a78..45e1e494 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 10fad6a3..6518dcdc 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 1868a22b..cccbabd7 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 6b1233fa..0f1897b9 100644 --- a/classChaCha.html +++ b/classChaCha.html @@ -673,7 +673,7 @@ class ChaChaPoly< diff --git a/classChaChaPoly-members.html b/classChaChaPoly-members.html index 8a317b82..062dacbf 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 cf74762b..7ee6891b 100644 --- a/classChaChaPoly.html +++ b/classChaChaPoly.html @@ -665,7 +665,7 @@ virtual  diff --git a/classCharlieplex-members.html b/classCharlieplex-members.html index 38d8fabb..99d355f3 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 743c0c4e..c4dbe4eb 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 5fdb214d..fb9babbc 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 802a6e26..beaab8d0 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 79af7fb5..0a642d4b 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 120c2dc3..cf51d1a5 100644 --- a/classCipher.html +++ b/classCipher.html @@ -483,7 +483,7 @@ Public Member Functions diff --git a/classCurve25519-members.html b/classCurve25519-members.html index 4c85fda0..05a5890f 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 4d159ba5..5292226b 100644 --- a/classCurve25519.html +++ b/classCurve25519.html @@ -303,7 +303,7 @@ class Ed25519 diff --git a/classDMD-members.html b/classDMD-members.html index edb05182..e97372f5 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 b4830b26..5f3b5751 100644 --- a/classDMD.html +++ b/classDMD.html @@ -755,7 +755,7 @@ Multiple panels diff --git a/classDS1307RTC-members.html b/classDS1307RTC-members.html index 2d20c7c3..6c380906 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 622178c7..3a682b41 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 4db49e04..6e8d6437 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 4b05cfdf..31f33a8b 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 59fb3634..ec4187dd 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 f478ef44..75eb4a3b 100644 --- a/classDS3232RTC.html +++ b/classDS3232RTC.html @@ -750,7 +750,7 @@ static const uint8_t  diff --git a/classEEPROM24-members.html b/classEEPROM24-members.html index 7dbc4fd1..cff501d5 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 73ad9077..24684518 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 447e5675..48a0c7eb 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 a0dd79f3..949e8765 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 a8ba02a0..e7f882d6 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 de9e32b4..61b2204b 100644 --- a/classField.html +++ b/classField.html @@ -424,7 +424,7 @@ class Form diff --git a/classForm-members.html b/classForm-members.html index 462a6190..5f241a3e 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 0644de6e..66f1c3af 100644 --- a/classForm.html +++ b/classForm.html @@ -485,7 +485,7 @@ class Field diff --git a/classGCM-members.html b/classGCM-members.html index 3a70ffb4..efa06dd8 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 7c334781..b5faddd8 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 982ad9c9..0e309b22 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 feea9069..b996f968 100644 --- a/classGCMCommon.html +++ b/classGCMCommon.html @@ -736,7 +736,7 @@ Protected Member Functions diff --git a/classGHASH-members.html b/classGHASH-members.html index 5216e92f..fe4bb682 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 93cce48a..2f339f12 100644 --- a/classGHASH.html +++ b/classGHASH.html @@ -265,7 +265,7 @@ void  diff --git a/classHash-members.html b/classHash-members.html index 054872a9..7bf3ada7 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 5f0ef59c..2d71a516 100644 --- a/classHash.html +++ b/classHash.html @@ -576,7 +576,7 @@ Protected Member Functions diff --git a/classI2CMaster-members.html b/classI2CMaster-members.html index 28625fd5..d2ffadd8 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 cce49b64..cf1adab7 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 7de8a990..e2aef896 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 92cc4ee5..a94c74c1 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 f0d3736c..2cd0c076 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 6d6f632d..96d24535 100644 --- a/classIntField.html +++ b/classIntField.html @@ -647,7 +647,7 @@ LiquidCrystal *  diff --git a/classKeccakCore-members.html b/classKeccakCore-members.html index c20b3412..e514bf9e 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 22806891..1375f4c8 100644 --- a/classKeccakCore.html +++ b/classKeccakCore.html @@ -425,7 +425,7 @@ void  diff --git a/classLCD-members.html b/classLCD-members.html index b3f7a604..c138e364 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 e7c97bef..57969f23 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 89347bad..aca625f4 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 8feeceb1..e0fa334a 100644 --- a/classListField.html +++ b/classListField.html @@ -411,7 +411,7 @@ LiquidCrystal *  diff --git a/classMelody-members.html b/classMelody-members.html index 3d73cb4f..bf031e37 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 3ebfaaf3..bfdb6f30 100644 --- a/classMelody.html +++ b/classMelody.html @@ -371,7 +371,7 @@ bool  diff --git a/classNoiseSource-members.html b/classNoiseSource-members.html index 2dce426e..44930677 100644 --- a/classNoiseSource-members.html +++ b/classNoiseSource-members.html @@ -99,7 +99,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classNoiseSource.html b/classNoiseSource.html index 5cbbe755..034212cd 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 beadcbc6..4c17a655 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 5218bd73..4ed1b749 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 4d223a0e..96084265 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 13329e1f..fabaef88 100644 --- a/classOFBCommon.html +++ b/classOFBCommon.html @@ -534,7 +534,7 @@ Protected Member Functions diff --git a/classPoly1305-members.html b/classPoly1305-members.html index a1b9cea6..2553c25e 100644 --- a/classPoly1305-members.html +++ b/classPoly1305-members.html @@ -105,7 +105,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classPoly1305.html b/classPoly1305.html index 8933bec6..d96768f3 100644 --- a/classPoly1305.html +++ b/classPoly1305.html @@ -280,7 +280,7 @@ void  diff --git a/classRNGClass-members.html b/classRNGClass-members.html index 10d420b2..46af2c6d 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 89268595..9821ef6c 100644 --- a/classRNGClass.html +++ b/classRNGClass.html @@ -190,6 +190,7 @@ static const int loop() function will automatically save the random number seed on a regular basis. By default the seed is saved every hour but this can be changed using setAutoSaveTime().

Keep in mind that saving too often may cause the EEPROM to wear out quicker. It is wise to limit saving to once an hour or once a day depending upon how long you intend to field the device before replacing it. For example, an EEPROM rated for 100k erase/write cycles will last about 69 days saving once a minute or 11 years saving once an hour.

The application can still elect to call save() at any time if wants. For example, if the application can detect power loss or shutdown conditions programmatically, then it may make sense to force a save() of the seed upon shutdown.

+

The Arduino Due does not have EEPROM so RNG saves the seed into the last page of system flash memory instead. The RNG class will also mix in data from the CPU's built-in True Random Number Generator (TRNG). Assuming that the CPU's TRNG is trustworthy, this should be sufficient to properly seed the random number generator. It is recommended to also mix in data from other noise sources just in case the CPU's TRNG is not trustworthy.

See Also
NoiseSource

Definition at line 31 of file RNG.h.

@@ -211,7 +212,7 @@ static const int begin() to properly initialize the random number generator.

See Also
begin()
-

Definition at line 167 of file RNG.cpp.

+

Definition at line 182 of file RNG.cpp.

@@ -240,7 +241,7 @@ static const int NoiseSource::stir() directly.

See Also
loop(), begin()
-

Definition at line 249 of file RNG.cpp.

+

Definition at line 379 of file RNG.cpp.

@@ -283,7 +284,7 @@ static const int 
See Also
rand()
-

Definition at line 375 of file RNG.cpp.

+

Definition at line 505 of file RNG.cpp.

@@ -320,9 +321,10 @@ static const int addNoiseSource() to register the application's noise sources.

+

The eepromAddress is ignored on the Arduino Due. The seed is instead stored in the last page of system flash memory.

See Also
addNoiseSource(), stir(), save()
-

Definition at line 202 of file RNG.cpp.

+

Definition at line 296 of file RNG.cpp.

@@ -345,7 +347,7 @@ static const int 
Note
The rand() and save() functions take some care to manage the random number pool in a way that makes prediction of past outputs from a captured state very difficult. Future outputs may be predictable if noise or other high-entropy data is not mixed in with stir() on a regular basis.
See Also
begin()
-

Definition at line 525 of file RNG.cpp.

+

Definition at line 698 of file RNG.cpp.

@@ -365,7 +367,7 @@ static const int  -

Definition at line 495 of file RNG.cpp.

+

Definition at line 635 of file RNG.cpp.

@@ -405,7 +407,7 @@ static const int available() function can be polled to determine when sufficient entropy is available.

See Also
available(), stir()
-

Definition at line 298 of file RNG.cpp.

+

Definition at line 428 of file RNG.cpp.

@@ -429,7 +431,7 @@ static const int stir() in new noise data at startup.

See Also
loop(), stir()
-

Definition at line 477 of file RNG.cpp.

+

Definition at line 607 of file RNG.cpp.

@@ -458,7 +460,7 @@ static const int 
See Also
save(), stir()
-

Definition at line 274 of file RNG.cpp.

+

Definition at line 404 of file RNG.cpp.

@@ -506,7 +508,7 @@ static const int 
loop()
-

Definition at line 408 of file RNG.cpp.

+

Definition at line 538 of file RNG.cpp.

@@ -517,7 +519,7 @@ static const int  diff --git a/classRTC-members.html b/classRTC-members.html index 92ead22c..4f77209c 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 1374be96..7d4b0c92 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 3884f1e4..e9c5a194 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 9dbea9d2..29d0d317 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 4f2a9494..72de4949 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 645fbef0..0f37b6ba 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 ce7a3880..5eaf4123 100644 --- a/classRingOscillatorNoiseSource.html +++ b/classRingOscillatorNoiseSource.html @@ -253,7 +253,7 @@ Additional Inherited Members diff --git a/classSHA1-members.html b/classSHA1-members.html index f3a1ec92..66c58775 100644 --- a/classSHA1-members.html +++ b/classSHA1-members.html @@ -110,7 +110,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/classSHA1.html b/classSHA1.html index dd835283..d21001a8 100644 --- a/classSHA1.html +++ b/classSHA1.html @@ -506,7 +506,7 @@ Additional Inherited Members diff --git a/classSHA256-members.html b/classSHA256-members.html index b1fa51e7..2539ee2b 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 70ad4346..d1e20b75 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 b52841fc..e3240413 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 4d55f814..905aca88 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 7970d5fd..71bca1b0 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 912a6384..4c2fa875 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 ebe742a5..002b0dce 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 9c7ba08f..e951da6d 100644 --- a/classSHA512.html +++ b/classSHA512.html @@ -513,7 +513,7 @@ Additional Inherited Members diff --git a/classSoftI2C-members.html b/classSoftI2C-members.html index bbc7a999..e4e6a6cf 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 90c851cf..d5c9819b 100644 --- a/classSoftI2C.html +++ b/classSoftI2C.html @@ -346,7 +346,7 @@ unsigned int  diff --git a/classTextField-members.html b/classTextField-members.html index 1b4ee300..aeab59bc 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 3ec734cd..c26f383a 100644 --- a/classTextField.html +++ b/classTextField.html @@ -343,7 +343,7 @@ LiquidCrystal *  diff --git a/classTimeField-members.html b/classTimeField-members.html index 8e4b4a5d..e975fddc 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 c931cf60..4a9f63e3 100644 --- a/classTimeField.html +++ b/classTimeField.html @@ -541,7 +541,7 @@ LiquidCrystal *  diff --git a/classTransistorNoiseSource-members.html b/classTransistorNoiseSource-members.html index 7f815e98..a160de33 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 a2fb0739..437fc363 100644 --- a/classTransistorNoiseSource.html +++ b/classTransistorNoiseSource.html @@ -280,7 +280,7 @@ Additional Inherited Members diff --git a/classes.html b/classes.html index a4079969..beded399 100644 --- a/classes.html +++ b/classes.html @@ -133,7 +133,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); diff --git a/crypto-rng-ring_8dox.html b/crypto-rng-ring_8dox.html index dccb1add..5acf9aee 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 f5bb9f08..9b064792 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 9db07f09..f4c3d835 100644 --- a/crypto.html +++ b/crypto.html @@ -101,6 +101,8 @@ Examples and other topics

Performance

+

+Performance on AVR

All figures are for the Arduino Uno running at 16 MHz. Figures for the Ardunino Mega 2560 running at 16 MHz are similar:

@@ -178,11 +180,90 @@ Performance
Ed25519::derivePublicKey()5642msDerive a public key from a private key
-

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.

+

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.

+

+Performance on ARM

+

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Encryption AlgorithmEncryption (per byte)Decryption (per byte)Key SetupState Size (bytes)
AES128 (ECB mode)6.65us11.00us35.15us220
AES192 (ECB mode)8.02us13.31us36.59us252
AES256 (ECB mode)9.39us15.6350.19us284
ChaCha (20 rounds)0.87us0.88us4.96us136
ChaCha (12 rounds)0.70us0.71us4.96us136
ChaCha (8 rounds)0.62us0.62us4.96us136
AEAD AlgorithmEncryption (per byte)Decryption (per byte)Key SetupState Size (bytes)
ChaChaPoly1.66us1.66us45.02us280
GCM<AES128>11.01us10.92us247.90us344
GCM<AES192>12.40us12.31us294.07us376
GCM<AES256>13.73us13.64us347.40us408
Hash AlgorithmHashing (per byte)FinalizationState Size (bytes)
SHA10.94us62.55us112
SHA2561.15us76.60us120
SHA5122.87us370.37us224
SHA3_2565.36us697.65us424
SHA3_5129.89us697.81us424
BLAKE2s0.76us50.88us184
BLAKE2b1.33us170.93us352
Authentication AlgorithmHashing (per byte)FinalizationKey SetupState Size (bytes)
SHA1 (HMAC mode)0.94us193.92us65.09us112
SHA256 (HMAC mode)1.15us238.98us80.44us120
BLAKE2s (HMAC mode)0.76us165.64us59.92us184
Poly13050.85us19.25us2.35us96
GHASH4.37us1.50us4.37us36
Public Key OperationTime (per operation)Comment
Curve25519::eval()103msRaw curve evaluation
Curve25519::dh1()103msFirst half of Diffie-Hellman key agreement
Curve25519::dh2()104msSecond half of Diffie-Hellman key agreement
Ed25519::sign()195msDigital signature generation
Ed25519::verify()306msDigital signature verification
Ed25519::derivePublicKey()194msDerive a public key from a private key
diff --git a/crypto_8dox.html b/crypto_8dox.html index f33d3ebf..8c37d7bb 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 6e2235c1..6aabf18a 100644 --- a/crypto_rng.html +++ b/crypto_rng.html @@ -86,6 +86,7 @@ Features of the random number generator