136 // Explicitly setting them via CmdLine option takes precedence, of course. 137 // TODO: UseAESIntrinsics must be made keylength specific. 138 // As of March 2015 and Java8, only AES128 is supported by the Java Cryptographic Extensions. 139 // Therefore, UseAESIntrinsics is of minimal use at the moment. 140 if (FLAG_IS_DEFAULT(UseAES) && has_Crypto_AES()) { 141 FLAG_SET_DEFAULT(UseAES, true); 142 } 143 if (UseAES && !has_Crypto_AES()) { 144 warning("AES instructions are not available on this CPU"); 145 FLAG_SET_DEFAULT(UseAES, false); 146 } 147 if (UseAES) { 148 if (FLAG_IS_DEFAULT(UseAESIntrinsics)) { 149 FLAG_SET_DEFAULT(UseAESIntrinsics, true); 150 } 151 } 152 if (UseAESIntrinsics && !has_Crypto_AES()) { 153 warning("AES intrinsics are not available on this CPU"); 154 FLAG_SET_DEFAULT(UseAESIntrinsics, false); 155 } 156 157 // TODO: implement AES/CTR intrinsics 158 if (UseAESCTRIntrinsics) { 159 warning("AES/CTR intrinsics are not available on this CPU"); 160 FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); 161 } 162 163 // TODO: implement GHASH intrinsics 164 if (UseGHASHIntrinsics) { 165 warning("GHASH intrinsics are not available on this CPU"); 166 FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); 167 } 168 169 if (FLAG_IS_DEFAULT(UseFMA)) { 170 FLAG_SET_DEFAULT(UseFMA, true); 171 } 172 173 // On z/Architecture, we take UseSHA as the general switch to enable/disable the SHA intrinsics. 174 // The specific switches UseSHAxxxIntrinsics will then be set depending on the actual 175 // machine capabilities. | 136 // Explicitly setting them via CmdLine option takes precedence, of course. 137 // TODO: UseAESIntrinsics must be made keylength specific. 138 // As of March 2015 and Java8, only AES128 is supported by the Java Cryptographic Extensions. 139 // Therefore, UseAESIntrinsics is of minimal use at the moment. 140 if (FLAG_IS_DEFAULT(UseAES) && has_Crypto_AES()) { 141 FLAG_SET_DEFAULT(UseAES, true); 142 } 143 if (UseAES && !has_Crypto_AES()) { 144 warning("AES instructions are not available on this CPU"); 145 FLAG_SET_DEFAULT(UseAES, false); 146 } 147 if (UseAES) { 148 if (FLAG_IS_DEFAULT(UseAESIntrinsics)) { 149 FLAG_SET_DEFAULT(UseAESIntrinsics, true); 150 } 151 } 152 if (UseAESIntrinsics && !has_Crypto_AES()) { 153 warning("AES intrinsics are not available on this CPU"); 154 FLAG_SET_DEFAULT(UseAESIntrinsics, false); 155 } 156 if (UseAESIntrinsics && !UseAES) { 157 warning("AES intrinsics cannot be enabled with AES instructions unavailable or disabled"); 158 FLAG_SET_DEFAULT(UseAESIntrinsics, false); 159 } 160 161 // TODO: implement AES/CTR intrinsics 162 if (UseAESCTRIntrinsics) { 163 warning("AES/CTR intrinsics are not available on this CPU"); 164 FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); 165 } 166 167 // TODO: implement GHASH intrinsics 168 if (UseGHASHIntrinsics) { 169 warning("GHASH intrinsics are not available on this CPU"); 170 FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); 171 } 172 173 if (FLAG_IS_DEFAULT(UseFMA)) { 174 FLAG_SET_DEFAULT(UseFMA, true); 175 } 176 177 // On z/Architecture, we take UseSHA as the general switch to enable/disable the SHA intrinsics. 178 // The specific switches UseSHAxxxIntrinsics will then be set depending on the actual 179 // machine capabilities. |