[PATCH] D96164: [lld-macho] add code signature for native arm64 macOS
Shoaib Meenai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 7 12:57:56 PST 2021
smeenai added a comment.
In D96164#2547390 <https://reviews.llvm.org/D96164#2547390>, @thakis wrote:
> In D96164#2547158 <https://reviews.llvm.org/D96164#2547158>, @gkm wrote:
>
>> In order to perform ad-hoc codesign, I will need to compute sha256 of the program's pages. I see no other part of LLVM that uses a sha256 library. What library should I use?
>
> LLVM tries to not depend on external libraries if possible. Given that sha256 isn't that much code (https://golang.org/src/crypto/sha256/), just adding a fresh implementation of it (to lld/MachO for now) is probably the way to go.
Agreed. There's some prior art here too ... LLVM has a SHA1 implementation in `llvm/include/llvm/Support/SHA1.h` and `llvm/lib/Support/SHA1.cpp`. That was adapted from an existing public-domain implementation, and we could do the same here (find a SHA256 implementation with a license that allows it to copied into LLVM).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96164/new/
https://reviews.llvm.org/D96164
More information about the llvm-commits
mailing list