STM32F7 19 True random number generator (RNG)

Started by tha, December 16, 2022, 08:26:33 AM

Previous topic - Next topic

tha

19.5 RNG interrupts

ใน the RNG an interrupt สามารถถูกผลิตบน the following events:
•   Data ready flag
•   Seed error, ดู Section 19.3.7: Error management
•   Clock error, ดู Section 19.3.7: Error management

Dedicated interrupt enable control bits มีให้ใช้งานดังที่แสดงใน Table 122



ผู้ใช้สามารถเปิดใช้งานหรือปิดใช้งาน the above interrupt sources เฉพาะรายไปโดยการเปลี่ยน the mask bits หรือ the general interrupt control bit IE ใน the RNG_CR register. สถานะของ the individual interrupt sources สามารถถูกอ่านจาก the RNG_SR register.

Note:  Interrupts ถูกสร้างเฉพาะเมื่อ RNG ถูกเปิดใช้งาน.

tha

19.6 RNG processing time

The RNG สามารถผลิต one 32-bit random numbers ทุกๆ 42 RNG clock cycles.

หลังจากการเปิดใช้งานหรือการเปิดใช้งานใหม่ the RNG โดยใช้ the RNGEN bit มันใช้ 46 RNG clock cycles ก่อน random data มีให้ใช้งาน.

tha

19.7 Entropy source validation

19.7.1 Introduction

เพื่อประเมินปริมาณของ entropy ที่มีให้ใช้งานจาก the RNG, STMicroelectronics ทดสอบ the peripheral กับชุดทดสอบ AIS-31 PTG.2. The results สามารถถูกจัดให้มีที่ความต้องการหรือลูกค้าสามารถสร้างการวัดซ้ำโดยใช้ the AIS reference software. ลูกค้ายังสามารถทดสอบ the RNG กับชุดทดสอบ an older NIST SP800-22.


tha

19.7.2 Validation conditions

STMicroelectronics ได้ตรวจสอบ the RNG true random number generator ในเงื่อนไขต่อไปนี้:
•   RNG clock rng_clk= 48 MHz (CED bit = '0' ใน RNG_CR register) และ rng_clk= 400kHz (CED bit="1" ใน RNG_CR)
•   AHB clock rng_hclk= 60 MHz

tha

19.7.3 Data collection

ถ้า raw data จำเป็นต้องถูกอ่านแทน pre-processed data นักพัฒนาซอฟต์แวร์จะได้รับคำเชิญให้ติดต่อ STMicroelectronics เพื่อรับขั้นตอนที่ถูกต้องเพื่อทำตาม.

tha

19.8 RNG registers

The RNG ถูกเกี่ยวข้องกับ a control register, a data register และ a status register.

19.8.1 RNG control register (RNG_CR)

Address offset: 0x000
Reset value: 0x0000 0000



Bits 31:6 Reserved, must be kept at reset value

Bit 5 CED: Clock error detection
     0: Clock error detection เปิดใช้งาน
     1: Clock error detection ปิดใช้งาน
     The clock error detection ไม่สามารถถูกเปิดใช้งานหรือปิดใช้งานกลางทางได้เมื่อ the RNG ถูกเปิดใช้งาน, ตัวอย่างเช่น เพื่อเปิดใช้
      งานหรือปิดใช้งาน CED the RNG ต้องถูกปิดใช้งาน.

Bit 4 Reserved, must be kept at reset value.

Bit 3 IE: Interrupt Enable
     0: RNG Interrupt ถูกปิดใช้งาน
     1: RNG Interrupt ถูกเปิดใช้งาน. An interrupt จะค้างอยู่ทันทีที่ DRDY='1', SEIS='1' หรือ CEIS='1' ใน the RNG_SR
          register.

Bit 2 RNGEN: True random number generator enable
     0: True random number generator ถูกปิดใช้งาน. Analog noise sources ถูก powered off และ logic ที่ให้สัญญานนาฬิกา
          โดย the RNG clock จะถูกปิดประตู.
     1: True random number generator ถูกเปิดใช้งาน.

Bits 1:0 Reserved, must be kept at reset value.

tha

19.8.2 RNG status register (RNG_SR)

Address offset: 0x004
Reset value: 0x0000 0000



Bits 31:7 Reserved, must be kept at reset value.

Bit 6 SEIS: Seed error interrupt status
     บิตนี้ถูกเซ็ตในเวลาเดียวกันกับ SECS. มันจะถูกเคลียร์โดยการเขียนมันเป็น '0'.
     0: ไม่มี faulty sequence ถูกตรวจพบ
     1: อย่างน้อยหนึ่ง faulty sequence ถูกตรวจพบแล้ว. ดู SECS bit description สำหรับรายละเอียด.
     An interrupt จะค้างอยู่ถ้า IE = '1' ใน the RNG_CR register.

Bit 5 CEIS: Clock error interrupt status
     บิตนี้ถูกเซ็ตในเวลาเดียวกันกับ CECS. มันจะถูกเคลียร์โดยการเขียนมันเป็น '0'.
     0: The RNG clock ถูกต้อง (fRNGCLK > fHCLK/16)
     1: The RNG ถูกตรวจพบว่าช้าเกินไปแล้ว (fRNGCLK < fHCLK/16)
     An interrupt จะค้างอยู่ถ้า IE = '1' ใน the RNG_CR register.

tha

Bits 4:3 Reserved, must be kept at reset value.

Bit 2 SECS: Seed error current status
     0: ไม่มี faulty sequence ถูกตรวจพบในขณะนี้. ถ้า the SEIS bit ถูกเซ็ต, นี้หมายความว่า a faulty sequence เคยถูกตรวจพบและ
          สถานการณ์ถูกกู้คืนแล้ว.
     1: หนึ่งใน the noise source จัดให้มีมากกว่า 64 บิตที่ติดต่อกันที่ a constant value ("0" หรือ "1") หรือมากกว่า 32 การเกิดขึ้นที่
          ติดต่อกันของ two bits patterns ("01" หรือ "10")

Bit 1 CECS: Clock error current status
     0: The RNG clock ถูกต้อง (fRNGCLK> fHCLK/16). ถ้า the CEIS bit ถูกเซ็ต, นี้หมายความว่า a slow clock เคยถูกตรวจพบ
          และสถานการณ์ถูกกู้คืนแล้ว.
     1: The RNG clock ช้าเกินไป (fRNGCLK< fHCLK/16).
  Note:  CECS bit ใช้ได้เฉพาะถ้า the CED bit ใน the RNG_CR register ถูกเซ็ตเป็น "0".

Bit 0 DRDY: Data Ready
     0: The RNG_DR register ยังใช้ไม่ได้, ไม่มี random data มีให้ใช้งาน.
     1: The RNG_DR register บรรจุ valid random data.
     ทันทีที่ the RNG_DR register ถูกอ่านแล้ว, บิตนี้จะกลับคืนเป็น '0' จนกว่า a new random value จะถูกสร้าง.
     ถ้า IE='1' ใน the RNG_CR register, an interrupt จะถูกสร้างเมื่อ DRDY='1'.