Chris

Results 8 comments of Chris

> I've got a feature branch here, implemented as a new folder of Stencil templates called SwiftCombine: https://github.com/VyrCossont/SwagGen/tree/swift-combine Basics are functional; I've got enough working to support a simple Mastodon...

Hey @charlie632, just checking in, would you like any help with this PR?

Hey @charlie632 👋 Are you referring to using [`secp256k1_ec_seckey_verify`](https://github.com/GigaBitcoin/secp256k1.swift/blob/main/Sources/zkp/secp256k1.swift#L334) to check that the `PrivateKey` is valid? If you have a specific example using a 32 byte key, we can create...

It might be simpler if we tried testing like this: ```swift let privateBytes = try! "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364142".bytes XCTAssertThrowsError(try secp256k1.Signing.PrivateKey(dataRepresentation: privateBytes)) ``` We can use `XCTAssertThrowsError` to make sure an error is...

I understand what you're saying now 😅 It makes sense to have the ability to constrain the entropy when using `secp256k1.Signing.PrivateKey()` and this change would bring the API closer to...

After a little investigation, I learned that Apple implements [looping logic](https://github.com/apple/swift-crypto/blob/cba358dec921dfcc4db4d87ddae0e0b528db5bbf/Sources/Crypto/Keys/EC/BoringSSL/NISTCurvesKeys_boring.swift#L144L162) on initialization similar to what you described. I take it back and now think we can explore this change...

Your help would be greatly appreciated! The first of the [two functions](https://github.com/GigaBitcoin/secp256k1.swift/blob/a69bc11b381207c1a774b8f1fb0de6e30c4f6490/Sources/zkp/secp256k1.swift#L153C1-L184) could be changed to: ```swift @usableFromInline init(format: secp256k1.Format = .compressed) { for _ in 0 ..< 10 {...