Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: tss security question #10

Open
wants to merge 17 commits into
base: alpha
Choose a base branch
from
Open

feat: tss security question #10

wants to merge 17 commits into from

Conversation

ieow
Copy link
Contributor

@ieow ieow commented Aug 30, 2023

No description provided.

@ieow ieow marked this pull request as ready for review September 1, 2023 03:46
@himanshuchawla009 himanshuchawla009 marked this pull request as draft September 7, 2023 06:23
@ieow ieow marked this pull request as ready for review September 13, 2023 05:12
remove unused param
// secp256k1 curve
public let secpN = "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"


Copy link
Collaborator

@metalurgical metalurgical Sep 13, 2023

Choose a reason for hiding this comment

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

Why are we directly exposing the encrypt and decrypt methods here?

All the logic around this and setting the relevant general store domain should be handled internally, no?

i.e How would we be able to tell that the library is behaving the same way in all situations? Should this not be implemented as a module alongside the security_question module in the library?

/// - Returns: ``
///
/// - Throws: `RuntimeError`, indicates invalid parameters was used or invalid threshold key or fail to change security question
public static func change_security_question( threshold : ThresholdKey, newQuestion: String, newAnswer: String, answer: String, tag: String) async throws {
Copy link
Contributor

Choose a reason for hiding this comment

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

why tag is required, cant we just read it from threshold key, we are not taking tag as input in web.

/// - Returns: ``
///
/// - Throws: `RuntimeError`, indicates invalid parameters was used or invalid threshold key of failed to set security question
public static func set_security_question( threshold : ThresholdKey, question: String, answer: String, factorKey :String, tag: String ) async throws {
Copy link
Contributor

Choose a reason for hiding this comment

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

why tag is required here?

Copy link
Contributor

@himanshuchawla009 himanshuchawla009 Sep 13, 2023

Choose a reason for hiding this comment

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

also in web, factor key is optional but here it seems mandatory

///
/// - Throws: `RuntimeError`, indicates invalid parameters was used or invalid threshold key or fail to change security question
public static func change_security_question( threshold : ThresholdKey, newQuestion: String, newAnswer: String, answer: String, tag: String) async throws {
let domainKey = TssSecurityQuestion + ":" + tag
Copy link
Contributor

Choose a reason for hiding this comment

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

is this domain key same in web?

/// - Returns: `String` public key of the factor
///
/// - Throws: `RuntimeError`, indicates invalid parameters was used or invalid threshold key or fail to delete security question
public static func delete_security_question( threshold : ThresholdKey, tag: String) async throws -> String {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should check if thesholdKey is initialized and has metadata key before allowing further.

@himanshuchawla009
Copy link
Contributor

add tests to check for compatiblity with web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants