Перейти к содержанию

PROTOCOL

Crypto

public protocol Crypto: AnyObject

Secure MPC signature algorithms for ECDSA and EDDSA systems

Describes both closed and open execution environments, where temporary and persistent data is stored within an environment itself and may not be imported or exported. For software implementations that means using StorageDrivers to keep data storage opaque and compatible with HSM/TEE implementations.

Methods

checkSecret(secretId:)

func checkSecret(secretId: String) async -> Bool

Check whether or not a secretId is occupied

Parameters

Name Description
secretId ID (UUID) of a secret in question

Returns

Bool

true if provided secretId is occupied

generateSecret(secretId:)

func generateSecret(secretId: String) async throws

Generate a new random secret under provided secretId

  • Throws: if secretId is already in use

Parameters

Name Description
secretId externally provided ID (UUID) to bind secret to

Returns

void

removeSecret(secretId:)

func removeSecret(secretId: String) async

Remove stored secret from storage

Parameters

Name Description
secretId ID (UUID) of a secret in question

Returns

void

exportSecret(secretId:)

func exportSecret(secretId: String) async -> String?

Export stored secret as string

  • Note: Actual ability to import/export secrets may depend on implementation.

Parameters

Name Description
secretId ID (UUID) of a secret in question

Returns

String?

64 bytes of base64-encoded data or null if no secret is present under secretId

importSecret(secretId:secret:)

func importSecret(secretId: String, secret: String) async throws

Import an existing secret under specified secretId

  • Throws: if secretId is already in use

  • Note: Actual ability to import/export secrets may depend on implementation.

Parameters

Name Description
secretId externally provided ID (UUID) to bind secret to
secretId 64 bytes of base64-encoded data

Returns

void

createEcdsaKeyCommitment(secretId:syncSessionId:curve:derivationCoin:derivationAccount:)

func createEcdsaKeyCommitment(secretId: String, syncSessionId: String, curve: EcdsaCurve, derivationCoin: UInt32, derivationAccount: UInt32) async throws -> String

createEcdsaKeyGenerationDataProof(secretId:syncSessionId:curve:derivationCoin:derivationAccount:keyCommitment:)

func createEcdsaKeyGenerationDataProof(secretId: String, syncSessionId: String, curve: EcdsaCurve, derivationCoin: UInt32, derivationAccount: UInt32, keyCommitment: String) async throws -> String

createEcdsaKeyDecommitment(syncSessionId:keyGenerationDataProof:)

func createEcdsaKeyDecommitment(syncSessionId: String, keyGenerationDataProof: String) async throws -> String

createDistributedEcdsaKey(syncSessionId:keyDecommitment:)

func createDistributedEcdsaKey(syncSessionId: String, keyDecommitment: String)  async throws

createEcdsaChallengeCommitment(syncSessionId:)

func createEcdsaChallengeCommitment(syncSessionId: String) async throws -> String

createEcdsaChallengeResponseCommitment(syncSessionId:challengeCommitment:)

func createEcdsaChallengeResponseCommitment(syncSessionId: String, challengeCommitment: String) async throws -> String

createEcdsaChallengeDecommitment(syncSessionId:challengeResponseCommitment:)

func createEcdsaChallengeDecommitment(syncSessionId: String, challengeResponseCommitment: String) async throws -> String

createEcdsaChallangeResponseDecommitment(syncSessionId:challengeDecommitment:)

func createEcdsaChallangeResponseDecommitment(syncSessionId: String, challengeDecommitment: String) async throws -> String

verifyEcdsaChallengeResponseDecommitment(syncSessionId:challengeResponseDecommitment:)

func verifyEcdsaChallengeResponseDecommitment(syncSessionId: String, challengeResponseDecommitment: String) async throws -> String

getCompoundEcdsaPublicKey(secretId:syncSessionId:)

func getCompoundEcdsaPublicKey(secretId: String, syncSessionId: String) async throws -> String

removeDistributedEcdsaKey(secretId:syncSessionId:)

func removeDistributedEcdsaKey(secretId: String, syncSessionId: String) async throws

createEcdsaSigningKeyCommitment(secretId:syncSessionId:signSessionId:message:)

func createEcdsaSigningKeyCommitment(secretId: String, syncSessionId: String, signSessionId: String, message: String) async throws -> String

createEcdsaSigningKeyGenerationDataProof(secretId:syncSessionId:signSessionId:message:signingKeyCommitment:)

func createEcdsaSigningKeyGenerationDataProof(secretId: String, syncSessionId: String, signSessionId: String, message: String, signingKeyCommitment: String) async throws -> String

createEcdsaSigningKeyDecommitment(signSessionId:signingKeyGenerationDataProof:)

func createEcdsaSigningKeyDecommitment(signSessionId: String, signingKeyGenerationDataProof: String) async throws -> String

createEcdsaPartialSignature(signSessionId:signingKeyDecommitment:)

func createEcdsaPartialSignature(signSessionId: String, signingKeyDecommitment: String) async throws -> String

createEcdsaSignature(signSessionId:partialSignature:)

func createEcdsaSignature(signSessionId: String, partialSignature: String) async throws -> EcdsaSignature

createEddsaKeyCommitment(secretId:syncSessionId:curve:derivationCoin:derivationAccount:)

func createEddsaKeyCommitment(secretId: String, syncSessionId: String, curve: EddsaCurve, derivationCoin: UInt32, derivationAccount: UInt32) async throws -> String

createEddsaKeyGenerationDataProof(secretId:syncSessionId:curve:derivationCoin:derivationAccount:keyCommitment:)

func createEddsaKeyGenerationDataProof(secretId: String, syncSessionId: String, curve: EddsaCurve, derivationCoin: UInt32, derivationAccount: UInt32, keyCommitment: String) async throws -> String

createEddsaKeyDecommitment(syncSessionId:keyGenerationDataProof:)

func createEddsaKeyDecommitment(syncSessionId: String, keyGenerationDataProof: String) async throws -> (String, String)

createDistributedEddsaKey(syncSessionId:keyDecommitment:)

func createDistributedEddsaKey(syncSessionId: String, keyDecommitment: String) async throws -> String

getCompoundEddsaPublicKey(secretId:syncSessionId:)

func getCompoundEddsaPublicKey(secretId: String, syncSessionId: String) async throws -> String

removeDistributedEddsaKey(secretId:syncSessionId:)

func removeDistributedEddsaKey(secretId: String, syncSessionId: String) async throws

createEddsaSigningKeyCommitment(secretId:syncSessionId:signSessionId:message:)

func createEddsaSigningKeyCommitment(secretId: String, syncSessionId: String, signSessionId: String, message: String) async throws -> String

createEddsaSigningKeyGenerationDataProof(secretId:syncSessionId:signSessionId:message:signingKeyCommitment:)

func createEddsaSigningKeyGenerationDataProof(secretId: String, syncSessionId: String, signSessionId: String, message: String, signingKeyCommitment: String) async throws -> String

createEddsaSigningKeyDecommitment(signSessionId:signingKeyGenerationDataProof:)

func createEddsaSigningKeyDecommitment(signSessionId: String, signingKeyGenerationDataProof: String) async throws -> String

createEddsaPartialSignature(signSessionId:signingKeyDecommitment:)

func createEddsaPartialSignature(signSessionId: String, signingKeyDecommitment: String) async throws -> String

createEddsaSignature(signSessionId:partialSignature:)

func createEddsaSignature(signSessionId: String, partialSignature: String) async throws -> EddsaSignature