[PAC] Encoder and hash (1/8) - #159071
Conversation
bca55be to
8cf67b9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
8cf67b9 to
7ee3f2c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
7ee3f2c to
fdd1189
Compare
This comment has been minimized.
This comment has been minimized.
d798449 to
4c1b0ac
Compare
Done in: 5e05159 |
03337eb to
8b0e0ca
Compare
|
Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb |
8b0e0ca to
67fd305
Compare
This comment has been minimized.
This comment has been minimized.
|
r? @davidtwco |
|
Reminder, once the PR becomes ready for a review, use |
67fd305 to
43ed719
Compare
|
@rustbot ready |
|
|
||
| use super::*; | ||
|
|
||
| // These tests mirror the SipHash tests from LLVM's Support/SipHashTest.cpp. |
There was a problem hiding this comment.
Are there licensing implications of this?
There was a problem hiding this comment.
I don't believe this introduces a licensing issue. LLVM appears to be using the reference vectors verbatim from the SipHash test vectors, which originate from: https://github.com/veorq/SipHash/blob/master/vectors.h
The tests here are just a trivial loop over those values to verify the implementation against the known reference outputs.
That said, I am not a lawyer and cannot provide any formal legal guarantee.
There was a problem hiding this comment.
I think it should be okay to implement SipHash based on LLVM here, as that is permitted by LLVM's Apache-2.0 WITH LLVM-Exception license, but we should probably add a comment like this:
rust/compiler/rustc_llvm/llvm-wrapper/SymbolWrapper.cpp
Lines 1 to 8 in 0b63def
and a REUSE entry like this:
Lines 58 to 65 in 0b63def
43ed719 to
414fe91
Compare
This comment has been minimized.
This comment has been minimized.
This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used in pointer authentication. Compatibility with Clang is a primary goal. The discriminator produced for a given external "C" function type must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics. The implementation mirrors Clang's behavior in `ASTContext::encodeTypeForFunctionPointerAuth`, ensuring that identical C-compatible function types produce identical discriminators. See: <https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3>.
414fe91 to
4613587
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
r=me after resolving #159071 (comment) |
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
0600c15 to
50353a4
Compare
View all comments
This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used for pointer authentication. Compatibility with Clang is a primary design goal. For a given extern "C" function type, the discriminator produced by Rust must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics.
The implementation mirrors Clang's behavior in ASTContext::encodeTypeForFunctionPointerAuth, ensuring that identical C-compatible function types produce identical discriminators. See: https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3.
This is part 1 of a sequence of 8 PRs that together implement support for function pointer type discrimination:
Useful links:
pauthtestintroduction: Introduce aarch64-unknown-linux-pauthtest target #155722