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

Init variable to avoid "may be used uninitialized" warning #2114

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion crypto/fipsmodule/ec/ec_montgomery.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,12 @@ void ec_GFp_mont_dbl(const EC_GROUP *group, EC_JACOBIAN *r,
// Coq transcription and correctness proof:
// <https://github.com/mit-plv/fiat-crypto/blob/79f8b5f39ed609339f0233098dee1a3c4e6b3080/src/Curves/Weierstrass/Jacobian.v#L93>
// <https://github.com/mit-plv/fiat-crypto/blob/79f8b5f39ed609339f0233098dee1a3c4e6b3080/src/Curves/Weierstrass/Jacobian.v#L201>
EC_FELEM delta, gamma, beta, ftmp, ftmp2, tmptmp, alpha, fourbeta;

// Initialize variables to avoid "may be used uninitialized" warning.
// https://github.com/aws/aws-lc/issues/1185
EC_FELEM delta = {{0}}, gamma = {{0}}, beta = {{0}}, ftmp = {{0}};
EC_FELEM ftmp2 = {{0}}, tmptmp = {{0}}, alpha = {{0}}, fourbeta = {{0}};

// delta = z^2
ec_GFp_mont_felem_sqr(group, &delta, &a->Z);
// gamma = y^2
Expand Down
Loading