@@ -31,10 +31,10 @@ impl Error {
3131 pub const UNSUPPORTED : Error = internal_error ! ( 0 ) ;
3232 /// The platform-specific `errno` returned a non-positive value.
3333 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 ) ;
3838 /// RDRAND instruction failed due to a hardware issue.
3939 pub const FAILED_RDRAND : Error = internal_error ! ( 5 ) ;
4040 /// RDRAND instruction unsupported on this target.
@@ -47,8 +47,8 @@ impl Error {
4747 pub const STDWEB_NO_RNG : Error = internal_error ! ( 9 ) ;
4848 /// Using `stdweb`, invoking a cryptographic RNG failed.
4949 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 ) ;
5252
5353 /// Codes below this point represent OS Errors (i.e. positive i32 values).
5454 /// Codes at or above this point, but below [`Error::CUSTOM_START`] are
@@ -155,15 +155,15 @@ fn internal_desc(error: Error) -> Option<&'static str> {
155155 match error {
156156 Error :: UNSUPPORTED => Some ( "getrandom: this target is not supported" ) ,
157157 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 " ) ,
160160 Error :: FAILED_RDRAND => Some ( "RDRAND: failed multiple times: CPU issue likely" ) ,
161161 Error :: NO_RDRAND => Some ( "RDRAND: instruction not supported" ) ,
162162 Error :: BINDGEN_CRYPTO_UNDEF => Some ( "wasm-bindgen: self.crypto is undefined" ) ,
163163 Error :: BINDGEN_GRV_UNDEF => Some ( "wasm-bindgen: crypto.getRandomValues is undefined" ) ,
164164 Error :: STDWEB_NO_RNG => Some ( "stdweb: no randomness source available" ) ,
165165 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" ) ,
167167 _ => None ,
168168 }
169169}
0 commit comments