seed
Seed for cryptographic random bit generators
The seed CSR provides an interface to a NIST SP 800-90B (Turan et al., 2018) or BSI AIS-31 (Killmann & Schindler, 2011) compliant physical Entropy Source (ES).
The CSR provides up to 16 physical entropy bits that can be used to seed cryptographic random bit generators. The write value is ignored by implementations; the write is used to signal polling and flushing.
Attributes
Requirement |
|||
|---|---|---|---|
Defining extensions |
|
||
CSR Address |
0x15 |
||
Length |
32-bit |
||
Privilege Mode |
U |
Fields
Software write
This CSR may store a value that is different from what software attempts to write.
When a software write occurs (e.g., through csrrw), the following determines the written value:
OPST = write_seed();
return CSR[seed].OPST;
ENTROPY = return CSR[seed].ENTROPY;
Software read
This CSR may return a value that is different from what is stored in hardware.
Boolean read_only_access = ($encoding[13] == 1'b1) && ($encoding[19:15] == 5'b00000);
if (read_only_access) {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
if (mode() == PrivilegeMode::U && CSR[mseccfg].USEED == 1'b0) {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
} else if (mode() == PrivilegeMode::S && CSR[mseccfg].SSEED == 1'b0) {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
} else if (mode() == PrivilegeMode::VS || mode() == PrivilegeMode::VU) {
if (CSR[mseccfg].SSEED == 1'b1) {
raise(ExceptionCode::VirtualInstruction, mode(), $encoding);
} else {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
}
return read_seed();