fix: Fix the output of mask if mask is empty

This commit is contained in:
Alivecow 2024-12-03 17:51:59 +01:00
parent 274b65c6fd
commit 6a2f631e46

View file

@ -180,6 +180,10 @@ pub fn gcm_crack(args: &Value) -> Result<CrackAnswer> {
let forgery_auth_tag = xor_bytes(&eky0, forgery_ghash).unwrap(); let forgery_auth_tag = xor_bytes(&eky0, forgery_ghash).unwrap();
if eky0.is_empty() {
eky0 = vec![0; 16];
}
Ok(CrackAnswer { Ok(CrackAnswer {
tag: BASE64_STANDARD.encode(forgery_auth_tag), tag: BASE64_STANDARD.encode(forgery_auth_tag),
H: h_candidate.to_b64(), H: h_candidate.to_b64(),