| ... | ... | @@ -185,31 +185,27 @@ pub const errors = @import("crypto/errors.zig"); |
| 185 | 185 | pub const tls = @import("crypto/tls.zig"); |
| 186 | 186 | pub const Certificate = @import("crypto/Certificate.zig"); |
| 187 | 187 | |
| 188 | | /// Global configuration of cryptographic implementations in the standard library. |
| 189 | | pub const config = struct { |
| 190 | | /// Side-channels mitigations. |
| 191 | | pub const SideChannelsMitigations = enum { |
| 192 | | /// No additional side-channel mitigations are applied. |
| 193 | | /// This is the fastest mode. |
| 194 | | none, |
| 195 | | /// The `basic` mode protects against most practical attacks, provided that the |
| 196 | | /// application or implements proper defenses against brute-force attacks. |
| 197 | | /// It offers a good balance between performance and security. |
| 198 | | basic, |
| 199 | | /// The `medium` mode offers increased resilience against side-channel attacks, |
| 200 | | /// making most attacks unpractical even on shared/low latency environements. |
| 201 | | /// This is the default mode. |
| 202 | | medium, |
| 203 | | /// The `full` mode offers the highest level of protection against side-channel attacks. |
| 204 | | /// Note that this doesn't cover all possible attacks (especially power analysis or |
| 205 | | /// thread-local attacks such as cachebleed), and that the performance impact is significant. |
| 206 | | full, |
| 207 | | }; |
| 208 | | |
| 209 | | /// This is a global configuration that applies to all cryptographic implementations. |
| 210 | | pub const side_channels_mitigations: SideChannelsMitigations = if (@hasDecl(root, "side_channels_mitigations")) root.side_channels_mitigations else .medium; |
| 188 | /// Side-channels mitigations. |
| 189 | pub const SideChannelsMitigations = enum { |
| 190 | /// No additional side-channel mitigations are applied. |
| 191 | /// This is the fastest mode. |
| 192 | none, |
| 193 | /// The `basic` mode protects against most practical attacks, provided that the |
| 194 | /// application or implements proper defenses against brute-force attacks. |
| 195 | /// It offers a good balance between performance and security. |
| 196 | basic, |
| 197 | /// The `medium` mode offers increased resilience against side-channel attacks, |
| 198 | /// making most attacks unpractical even on shared/low latency environements. |
| 199 | /// This is the default mode. |
| 200 | medium, |
| 201 | /// The `full` mode offers the highest level of protection against side-channel attacks. |
| 202 | /// Note that this doesn't cover all possible attacks (especially power analysis or |
| 203 | /// thread-local attacks such as cachebleed), and that the performance impact is significant. |
| 204 | full, |
| 211 | 205 | }; |
| 212 | 206 | |
| 207 | pub const default_side_channels_mitigations = .medium; |
| 208 | |
| 213 | 209 | test { |
| 214 | 210 | _ = aead.aegis.Aegis128L; |
| 215 | 211 | _ = aead.aegis.Aegis256; |