Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make API more safe #2

Open
olehmisar opened this issue Dec 9, 2024 · 0 comments
Open

Make API more safe #2

olehmisar opened this issue Dec 9, 2024 · 0 comments

Comments

@olehmisar
Copy link

Users may accidentally forget to call jwt.verify(). Is there any reason not to combine .init and .verify into a single function?

Before:

let jwt = JWT::init(
    data,
    b64_offset: u32,
    pubkey_modulus_limbs,
    redc_params_limbs,
    signature_limbs,
);
jwt.verify();

After:

let jwt = JWT::verify(
    data,
    b64_offset: u32,
    pubkey_modulus_limbs,
    redc_params_limbs,
    signature_limbs,
);

Also, for partial hashing:

let jwt = JWT::verify_with_partial_hash(
    partial_data,
    partial_hash,
    full_data_length,
    b64_offset,
    pubkey_modulus_limbs,
    redc_params_limbs,
    signature_limbs,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant