feat: Increase secret size to 256 bits of entropy

This is for quantumn computers. When trying to break AES, quantumn
computers give a square-root speedup, i.e. the 144 bits of entropy would
take as many queries as breaking 72 bits of entropy on a normal computer. This neglects
e.g. the costs of quantumn circuits and quantumn error correction [1], so,
144 bits entropy would actually have been fine, but in order to be on
the very safe side and so that noone can complain, let's increase it to
256 bits.

[1]: https://csrc.nist.gov/csrc/media/Events/2024/fifth-pqc-standardization-conference/documents/papers/on-practical-cost-of-grover.pdf
This commit is contained in:
Hocuri
2025-08-04 17:17:49 +02:00
parent 13bbcbeb0e
commit 494ad63a73
4 changed files with 32 additions and 8 deletions

View File

@@ -20,7 +20,7 @@ use crate::message::Message;
use crate::net::http::post_empty;
use crate::net::proxy::{DEFAULT_SOCKS_PORT, ProxyConfig};
use crate::token;
use crate::tools::validate_id;
use crate::tools::{validate_broadcast_shared_secret, validate_id};
const OPENPGP4FPR_SCHEME: &str = "OPENPGP4FPR:"; // yes: uppercase
const IDELTACHAT_SCHEME: &str = "https://i.delta.chat/#";
@@ -459,7 +459,7 @@ async fn decode_openpgp(context: &Context, qr: &str) -> Result<Qr> {
.map(|s| s.to_string());
let broadcast_shared_secret = param
.get("b")
.filter(|&s| validate_id(s))
.filter(|&s| validate_broadcast_shared_secret(s))
.map(|s| s.to_string());
let grpname = if grpid.is_some() {