nimcypher/sign

Types

SigningKeyPair = object
  publicKey*: PublicKey ## The 32-byte public key, derived from the secret key. Share this
                        ## to let others verify your signatures.
  secretKey*: Secret[SecretKey] ## The 64-byte secret key: the 32-byte seed followed by the 32-byte
                                ## public key. Never share this. Wiped automatically when the key
                                ## pair goes out of scope.

Procs

proc generateSigningKeyPair(): SigningKeyPair {....raises: [OSError, ValueError],
    tags: [], forbids: [].}
Generate an EdDSA signing key pair with a random seed.
proc generateSigningKeyPair(seed: Seed32): SigningKeyPair {....raises: [],
    tags: [], forbids: [].}
Generate an EdDSA signing key pair from a 32-byte seed.
proc publicKeyFromHex(s: string): PublicKey {....raises: [ValueError], tags: [],
    forbids: [].}
proc publicKeyToHex(k: PublicKey): string {....raises: [], tags: [], forbids: [].}
proc secretKeyFromHex(s: string): SecretKey {....raises: [ValueError], tags: [],
    forbids: [].}
proc secretKeyToHex(k: Secret[SecretKey]): string {....raises: [], tags: [],
    forbids: [].}
proc secretKeyToHex(k: SecretKey): string {....raises: [], tags: [], forbids: [].}
proc sign(secretKey: Secret[SecretKey]; message: openArray[byte]): Signature {.
    ...raises: [], tags: [], forbids: [].}
Sign a message with the secret key.
proc sign(secretKey: Secret[SecretKey]; message: string): Signature {.
    ...raises: [], tags: [], forbids: [].}
proc sign(secretKey: SecretKey; message: openArray[byte]): Signature {.
    ...raises: [], tags: [], forbids: [].}
Sign a message with a raw secret key.
proc sign(secretKey: SecretKey; message: string): Signature {....raises: [],
    tags: [], forbids: [].}
proc signatureFromHex(s: string): Signature {....raises: [ValueError], tags: [],
    forbids: [].}
proc signatureToHex(s: Signature): string {....raises: [], tags: [], forbids: [].}
proc verify(publicKey: PublicKey; message: openArray[byte]; signature: Signature): bool {.
    ...raises: [], tags: [], forbids: [].}
Verify a signature against the message and public key.
proc verify(publicKey: PublicKey; message: string; signature: Signature): bool {.
    ...raises: [], tags: [], forbids: [].}