pub fn verify_ironshield_solution(
response: &IronShieldChallengeResponse,
) -> boolExpand description
Verify that an IronShieldChallengeResponse contains
a valid solution.
This function uses the same optimized hashing approach
as find_solution_single_threaded. It extracts the
challenge and solution from the response and verifies
that the solution is valid for the challenge.
§Arguments
response: TheIronShieldChallengeResponsecontaining both the challenge and solution
§Returns
bool:trueif the solution produces a hash less than thechallenge_param,falseif the solution is invalid or doesn’t meet the requirements.
§Example
use ironshield_core::{find_solution, verify_ironshield_solution, IronShieldChallenge, SigningKey};
let dummy_key = SigningKey::from_bytes(&[0u8; 32]);
let challenge = IronShieldChallenge::new(
"test_website".to_string(),
1, // Easy difficulty
dummy_key,
[0x00; 32],
);
let response = find_solution(&challenge, None, None, None, None).unwrap();
assert!(verify_ironshield_solution(&response));