Skip to content

Commit

Permalink
Enabling newer modules (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
csjones authored May 13, 2024
1 parent f9f1979 commit 9683e8e
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ let package = Package(
.define("ECMULT_WINDOW_SIZE", to: "15"),
// Enabling additional secp256k1 modules.
.define("ENABLE_MODULE_ECDH"),
.define("ENABLE_MODULE_ELLSWIFT"),
.define("ENABLE_MODULE_EXTRAKEYS"),
.define("ENABLE_MODULE_RECOVERY"),
.define("ENABLE_MODULE_SCHNORRSIG")
Expand All @@ -38,15 +39,18 @@ let package = Package(
.define("ECMULT_GEN_PREC_BITS", to: "4"),
.define("ECMULT_WINDOW_SIZE", to: "15"),
// Enabling additional secp256k1-zkp modules.
.define("ENABLE_MODULE_BPPP"),
.define("ENABLE_MODULE_ECDH"),
.define("ENABLE_MODULE_ECDSA_ADAPTOR"),
.define("ENABLE_MODULE_ECDSA_S2C"),
.define("ENABLE_MODULE_ELLSWIFT"),
.define("ENABLE_MODULE_EXTRAKEYS"),
.define("ENABLE_MODULE_GENERATOR"),
.define("ENABLE_MODULE_MUSIG"),
.define("ENABLE_MODULE_RANGEPROOF"),
.define("ENABLE_MODULE_RECOVERY"),
.define("ENABLE_MODULE_SCHNORRSIG"),
.define("ENABLE_MODULE_SCHNORRSIG_HALFAGG"),
.define("ENABLE_MODULE_SURJECTIONPROOF"),
.define("ENABLE_MODULE_WHITELIST"),
// Some modules need additional header search paths
Expand Down
1 change: 1 addition & 0 deletions Sources/secp256k1_bindings/include/secp256k1_ellswift.h
6 changes: 3 additions & 3 deletions Sources/zkp/ASN1/Basic ASN1 Types/ObjectIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
}

enum AlgorithmIdentifier {
static let idEcPublicKey: ASN1.ASN1ObjectIdentifier = [1, 2, 840, 10045, 2, 1]
static let idEcPublicKey: ASN1.ASN1ObjectIdentifier = [1, 2, 840, 10_045, 2, 1]
}

enum NameAttributes {
Expand All @@ -189,8 +189,8 @@
static let countryName: ASN1.ASN1ObjectIdentifier = [2, 5, 4, 6]
static let serialNumber: ASN1.ASN1ObjectIdentifier = [2, 5, 4, 5]
static let pseudonym: ASN1.ASN1ObjectIdentifier = [2, 5, 4, 65]
static let domainComponent: ASN1.ASN1ObjectIdentifier = [0, 9, 2342, 19200300, 100, 1, 25]
static let emailAddress: ASN1.ASN1ObjectIdentifier = [1, 2, 840, 113549, 1, 9, 1]
static let domainComponent: ASN1.ASN1ObjectIdentifier = [0, 9, 2_342, 19_200_300, 100, 1, 25]
static let emailAddress: ASN1.ASN1ObjectIdentifier = [1, 2, 840, 113_549, 1, 9, 1]
}
}

Expand Down
1 change: 1 addition & 0 deletions Sources/zkp_bindings/include/secp256k1_bppp.h
1 change: 1 addition & 0 deletions Sources/zkp_bindings/include/secp256k1_ellswift.h
1 change: 1 addition & 0 deletions Sources/zkp_bindings/src/modules/bppp/bppp_util.h
1 change: 1 addition & 0 deletions Sources/zkp_bindings/src/modules/bppp/main.h
1 change: 1 addition & 0 deletions Sources/zkp_bindings/src/modules/bppp/main_impl.h
1 change: 1 addition & 0 deletions Sources/zkp_bindings/src/modules/ellswift/main_impl.h
2 changes: 1 addition & 1 deletion Tests/zkpTests/secp256k1Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ final class secp256k1Tests: XCTestCase {

let set0 = Set(array)

array = [UInt8](repeating: 1, count: Int.random(in: 10...100000))
array = [UInt8](repeating: 1, count: Int.random(in: 10...100_000))

XCTAssertGreaterThan(array.count, 9)

Expand Down

0 comments on commit 9683e8e

Please sign in to comment.