Update to WWDC25 release (#417)

This change updates Crypto to WWDC25 equivalent code.

Each of these changes were individually merged to the WWDC25 branch.
This includes:

- #359
- #363
- #365
- #367
- #368
- #397
- #403
- #410
- #407
- #401
- #415

---------

Co-authored-by: YourMJK <37852512+YourMJK@users.noreply.github.com>
Co-authored-by: Si Beaumont <beaumont@apple.com>
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
Co-authored-by: Raphael <josephnoir@users.noreply.github.com>
Co-authored-by: Evan Wilde <ewilde@apple.com>
Co-authored-by: Tim Condon <0xTim@users.noreply.github.com>
Co-authored-by: Gus Cairo <gus.cairo@apple.com>
Co-authored-by: George Barnett <gbarnett@apple.com>
Co-authored-by: Fabrice de Gans <Steelskin@users.noreply.github.com>
Co-authored-by: Wojciech Nagrodzki <278594+wnagrodzki@users.noreply.github.com>
Co-authored-by: Jesse L. Zamora <xtremekforever@gmail.com>
Co-authored-by: aryan-25 <aryan_shah@apple.com>
Co-authored-by: Gwynne Raskind <gwynne@vapor.codes>
Co-authored-by: 3405691582 <dsk@google.com>
Co-authored-by: Paul Toffoloni <69189821+ptoffy@users.noreply.github.com>
This commit is contained in:
322 files changed
+17931 -1751

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env python2.7
#!/usr/bin/env python
import gyb
gyb.main()
+4
View File
@@ -377,6 +377,7 @@ cat << EOF > "$DSTROOT/include/CCryptoBoringSSL.h"
#include "CCryptoBoringSSL_cmac.h"
#include "CCryptoBoringSSL_conf.h"
#include "CCryptoBoringSSL_cpu.h"
#include "CCryptoBoringSSL_ctrdrbg.h"
#include "CCryptoBoringSSL_curve25519.h"
#include "CCryptoBoringSSL_des.h"
#include "CCryptoBoringSSL_e_os2.h"
@@ -390,6 +391,8 @@ cat << EOF > "$DSTROOT/include/CCryptoBoringSSL.h"
#include "CCryptoBoringSSL_hrss.h"
#include "CCryptoBoringSSL_md4.h"
#include "CCryptoBoringSSL_md5.h"
#include "CCryptoBoringSSL_mldsa.h"
#include "CCryptoBoringSSL_mlkem.h"
#include "CCryptoBoringSSL_obj_mac.h"
#include "CCryptoBoringSSL_objects.h"
#include "CCryptoBoringSSL_opensslv.h"
@@ -406,6 +409,7 @@ cat << EOF > "$DSTROOT/include/CCryptoBoringSSL.h"
#include "CCryptoBoringSSL_siphash.h"
#include "CCryptoBoringSSL_trust_token.h"
#include "CCryptoBoringSSL_x509v3.h"
#include "CCryptoBoringSSL_xwing.h"
#endif // C_CRYPTO_BORINGSSL_H
EOF
+67
View File
@@ -0,0 +1,67 @@
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftCrypto open source project
##
## Copyright (c) 2019-2021 Apple Inc. and the SwiftCrypto project authors
## Licensed under Apache License v2.0
##
## See LICENSE.txt for license information
## See CONTRIBUTORS.txt for the list of SwiftCrypto project authors
##
## SPDX-License-Identifier: Apache-2.0
##
##===----------------------------------------------------------------------===##
set -euo pipefail
log() { printf -- "** %s\n" "$*" >&2; }
error() { printf -- "** ERROR: %s\n" "$*" >&2; }
fatal() { error "$@"; exit 1; }
trap 'error "command failed (line ${LINENO})"' ERR
CURRENT_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT=$(git -C "${CURRENT_SCRIPT_DIR}" rev-parse --show-toplevel)
DESTINATION_DIR=${REPO_ROOT}/Sources/CXKCP
VENDOR_LOGFILE="${DESTINATION_DIR}/vendored-sources.txt"
log "Checking required environment variables..."
test -n "${XKCP_PATH:-}" || fatal "XKCP_PATH unset"
log "Checking running from swift-crypto with no uncommited changes in destination dir: ${DESTINATION_DIR} ..."
PACKAGE_NAME=$(swift package --package-path "${REPO_ROOT}" describe --type text | /usr/bin/head -1 | grep "Name:" | awk '{ print $2 }')
if [[ "${PACKAGE_NAME}" != "swift-crypto" ]]; then
fatal "Not running in swift-crypto; current package appears to be: ${PACKAGE_NAME}"
fi
[ -z "$(git -C "${REPO_ROOT}" status --porcelain -- "${DESTINATION_DIR}")" ] || fatal "Aborting vendor script: local changes detected."
log "Checking XKCP checkout exists: ${XKCP_PATH}"
test -d "${XKCP_PATH}/.git"
log "Getting XKCP hash..."
XKCP_DESCRIBE=$(git -C "${XKCP_PATH}" describe --all --long)
XKCP_BRANCH=$(git -C "${XKCP_PATH}" rev-parse --abbrev-ref HEAD)
# -----------------------------------------------------------------------------
log "Vendoring code from ${XKCP_PATH}#${XKCP_BRANCH} (${XKCP_DESCRIBE})"
XKCP_PACK_MAKE_TARGET=FIPS202-opt64.pack
XKCP_PACK_PATH="${XKCP_PATH}/bin/${XKCP_PACK_MAKE_TARGET/.pack/.tar.gz}"
make -C "${XKCP_PATH}" "${XKCP_PACK_MAKE_TARGET}"
tar -tf "${XKCP_PACK_PATH}" || fatal "Could not find expected built pack: ${XKCP_PACK_PATH}"
log "Unpacking to destination: ${DESTINATION_DIR}"
tar -C "${DESTINATION_DIR}" -xvf "${XKCP_PACK_PATH}"
cat > "${VENDOR_LOGFILE}" <<EOI
Vendored code from XKCP#${XKCP_BRANCH} (${XKCP_DESCRIBE}):
$(tar -tf "${XKCP_PACK_PATH}" | sed 's/^/- /')
EOI
# -----------------------------------------------------------------------------
COMMIT_MESSAGE="Revendor xkcp#${XKCP_BRANCH} (${XKCP_DESCRIBE})"
log "Committing vendored code."
git -C "${REPO_ROOT}" add "${DESTINATION_DIR}" "${VENDOR_LOGFILE}"
git -C "${REPO_ROOT}" commit -m "${COMMIT_MESSAGE}" --allow-empty
log "Vendor script complete!"