@@ -31,10 +31,10 @@ impl Error {
31
31
pub const UNSUPPORTED : Error = internal_error ! ( 0 ) ;
32
32
/// The platform-specific `errno` returned a non-positive value.
33
33
pub const ERRNO_NOT_POSITIVE : Error = internal_error ! ( 1 ) ;
34
- /// Call to [`SecRandomCopyBytes`](https://developer.apple.com/documentation/security/1399291-secrandomcopybytes) failed.
35
- pub const SEC_RANDOM_FAILED : Error = internal_error ! ( 3 ) ;
36
- /// Call to [`RtlGenRandom`](https://docs.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom) failed.
37
- pub const RTL_GEN_RANDOM_FAILED : Error = internal_error ! ( 4 ) ;
34
+ /// Call to iOS [`SecRandomCopyBytes`](https://developer.apple.com/documentation/security/1399291-secrandomcopybytes) failed.
35
+ pub const IOS_SEC_RANDOM : Error = internal_error ! ( 3 ) ;
36
+ /// Call to Windows [`RtlGenRandom`](https://docs.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom) failed.
37
+ pub const WINDOWS_RTL_GEN_RANDOM : Error = internal_error ! ( 4 ) ;
38
38
/// RDRAND instruction failed due to a hardware issue.
39
39
pub const FAILED_RDRAND : Error = internal_error ! ( 5 ) ;
40
40
/// RDRAND instruction unsupported on this target.
@@ -47,8 +47,8 @@ impl Error {
47
47
pub const STDWEB_NO_RNG : Error = internal_error ! ( 9 ) ;
48
48
/// Using `stdweb`, invoking a cryptographic RNG failed.
49
49
pub const STDWEB_RNG_FAILED : Error = internal_error ! ( 10 ) ;
50
- /// On VxWorks, random number generator is not yet initialized.
51
- pub const RAND_SECURE_FATAL : Error = internal_error ! ( 11 ) ;
50
+ /// On VxWorks, call to `randSecure` failed ( random number generator is not yet initialized) .
51
+ pub const VXWORKS_RAND_SECURE : Error = internal_error ! ( 11 ) ;
52
52
53
53
/// Codes below this point represent OS Errors (i.e. positive i32 values).
54
54
/// Codes at or above this point, but below [`Error::CUSTOM_START`] are
@@ -155,15 +155,15 @@ fn internal_desc(error: Error) -> Option<&'static str> {
155
155
match error {
156
156
Error :: UNSUPPORTED => Some ( "getrandom: this target is not supported" ) ,
157
157
Error :: ERRNO_NOT_POSITIVE => Some ( "errno: did not return a positive value" ) ,
158
- Error :: SEC_RANDOM_FAILED => Some ( "SecRandomCopyBytes: call failed " ) ,
159
- Error :: RTL_GEN_RANDOM_FAILED => Some ( "RtlGenRandom: call failed " ) ,
158
+ Error :: IOS_SEC_RANDOM => Some ( "SecRandomCopyBytes: iOS Secuirty framework failure " ) ,
159
+ Error :: WINDOWS_RTL_GEN_RANDOM => Some ( "RtlGenRandom: Windows system function failure " ) ,
160
160
Error :: FAILED_RDRAND => Some ( "RDRAND: failed multiple times: CPU issue likely" ) ,
161
161
Error :: NO_RDRAND => Some ( "RDRAND: instruction not supported" ) ,
162
162
Error :: BINDGEN_CRYPTO_UNDEF => Some ( "wasm-bindgen: self.crypto is undefined" ) ,
163
163
Error :: BINDGEN_GRV_UNDEF => Some ( "wasm-bindgen: crypto.getRandomValues is undefined" ) ,
164
164
Error :: STDWEB_NO_RNG => Some ( "stdweb: no randomness source available" ) ,
165
165
Error :: STDWEB_RNG_FAILED => Some ( "stdweb: failed to get randomness" ) ,
166
- Error :: RAND_SECURE_FATAL => Some ( "randSecure: VxWorks RNG module is not initialized" ) ,
166
+ Error :: VXWORKS_RAND_SECURE => Some ( "randSecure: VxWorks RNG module is not initialized" ) ,
167
167
_ => None ,
168
168
}
169
169
}
0 commit comments