49
49
//! ```
50
50
#![ cfg_attr( not( test) , no_std) ]
51
51
52
+ #[ cfg( not( feature = "alloc" ) ) ]
53
+ compile_error ! ( "This crate does not yet support environments without liballoc. See https://github.com/RustCrypto/RSA/issues/51." ) ;
54
+
52
55
#[ cfg( feature = "alloc" ) ]
53
56
extern crate alloc;
54
57
#[ cfg( feature = "std" ) ]
@@ -67,40 +70,55 @@ extern crate hex;
67
70
#[ cfg( all( test, feature = "serde" ) ) ]
68
71
extern crate serde_test;
69
72
73
+ #[ cfg( feature = "alloc" ) ]
70
74
pub use num_bigint:: BigUint ;
71
75
72
76
/// Useful algorithms.
77
+ #[ cfg( feature = "alloc" ) ]
73
78
pub mod algorithms;
74
79
75
80
/// Error types.
81
+ #[ cfg( feature = "alloc" ) ]
76
82
pub mod errors;
77
83
78
84
/// Supported hash functions.
85
+ #[ cfg( feature = "alloc" ) ]
79
86
pub mod hash;
80
87
81
88
/// Supported padding schemes.
89
+ #[ cfg( feature = "alloc" ) ]
82
90
pub mod padding;
83
91
84
92
#[ cfg( feature = "pem" ) ]
85
93
pub use pem;
86
94
95
+ #[ cfg( feature = "alloc" ) ]
87
96
mod key;
97
+ #[ cfg( feature = "alloc" ) ]
88
98
mod oaep;
89
99
#[ cfg( feature = "std" ) ]
90
100
mod parse;
101
+ #[ cfg( feature = "alloc" ) ]
91
102
mod pkcs1v15;
103
+ #[ cfg( feature = "alloc" ) ]
92
104
mod pss;
105
+ #[ cfg( feature = "alloc" ) ]
93
106
mod raw;
94
107
108
+ #[ cfg( feature = "alloc" ) ]
95
109
pub use self :: hash:: Hash ;
110
+ #[ cfg( feature = "alloc" ) ]
96
111
pub use self :: key:: { PublicKey , PublicKeyParts , RSAPrivateKey , RSAPublicKey } ;
112
+ #[ cfg( feature = "alloc" ) ]
97
113
pub use self :: padding:: PaddingScheme ;
98
114
99
115
// Optionally expose internals if requested via feature-flag.
100
116
101
117
#[ cfg( not( feature = "expose-internals" ) ) ]
118
+ #[ cfg( feature = "alloc" ) ]
102
119
mod internals;
103
120
104
121
/// Internal raw RSA functions.
105
122
#[ cfg( feature = "expose-internals" ) ]
123
+ #[ cfg( feature = "alloc" ) ]
106
124
pub mod internals;
0 commit comments