Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Add recoverPubkey method #44

Merged
merged 3 commits into from
Sep 5, 2018
Merged

Conversation

hewigovens
Copy link
Contributor

Try to fix #43

@codecov-io
Copy link

codecov-io commented Sep 5, 2018

Codecov Report

Merging #44 into master will increase coverage by 0.13%.
The diff coverage is 96.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
+ Coverage   82.18%   82.32%   +0.13%     
==========================================
  Files          68       68              
  Lines        2835     2863      +28     
==========================================
+ Hits         2330     2357      +27     
- Misses        505      506       +1
Impacted Files Coverage Δ
Tests/CryptoTests.swift 100% <100%> (ø) ⬆️
Sources/Crypto.m 94.93% <87.5%> (-0.84%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64775d6...7f385a3. Read the comment docs.

Sources/Crypto.h Outdated
@@ -38,6 +38,13 @@
/// @return whether the signature is valid
+ (BOOL)verifySignature:(nonnull NSData *)signature message:(nonnull NSData *)message publicKey:(nonnull NSData *)publicKey NS_SWIFT_NAME(verify(signature:message:publicKey:));

/// Try computing public key from signature and hashed message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recovers the public key from a signature and a message hash.

Sources/Crypto.h Outdated
///
/// @param signature signature of a signed message
/// @param message hashed message
/// @return public key data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@return public key or nil if the signature is not valid.

@hewigovens
Copy link
Contributor Author

Don't merge this right now, I'm testing with web3 provider

@hewigovens hewigovens merged commit a89a449 into trustwallet:master Sep 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ecRecover support
4 participants