UltrafastSecp256k1/Package.swift
vano a83f74d14c fix: update all repository URLs to shrec/UltrafastSecp256k1
- Replace AvraSasmo/UltrafastSecp256k1 with shrec/UltrafastSecp256k1 in all binding configs
- Replace shrec/Secp256K1fast with shrec/UltrafastSecp256k1 in CI, docs, package managers
- Fix WASM release archive to use wasm/README.md instead of root README.md
- Fix Package.swift and conanfile.py URLs

24 files changed across: bindings (npm, nuget, dart, php, python, ruby, rust, react-native),
CI workflows, docs, Package.swift, conanfile.py, podspec, vcpkg.json, CMakeLists.txt
2026-02-23 06:11:06 +04:00

78 lines
2.8 KiB
Swift

// swift-tools-version:5.9
// ============================================================================
// UltrafastSecp256k1 Swift Package Manager
// ============================================================================
// Ultra high-performance secp256k1 elliptic curve cryptography library
// Exposes C++20 headers directly (no Swift wrapper)
//
// Usage in Package.swift:
// .package(url: "https://github.com/shrec/UltrafastSecp256k1.git", from: "3.0.0")
//
// Usage in target:
// .target(name: "MyApp", dependencies: ["UltrafastSecp256k1"])
//
// In C++ code:
// #include <secp256k1/field.hpp>
// #include <secp256k1/ecdsa.hpp>
// #include <secp256k1/schnorr.hpp>
// ============================================================================
import PackageDescription
let package = Package(
name: "UltrafastSecp256k1",
platforms: [
.iOS(.v17),
.macOS(.v14),
.watchOS(.v10),
.tvOS(.v17),
.visionOS(.v1),
],
products: [
.library(
name: "UltrafastSecp256k1",
targets: ["UltrafastSecp256k1"]
),
],
targets: [
.target(
name: "UltrafastSecp256k1",
path: "cpu",
exclude: [
// x86_64 assembly (not needed on Apple ARM64)
"src/field_asm_x64.asm",
"src/field_asm_x64.cpp",
"src/field_asm_x64_gas.S",
// RISC-V assembly
"src/field_asm_riscv64.S",
"src/field_asm_riscv64.cpp",
// Non-source files in src/
"src/platform_compat.h",
"src/decomposition_optimized.hpp",
// Non-library directories
"bench",
"tests",
"fuzz",
// CMake build file
"CMakeLists.txt",
],
sources: ["src"],
publicHeadersPath: "include",
cxxSettings: [
// Shared types header lives in root include/
.headerSearchPath("../include"),
// Performance defines (match CMake defaults)
.define("SECP256K1_FAST_NO_SECURITY_CHECKS", to: "1"),
.define("SECP256K1_ULTRA_SPEED", to: "1"),
.define("NDEBUG"),
// ARM64 inline assembly (MUL/UMULH available on all Apple ARM64)
.define("SECP256K1_HAS_ARM64_ASM", to: "1",
.when(platforms: [.iOS, .macOS, .tvOS, .watchOS, .visionOS])),
.define("SECP256K1_HAS_ASM", to: "1",
.when(platforms: [.iOS, .macOS, .tvOS, .watchOS, .visionOS])),
]
),
],
cxxLanguageStandard: .cxx20
)