| ... | ... | @@ -417,6 +417,20 @@ pub const Aegis128LMac = AegisMac(Aegis128L_256); |
| 417 | 417 | /// - It has a large security margin against internal collisions. |
| 418 | 418 | pub const Aegis256Mac = AegisMac(Aegis256_256); |
| 419 | 419 | |
| 420 | /// Aegis128L MAC with a 128-bit output. |
| 421 | /// A MAC with a 128-bit output is not safe unless the number of messages |
| 422 | /// authenticated with the same key remains small. |
| 423 | /// After 2^48 messages, the probability of a collision is already ~ 2^-33. |
| 424 | /// If unsure, use the Aegis128LMac type, that has a 256 bit output. |
| 425 | pub const Aegis128LMac_128 = AegisMac(Aegis128L); |
| 426 | |
| 427 | /// Aegis256 MAC with a 128-bit output. |
| 428 | /// A MAC with a 128-bit output is not safe unless the number of messages |
| 429 | /// authenticated with the same key remains small. |
| 430 | /// After 2^48 messages, the probability of a collision is already ~ 2^-33. |
| 431 | /// If unsure, use the Aegis256Mac type, that has a 256 bit output. |
| 432 | pub const Aegis256Mac_128 = AegisMac(Aegis256); |
| 433 | |
| 420 | 434 | fn AegisMac(comptime T: type) type { |
| 421 | 435 | return struct { |
| 422 | 436 | const Self = @This(); |