Skip to content

Commit

Permalink
Merge pull request #15 from xmtp/np/new-user-preferences
Browse files Browse the repository at this point in the history
User Preferences update from Rust
  • Loading branch information
nplasterer authored Dec 5, 2023
2 parents eb931c2 + a400d5a commit e08af69
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Sources/XMTPRust/xmtp_rust_swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public func recover_public_key_k256_sha256(_ message: RustVec<UInt8>, _ signatur
public func recover_public_key_k256_keccak256(_ message: RustVec<UInt8>, _ signature: RustVec<UInt8>) throws -> RustVec<UInt8> {
try { let val = __swift_bridge__$recover_public_key_k256_keccak256({ let val = message; val.isOwned = false; return val.ptr }(), { let val = signature; val.isOwned = false; return val.ptr }()); if val.is_ok { return RustVec(ptr: val.ok_or_err!) } else { throw RustString(ptr: val.ok_or_err!) } }()
}
public func ecies_encrypt_k256_sha3_256(_ public_key: RustVec<UInt8>, _ private_key: RustVec<UInt8>, _ message: RustVec<UInt8>) throws -> RustVec<UInt8> {
try { let val = __swift_bridge__$ecies_encrypt_k256_sha3_256({ let val = public_key; val.isOwned = false; return val.ptr }(), { let val = private_key; val.isOwned = false; return val.ptr }(), { let val = message; val.isOwned = false; return val.ptr }()); if val.is_ok { return RustVec(ptr: val.ok_or_err!) } else { throw RustString(ptr: val.ok_or_err!) } }()
public func user_preferences_encrypt(_ public_key: RustVec<UInt8>, _ private_key: RustVec<UInt8>, _ message: RustVec<UInt8>) throws -> RustVec<UInt8> {
try { let val = __swift_bridge__$user_preferences_encrypt({ let val = public_key; val.isOwned = false; return val.ptr }(), { let val = private_key; val.isOwned = false; return val.ptr }(), { let val = message; val.isOwned = false; return val.ptr }()); if val.is_ok { return RustVec(ptr: val.ok_or_err!) } else { throw RustString(ptr: val.ok_or_err!) } }()
}
public func ecies_decrypt_k256_sha3_256(_ public_key: RustVec<UInt8>, _ private_key: RustVec<UInt8>, _ message: RustVec<UInt8>) throws -> RustVec<UInt8> {
try { let val = __swift_bridge__$ecies_decrypt_k256_sha3_256({ let val = public_key; val.isOwned = false; return val.ptr }(), { let val = private_key; val.isOwned = false; return val.ptr }(), { let val = message; val.isOwned = false; return val.ptr }()); if val.is_ok { return RustVec(ptr: val.ok_or_err!) } else { throw RustString(ptr: val.ok_or_err!) } }()
public func user_preferences_decrypt(_ public_key: RustVec<UInt8>, _ private_key: RustVec<UInt8>, _ message: RustVec<UInt8>) throws -> RustVec<UInt8> {
try { let val = __swift_bridge__$user_preferences_decrypt({ let val = public_key; val.isOwned = false; return val.ptr }(), { let val = private_key; val.isOwned = false; return val.ptr }(), { let val = message; val.isOwned = false; return val.ptr }()); if val.is_ok { return RustVec(ptr: val.ok_or_err!) } else { throw RustString(ptr: val.ok_or_err!) } }()
}
public func generate_private_preferences_topic_identifier(_ private_key: RustVec<UInt8>) throws -> RustString {
try { let val = __swift_bridge__$generate_private_preferences_topic_identifier({ let val = private_key; val.isOwned = false; return val.ptr }()); if val.is_ok { return RustString(ptr: val.ok_or_err!) } else { throw RustString(ptr: val.ok_or_err!) } }()
Expand Down
2 changes: 1 addition & 1 deletion XMTPRust.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'XMTPRust'
s.version = '0.3.6-beta0'
s.version = '0.3.7-beta0'
s.summary = 'XMTP shared Rust code that powers cross-platform SDKs'

s.homepage = 'https://github.com/xmtp/xmtp-rust-swift'
Expand Down
10 changes: 5 additions & 5 deletions XMTPRustSwift.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,32 @@
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>macos-arm64_x86_64</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>libxmtp_rust_swift.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>macos</string>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libxmtp_rust_swift.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>macos-arm64_x86_64</string>
<key>LibraryPath</key>
<string>libxmtp_rust_swift.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<string>macos</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ struct __private__ResultPtrAndPtr __swift_bridge__$diffie_hellman_k256(void* pri
struct __private__ResultPtrAndPtr __swift_bridge__$public_key_from_private_key_k256(void* private_key_bytes);
struct __private__ResultPtrAndPtr __swift_bridge__$recover_public_key_k256_sha256(void* message, void* signature);
struct __private__ResultPtrAndPtr __swift_bridge__$recover_public_key_k256_keccak256(void* message, void* signature);
struct __private__ResultPtrAndPtr __swift_bridge__$ecies_encrypt_k256_sha3_256(void* public_key, void* private_key, void* message);
struct __private__ResultPtrAndPtr __swift_bridge__$ecies_decrypt_k256_sha3_256(void* public_key, void* private_key, void* message);
struct __private__ResultPtrAndPtr __swift_bridge__$user_preferences_encrypt(void* public_key, void* private_key, void* message);
struct __private__ResultPtrAndPtr __swift_bridge__$user_preferences_decrypt(void* public_key, void* private_key, void* message);
struct __private__ResultPtrAndPtr __swift_bridge__$generate_private_preferences_topic_identifier(void* private_key);


Loading

0 comments on commit e08af69

Please sign in to comment.