You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm proposing a multi-phase audit, where each subsequent phase builds off the blocks of the prior.
Audit 1a: Crypto
Below are PR's we would like audited for this phase. For each PR, we include Audit Goals. It is our intent that by achieving the Audit Goals, the audit would answer the question "Is the linked PR fit for use in Monero?" If auditors have any additional insights that can help answer that question for each PR, and those insights do not relate to something explicitly stated in the linked PR's Audit Goals, then we would appreciate the insight nonetheless.
Note that most of the PR's build off each other by cherry-picking commits. An auditor may find it easier to review each commit sequentially, rather than each PR as a whole.
Is the cryptographic algorithm used in the function sound from a cryptographic standpoint?
Is the code implemented correctly? For example, in addition to auditing cryptographic security, we would also hope that an audit would catch an issue like this one that was in the code originally.
Is the cryptographic algorithm used in each function sound from a cryptographic standpoint and achieve their stated objective? For example, does the algorithm in clear_torsion adequately "clear torsion" from a cryptographic standpoint etc.
Is the code in each function implemented correctly assuming the above is true?
Are clear_torsion and mul8_is_identity constant time?
Verify the rationale shared in Replace Monero's hash-to-point function with the FCMP++ Upgrade monero-project/research-lab#142 that Monero's existing hash-to-point function is in fact biased (the function named biased_hash_to_ec in the PR). If you can prove that the existing hash-to-point function is not actually biased as posited in that issue, then we do not need this PR and that is a satisfactory conclusion for this "Unbiased key image generator" item.
If you concur with the rationale of that issue that the existing hash-to-point may be biased, then we also have the following additional goals:
Does the unbiased_hash_to_ec function achieve the stated goal of being "unbiased"? By this we mean:
Does the implementation match Elligator 2 as specified in the Elligator paper: https://eprint.iacr.org/2013/325.pdf ? We are aware the implementation does not match the IRTF specification.
Is the algorithm utilized in the function unbiased from a cryptographic security standpoint?
Is the algorithm utilized in the function collision resistant?
Does the code perform as claimed assuming the cryptographic protocol utilized in the function is unbiased?
We hope answering the above questions will answer "is the PR fit for use in Monero." If you have additional insights that can help answer that question, that would also be appreciated.
Do the functions correctly derive the X25519 x-coordinate from an Ed25519 point from a cryptographic standpoint?
Is the code in each function implemented correctly assuming the above is true?
Audit 1b: Integrated Crypto
Below are PR's we would like audited for this phase. For each PR, we include Audit Goals. It is our intent that by achieving the Audit Goals, the audit would answer the question "Is the linked PR fit for use in Monero?" If auditors have any additional insights that can help answer that question for each PR, and those insights do not relate to something explicitly stated in the linked PR's Audit Goals, then we would appreciate the insight nonetheless.
Note that most of the PR's build off each other by cherry-picking commits. An auditor may find it easier to review each commit sequentially, rather than each PR as a whole.
Verify that none of O, I, C can have torsion, and contain correct identity checks, both from a cryptographic standpoint and correctly implemented coding standpoint.
Verify the claim that no output or commitment detectable as a valid receive on the Monero blockchain today (or at any point in the past) would cause output_to_tuple to throw. This is critical because it means that an output that is detectable as a valid receive under existing/prior rules would not be spendable after FCMP++ goes into effect.
This excludes exceptional cases, such as when the person who creates the address chooses one specifically to cause conflicts (e.g. with a torsioned spend key, or a spend key proportional to a specific rerandomization of the view key), or cases with negligible statistical probability. The basic goal is to determine if a malicious actor could feasibly prevent an honest user from being able to spend a validly detectable received output by maliciously constructing outputs, or if an honest user could naturally end up crafting such an output.
Verify that the function fcmp_pp::tower_cycle::selene_scalar_from_bytes calls selene_scalar_from_bytes in fcmp++.h safely from a runtime and memory standpoint.
Verify that the selene_scalar_from_bytes in lib.rs is implemented correctly from a runtime and memory standpoint, and calls read_F in a safe manner from the same standpoint as well as a cryptographically secure standpoint.
Verify that the Rust FFI layer is set up in a manner that is fit for production use in Monero (fcmp++.h, the CMake file that builds the Rust static lib that is called from the C++, lib.rs, and the C++ callers).
We want to make sure the functions highlighted in the PR description are implemented correctly, and the Rust FFI C structs are properly compatible with their respective Rust objects.
I'm proposing a multi-phase audit, where each subsequent phase builds off the blocks of the prior.
Audit 1a: Crypto
Below are PR's we would like audited for this phase. For each PR, we include Audit Goals. It is our intent that by achieving the Audit Goals, the audit would answer the question "Is the linked PR fit for use in Monero?" If auditors have any additional insights that can help answer that question for each PR, and those insights do not relate to something explicitly stated in the linked PR's Audit Goals, then we would appreciate the insight nonetheless.
Note that most of the PR's build off each other by cherry-picking commits. An auditor may find it easier to review each commit sequentially, rather than each PR as a whole.
rct::zeroCommitVartimefe_batch_invertfe_equalsclear_torsionget_valid_torsion_cleared_pointrct::verPointsForTorsionmul8_is_identityclear_torsionadequately "clear torsion" from a cryptographic standpoint etc.clear_torsionandmul8_is_identityconstant time?biased_hash_to_ecin the PR). If you can prove that the existing hash-to-point function is not actually biased as posited in that issue, then we do not need this PR and that is a satisfactory conclusion for this "Unbiased key image generator" item.unbiased_hash_to_ecfunction achieve the stated goal of being "unbiased"? By this we mean:fe_reduce_vartimefe_reduce_vartime?fe_reduce_vartimesound from a cryptographic standpoint?point_to_ed_derivativesed_derivatives_to_wei_x_yfe_ed_derivatives_to_wei_x_yfe_a,fe_a_inv_3,fe_c) match the constants specified in the paper?fe_ed_derivatives_to_wei_x_yconstant time?ge_p3_to_x25519edwards_bytes_to_x25519_vartimeAudit 1b: Integrated Crypto
Below are PR's we would like audited for this phase. For each PR, we include Audit Goals. It is our intent that by achieving the Audit Goals, the audit would answer the question "Is the linked PR fit for use in Monero?" If auditors have any additional insights that can help answer that question for each PR, and those insights do not relate to something explicitly stated in the linked PR's Audit Goals, then we would appreciate the insight nonetheless.
Note that most of the PR's build off each other by cherry-picking commits. An auditor may find it easier to review each commit sequentially, rather than each PR as a whole.
output_to_tupleoutput_to_pre_leaf_tupleO, I, Ccan have torsion, and contain correct identity checks, both from a cryptographic standpoint and correctly implemented coding standpoint.output_to_tupleto throw. This is critical because it means that an output that is detectable as a valid receive under existing/prior rules would not be spendable after FCMP++ goes into effect.selene_scalar_from_bytesSeleneScalarSeleneScalarstruct is the correct C representation of this Rust object (the helioselene crate exposes that object asField25519here).fcmp_pp::tower_cycle::selene_scalar_from_bytescallsselene_scalar_from_bytesinfcmp++.hsafely from a runtime and memory standpoint.selene_scalar_from_bytesinlib.rsis implemented correctly from a runtime and memory standpoint, and callsread_Fin a safe manner from the same standpoint as well as a cryptographically secure standpoint.fcmp++.h, the CMake file that builds the Rust static lib that is called from the C++,lib.rs, and the C++ callers).outputs_to_leavesoutputs_to_leavesis implemented correctly both from a cryptographic standpoint and memory/runtime standpoint.Audit 2: Curve Tree Building
The exact scope of this phase 2 may be adjusted, but the following is the generally expected scope:
hash_growflowpoint_to_cycle_scalarAudit 3: Consensus Integration
The exact scope of this phase 3 may be modified, but the following is the generally expected scope:
advance_tree
grow_tree
trim_block
trim_tree
get_last_path
handle_fcmp_tree
batch_verify_fcmp_pp_txs
// Make sure the block uses the correct FCMP++ tree root and n tree layers
Out of scope (slated for future optional audit):
torsion_check_vartimeget_valid_torsion_cleared_point_fast