Skip to content

Commit

Permalink
Merge pull request #289 from tangem/release/3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tureck1y authored May 16, 2023
2 parents 06e1372 + af99635 commit 5a699ea
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 23 deletions.
22 changes: 13 additions & 9 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
* 36a3eb9 - (HEAD -> release/3.7.0, tag: develop-230, origin/develop, develop) Merge pull request #283 from tangem/master
* 134866c - (tag: develop-229, tag: 29) Merge pull request #280 from tangem/IOS-3575-sdk-research-implement-custom-card-image
* 4751c9c - Merge branch 'develop' into IOS-3575-sdk-research-implement-custom-card-image
* b6fabd2 - IOS-3575 Displaying UIImage as an NFC tag for more flexibility
* 15cfa9a - IOS-3575 Renamed the type
* e3d7b78 - IOS-3575 Changed the code order
* 69bf337 - IOS-3575 Added some docs
* 83fe4f6 - IOS-3575 Whitespace
* 3f9e59c - IOS-3575 Added a way to show an image in the ReadView
* 8fc17cbf - (HEAD -> release/3.8.0, tag: develop-233, origin/develop, develop) Merge pull request #288 from tangem/IOS-3632-refactor-the-way-nfc-tag-is-used-in-the-sdk
|\
| * ee3bf439 - IOS-3632 Renamed the NFCTag enum
| * 9c2b4d77 - IOS-3632 Revert "IOS-3632 Renamed NFCTag -> ScanTagImage. Moved it out of style into config"
| * b38f991c - IOS-3632 Revert "IOS-3632 Grammar"
| * 560d5ae8 - IOS-3632 Grammar
| * 83385d67 - IOS-3632 Renamed NFCTag -> ScanTagImage. Moved it out of style into config
|/
* 4d94be84 - (tag: develop-232) Merge pull request #286 from tangem/IOS-3604_add_schnorr
|\
| * c8c63b70 - IOS-3604 Add support for schnorr wallet creation
|/
* 057dc40d - (tag: develop-231) Merge pull request #285 from tangem/master
2 changes: 1 addition & 1 deletion TangemSdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'TangemSdk'
s.version = '3.7.0'
s.version = '3.8.0'
s.summary = 'Use TangemSdk for Tangem cards integration'

# This description is used to generate tags and improve search results.
Expand Down
1 change: 1 addition & 0 deletions TangemSdk/TangemSdk/Common/Card/EllipticCurve.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ public enum EllipticCurve: String, StringCodable, CaseIterable {
case bls12381_G2
case bls12381_G2_AUG
case bls12381_G2_POP
case bip0340
}
16 changes: 8 additions & 8 deletions TangemSdk/TangemSdk/Crypto/CryptoUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public enum CryptoUtils {
let sig = try P256.Signing.ECDSASignature(rawRepresentation: signature)

return pubKey.isValidSignature(sig, for: message)
case .bls12381_G2, .bls12381_G2_AUG, .bls12381_G2_POP:
// TODO: Add support for BLS keys.
case .bls12381_G2, .bls12381_G2_AUG, .bls12381_G2_POP, .bip0340:
// TODO: implement
throw TangemSdkError.unsupportedCurve
}
}
Expand All @@ -73,8 +73,8 @@ public enum CryptoUtils {
case .secp256r1:
let key = try? P256.Signing.PrivateKey(rawRepresentation: privateKey)
return key != nil
case .bls12381_G2, .bls12381_G2_AUG, .bls12381_G2_POP:
// TODO: Add support for BLS keys.
case .bls12381_G2, .bls12381_G2_AUG, .bls12381_G2_POP, .bip0340:
// TODO: implement
throw TangemSdkError.unsupportedCurve
}
}
Expand All @@ -90,8 +90,8 @@ public enum CryptoUtils {
case .secp256r1:
let key = try P256.Signing.PrivateKey(rawRepresentation: privateKey)
return key.publicKey.rawRepresentation
case .bls12381_G2, .bls12381_G2_AUG, .bls12381_G2_POP:
// TODO: Add support for BLS keys.
case .bls12381_G2, .bls12381_G2_AUG, .bls12381_G2_POP, .bip0340:
// TODO: implement
throw TangemSdkError.unsupportedCurve
}
}
Expand Down Expand Up @@ -121,8 +121,8 @@ public enum CryptoUtils {
let pubKey = try P256.Signing.PublicKey(x963Representation: publicKey)
let sig = try P256.Signing.ECDSASignature(rawRepresentation: signature)
return pubKey.isValidSignature(sig, for: CustomSha256Digest(hash: hash))
case .bls12381_G2, .bls12381_G2_AUG, .bls12381_G2_POP:
// TODO: Add support for BLS keys.
case .bls12381_G2, .bls12381_G2_AUG, .bls12381_G2_POP, .bip0340:
// TODO: implement
throw TangemSdkError.unsupportedCurve
}
}
Expand Down
3 changes: 3 additions & 0 deletions TangemSdk/TangemSdk/Crypto/HDWallet/BIP32/BIP32.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ fileprivate extension EllipticCurve {
case .bls12381_G2, .bls12381_G2_AUG, .bls12381_G2_POP:
// https://eips.ethereum.org/EIPS/eip-2333#derive_master_sk
fatalError("not applicable for this curve")
case .bip0340:
// TODO: https://tangem.atlassian.net/browse/IOS-3606
fatalError("not applicable for this curve")
}
}
}
6 changes: 3 additions & 3 deletions TangemSdk/TangemSdk/UI/TangemSdkStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class TangemSdkStyle: ObservableObject {
public var colors: Colors = .default
public var textSizes: TextSizes = .default
public var indicatorWidth: Float = 12
public var nfcTag: NFCTag = .genericCard
public var scanTagImage: ScanTagImage = .genericCard

public static var `default`: TangemSdkStyle = .init()
}
Expand Down Expand Up @@ -71,11 +71,11 @@ public extension TangemSdkStyle {
@available(iOS 13.0, *)
public extension TangemSdkStyle {
/// Options for displaying different tags on the scanning screen
enum NFCTag {
enum ScanTagImage {
/// Generic card provided by the SDK
case genericCard

/// A custom tag made out of an UIImage instance.
/// A custom tag made out of a UIImage instance.
/// The image can be shifted vertically from the standard position by specifying `verticalOffset`.
/// Note that the width of the image will be limited to a certain size, while the height will be determined by the aspect ratio of the image.
/// The value of the width can be found in ReadView.swift and is 210 points at the time of the writing.
Expand Down
2 changes: 1 addition & 1 deletion TangemSdk/TangemSdk/UI/Views/Scan/ReadView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct ReadView: View {

@ViewBuilder
private var tagView: some View {
switch style.nfcTag {
switch style.scanTagImage {
case .genericCard:
CardView(cardColor: style.colors.cardColor, starsColor: style.colors.starsColor)
case .image(let uiImage, let verticalOffset):
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.0
3.8.0

0 comments on commit 5a699ea

Please sign in to comment.