Index
Modules:
e2ee
,
e2ee/aead
,
e2ee/blake2b
,
e2ee/chacha
,
e2ee/password
,
e2ee/private/monocypher
,
e2ee/private/utils
,
e2ee/sha512
,
e2ee/signs
.
API symbols
aeadDjb:
aead: AeadStreamMode.aeadDjb
aeadIetf:
aead: AeadStreamMode.aeadIetf
AeadStream:
aead: object AeadStream
aeadStreamInit:
aead: proc aeadStreamInit(mode: AeadStreamMode; key: Key32; nonce: openArray[uint8]): AeadStream
aeadStreamInitDjb:
aead: proc aeadStreamInitDjb(key: Key32; nonce: array[8, uint8]): AeadStream
aeadStreamInitIetf:
aead: proc aeadStreamInitIetf(key: Key32; nonce: array[12, uint8]): AeadStream
aeadStreamInitX:
aead: proc aeadStreamInitX(key: Key32; nonce: array[24, uint8]): AeadStream
AeadStreamMode:
aead: enum AeadStreamMode
aeadStreamRead:
aead: proc aeadStreamRead(stream: var AeadStream; cipherText: openArray[uint8]; mac: Mac16; ad: openArray[uint8] = []): seq[uint8]
aeadStreamWrite:
aead: proc aeadStreamWrite(stream: var AeadStream; plainText: openArray[uint8]; ad: openArray[uint8] = []): (seq[uint8], Mac16)
aeadX:
aead: AeadStreamMode.aeadX
blake:
blake2b: proc blake(message: openArray[byte]; hashSize: int = Blake2bDefaultDigestSize): seq[ byte]
blake2b: proc blake(message: string; hashSize: int = Blake2bDefaultDigestSize): seq[byte]
Blake2b:
blake2b: object Blake2b
Blake2bDefaultDigestSize:
blake2b: const Blake2bDefaultDigestSize
Blake2bMaxDigestSize:
blake2b: const Blake2bMaxDigestSize
Blake2bMaxKeySize:
blake2b: const Blake2bMaxKeySize
Blake2bMinDigestSize:
blake2b: const Blake2bMinDigestSize
blakeHex:
blake2b: proc blakeHex(message: openArray[byte]; hashSize: int = Blake2bDefaultDigestSize): string
blake2b: proc blakeHex(message: string; hashSize: int = Blake2bDefaultDigestSize): string
blakeKeyed:
blake2b: proc blakeKeyed(message: openArray[byte]; key: openArray[byte]; hashSize: int = Blake2bDefaultDigestSize): seq[byte]
blake2b: proc blakeKeyed(message, key: string; hashSize: int = Blake2bDefaultDigestSize): seq[ byte]
blakeKeyedHex:
blake2b: proc blakeKeyedHex(message: openArray[byte]; key: openArray[byte]; hashSize: int = Blake2bDefaultDigestSize): string
blake2b: proc blakeKeyedHex(message, key: string; hashSize: int = Blake2bDefaultDigestSize): string
ChachaMessage:
chacha: object ChachaMessage
computeChallengeMac:
aead: proc computeChallengeMac(secret: Key32; challenge: Mac16): Mac16
crypto_aead_ctx:
monocypher: object crypto_aead_ctx
crypto_aead_init_djb:
monocypher: proc crypto_aead_init_djb(ctx: ptr crypto_aead_ctx; key: ptr uint8; nonce: ptr uint8)
crypto_aead_init_ietf:
monocypher: proc crypto_aead_init_ietf(ctx: ptr crypto_aead_ctx; key: ptr uint8; nonce: ptr uint8)
crypto_aead_init_x:
monocypher: proc crypto_aead_init_x(ctx: ptr crypto_aead_ctx; key: ptr uint8; nonce: ptr uint8)
crypto_aead_lock:
monocypher: proc crypto_aead_lock(cipher_text: ptr uint8; mac: ptr uint8; key: ptr uint8; nonce: ptr uint8; ad: ptr uint8; ad_size: csize_t; plain_text: ptr uint8; text_size: csize_t)
crypto_aead_read:
monocypher: proc crypto_aead_read(ctx: ptr crypto_aead_ctx; plain_text: ptr uint8; mac: ptr uint8; ad: ptr uint8; ad_size: csize_t; cipher_text: ptr uint8; text_size: csize_t): cint
crypto_aead_unlock:
monocypher: proc crypto_aead_unlock(plain_text: ptr uint8; mac: ptr uint8; key: ptr uint8; nonce: ptr uint8; ad: ptr uint8; ad_size: csize_t; cipher_text: ptr uint8; text_size: csize_t): cint
crypto_aead_write:
monocypher: proc crypto_aead_write(ctx: ptr crypto_aead_ctx; cipher_text: ptr uint8; mac: ptr uint8; ad: ptr uint8; ad_size: csize_t; plain_text: ptr uint8; text_size: csize_t)
crypto_argon2:
monocypher: proc crypto_argon2(hash: ptr uint8; hash_size: uint32; work_area: pointer; config: crypto_argon2_config; inputs: crypto_argon2_inputs; extras: crypto_argon2_extras)
crypto_argon2_config:
monocypher: object crypto_argon2_config
CRYPTO_ARGON2_D:
monocypher: const CRYPTO_ARGON2_D
crypto_argon2_extras:
monocypher: object crypto_argon2_extras
CRYPTO_ARGON2_I:
monocypher: const CRYPTO_ARGON2_I
CRYPTO_ARGON2_ID:
monocypher: const CRYPTO_ARGON2_ID
crypto_argon2_inputs:
monocypher: object crypto_argon2_inputs
crypto_argon2_no_extras:
monocypher: var crypto_argon2_no_extras
crypto_blake2b:
monocypher: proc crypto_blake2b(hash: ptr uint8; hash_size: csize_t; message: ptr uint8; message_size: csize_t)
crypto_blake2b_ctx:
monocypher: object crypto_blake2b_ctx
crypto_blake2b_final:
monocypher: proc crypto_blake2b_final(ctx: ptr crypto_blake2b_ctx; hash: ptr uint8)
crypto_blake2b_init:
monocypher: proc crypto_blake2b_init(ctx: ptr crypto_blake2b_ctx; hash_size: csize_t)
crypto_blake2b_keyed:
monocypher: proc crypto_blake2b_keyed(hash: ptr uint8; hash_size: csize_t; key: ptr uint8; key_size: csize_t; message: ptr uint8; message_size: csize_t)
crypto_blake2b_keyed_init:
monocypher: proc crypto_blake2b_keyed_init(ctx: ptr crypto_blake2b_ctx; hash_size: csize_t; key: ptr uint8; key_size: csize_t)
crypto_blake2b_update:
monocypher: proc crypto_blake2b_update(ctx: ptr crypto_blake2b_ctx; message: ptr uint8; message_size: csize_t)
crypto_chacha20_djb:
monocypher: proc crypto_chacha20_djb(cipher_text: ptr uint8; plain_text: ptr uint8; text_size: csize_t; key: ptr uint8; nonce: ptr uint8; ctr: uint64): uint64
crypto_chacha20_h:
monocypher: proc crypto_chacha20_h(out: ptr uint8; key: ptr uint8; in: ptr uint8)
crypto_chacha20_ietf:
monocypher: proc crypto_chacha20_ietf(cipher_text: ptr uint8; plain_text: ptr uint8; text_size: csize_t; key: ptr uint8; nonce: ptr uint8; ctr: uint32): uint32
crypto_chacha20_x:
monocypher: proc crypto_chacha20_x(cipher_text: ptr uint8; plain_text: ptr uint8; text_size: csize_t; key: ptr uint8; nonce: ptr uint8; ctr: uint64): uint64
crypto_eddsa_check:
monocypher: proc crypto_eddsa_check(signature: ptr uint8; public_key: ptr uint8; message: ptr uint8; message_size: csize_t): cint
crypto_eddsa_check_equation:
monocypher: proc crypto_eddsa_check_equation(signature: ptr uint8; public_key: ptr uint8; h_ram: ptr uint8): cint
crypto_eddsa_key_pair:
monocypher: proc crypto_eddsa_key_pair(secret_key: ptr uint8; public_key: ptr uint8; seed: ptr uint8)
crypto_eddsa_mul_add:
monocypher: proc crypto_eddsa_mul_add(r: ptr uint8; a: ptr uint8; b: ptr uint8; c: ptr uint8)
crypto_eddsa_reduce:
monocypher: proc crypto_eddsa_reduce(reduced: ptr uint8; expanded: ptr uint8)
crypto_eddsa_scalarbase:
monocypher: proc crypto_eddsa_scalarbase(point: ptr uint8; scalar: ptr uint8)
crypto_eddsa_sign:
monocypher: proc crypto_eddsa_sign(signature: ptr uint8; secret_key: ptr uint8; message: ptr uint8; message_size: csize_t)
crypto_eddsa_to_x25519:
monocypher: proc crypto_eddsa_to_x25519(x25519: ptr uint8; eddsa: ptr uint8)
crypto_eddsa_trim_scalar:
monocypher: proc crypto_eddsa_trim_scalar(out: ptr uint8; in: ptr uint8)
crypto_elligator_key_pair:
monocypher: proc crypto_elligator_key_pair(hidden: array[32, uint8]; secret_key: array[32, uint8]; seed: array[32, uint8])
crypto_elligator_map:
monocypher: proc crypto_elligator_map(curve: array[32, uint8]; hidden: array[32, uint8])
crypto_elligator_rev:
monocypher: proc crypto_elligator_rev(hidden: array[32, uint8]; curve: array[32, uint8]; tweak: uint8): cint
crypto_poly1305:
monocypher: proc crypto_poly1305(mac: array[16, uint8]; message: ptr uint8; message_size: csize_t; key: array[32, uint8])
crypto_poly1305_ctx:
monocypher: object crypto_poly1305_ctx
crypto_poly1305_final:
monocypher: proc crypto_poly1305_final(ctx: ptr crypto_poly1305_ctx; mac: array[16, uint8])
crypto_poly1305_init:
monocypher: proc crypto_poly1305_init(ctx: ptr crypto_poly1305_ctx; key: array[32, uint8])
crypto_poly1305_update:
monocypher: proc crypto_poly1305_update(ctx: ptr crypto_poly1305_ctx; message: ptr uint8; message_size: csize_t)
crypto_sha512:
monocypher: proc crypto_sha512(hash: ptr uint8; message: ptr uint8; message_size: csize_t)
crypto_sha512_ctx:
monocypher: object crypto_sha512_ctx
crypto_sha512_final:
monocypher: proc crypto_sha512_final(ctx: ptr crypto_sha512_ctx; hash: ptr uint8)
crypto_sha512_hkdf:
monocypher: proc crypto_sha512_hkdf(okm: ptr uint8; okm_size: csize_t; ikm: ptr uint8; ikm_size: csize_t; salt: ptr uint8; salt_size: csize_t; info: ptr uint8; info_size: csize_t)
crypto_sha512_hkdf_expand:
monocypher: proc crypto_sha512_hkdf_expand(okm: ptr uint8; okm_size: csize_t; prk: ptr uint8; prk_size: csize_t; info: ptr uint8; info_size: csize_t)
crypto_sha512_hmac:
monocypher: proc crypto_sha512_hmac(hmac: ptr uint8; key: ptr uint8; key_size: csize_t; message: ptr uint8; message_size: csize_t)
crypto_sha512_hmac_ctx:
monocypher: object crypto_sha512_hmac_ctx
crypto_sha512_hmac_final:
monocypher: proc crypto_sha512_hmac_final(ctx: ptr crypto_sha512_hmac_ctx; hmac: ptr uint8)
crypto_sha512_hmac_init:
monocypher: proc crypto_sha512_hmac_init(ctx: ptr crypto_sha512_hmac_ctx; key: ptr uint8; key_size: csize_t)
crypto_sha512_hmac_update:
monocypher: proc crypto_sha512_hmac_update(ctx: ptr crypto_sha512_hmac_ctx; message: ptr uint8; message_size: csize_t)
crypto_sha512_init:
monocypher: proc crypto_sha512_init(ctx: ptr crypto_sha512_ctx)
crypto_sha512_update:
monocypher: proc crypto_sha512_update(ctx: ptr crypto_sha512_ctx; message: ptr uint8; message_size: csize_t)
crypto_verify16:
monocypher: proc crypto_verify16(a: ptr uint8; b: ptr uint8): cint
crypto_verify32:
monocypher: proc crypto_verify32(a: ptr uint8; b: ptr uint8): cint
crypto_verify64:
monocypher: proc crypto_verify64(a: ptr uint8; b: ptr uint8): cint
crypto_wipe:
monocypher: proc crypto_wipe(secret: pointer; size: csize_t)
crypto_x25519:
monocypher: proc crypto_x25519(raw_shared_secret: ptr uint8; your_secret_key: ptr uint8; their_public_key: ptr uint8)
crypto_x25519_dirty_fast:
monocypher: proc crypto_x25519_dirty_fast(pk: ptr uint8; sk: ptr uint8)
crypto_x25519_dirty_small:
monocypher: proc crypto_x25519_dirty_small(pk: ptr uint8; sk: ptr uint8)
crypto_x25519_inverse:
monocypher: proc crypto_x25519_inverse(blind_salt: ptr uint8; private_key: ptr uint8; curve_point: ptr uint8)
crypto_x25519_public_key:
monocypher: proc crypto_x25519_public_key(public_key: ptr uint8; secret_key: ptr uint8)
crypto_x25519_to_eddsa:
monocypher: proc crypto_x25519_to_eddsa(eddsa: ptr uint8; x25519: ptr uint8)
decrypt:
aead: proc decrypt(cipherText: seq[uint8]; mac: RandomBytes; key: array[32, uint8]; nonce: array[24, uint8]): string
chacha: proc decrypt(cipherText: seq[uint8]; key: Key32; nonce: Nonce24): string
deriveKeyFromPassword:
password: proc deriveKeyFromPassword(password: string; salt: RandomBytes): Key32
encrypt:
aead: proc encrypt(text: string; key: array[32, uint8]; nonce: array[24, uint8]): ( seq[uint8], RandomBytes)
aead: proc encrypt(text: string; key: string; nonce: string): (seq[uint8], RandomBytes)
chacha: proc encrypt(plainText: string; key: Key32; nonce: Nonce24): seq[uint8]
finish:
blake2b: proc finish(state: var Blake2b): seq[byte]
sha512: proc finish(state: var Sha512HmacState): Sha512Hmac
sha512: proc finish(state: var Sha512State): Sha512Digest
finishHex:
blake2b: proc finishHex(state: var Blake2b): string
sha512: proc finishHex(state: var Sha512HmacState): string
sha512: proc finishHex(state: var Sha512State): string
fromHex:
utils: proc fromHex[N: static int; T](s: string): array[N, T]
generatePassword:
password: proc generatePassword(master: string; salt: string; length: int): string
generateSalt:
utils: proc generateSalt(len: static int = 16): RandomBytes
generateSigningKeyPair:
signs: proc generateSigningKeyPair(): SigningKeyPair
signs: proc generateSigningKeyPair(seed: Seed32): SigningKeyPair
hashPassword:
password: proc hashPassword(password: string): string
hkdfExpandSha512:
sha512: proc hkdfExpandSha512[N: static[int]](prk, info: openArray[byte]): array[N, uint8]
sha512: proc hkdfExpandSha512(prk, info: openArray[byte]; okmLen: Natural): seq[uint8]
sha512: proc hkdfExpandSha512(prk, info: string; okmLen: Natural): seq[uint8]
hkdfSha512:
sha512: proc hkdfSha512[N: static[int]](ikm, salt, info: openArray[byte]): array[N, uint8]
sha512: proc hkdfSha512(ikm, salt, info: openArray[byte]; okmLen: Natural): seq[uint8]
sha512: proc hkdfSha512(ikm, salt, info: string; okmLen: Natural): seq[uint8]
initBlake2b:
blake2b: proc initBlake2b(hashSize: int = Blake2bDefaultDigestSize): Blake2b
initBlake2bKeyed:
blake2b: proc initBlake2bKeyed(key: openArray[byte]; hashSize: int = Blake2bDefaultDigestSize): Blake2b
blake2b: proc initBlake2bKeyed(key: string; hashSize: int = Blake2bDefaultDigestSize): Blake2b
initSha512:
sha512: proc initSha512(): Sha512State
initSha512Hmac:
sha512: proc initSha512Hmac(key: openArray[byte]): Sha512HmacState
sha512: proc initSha512Hmac(key: string): Sha512HmacState
Key32:
utils: type Key32
keyPairFromPassword:
aead: proc keyPairFromPassword(password: string; salt: RandomBytes): (Key32, Key32)
Mac16:
utils: type Mac16
Nonce24:
utils: type Nonce24
PublicKey:
signs: type PublicKey
publicKeyFromHex:
signs: proc publicKeyFromHex(s: string): PublicKey
publicKeyToHex:
signs: proc publicKeyToHex(k: PublicKey): string
RandomBytes:
utils: type RandomBytes
randomBytes:
utils: proc randomBytes[N: static int](): array[N, uint8]
seal:
aead: proc seal(plainText: string; key: Key32): SealedMessage
chacha: proc seal(plainText: string; key: Key32): ChachaMessage
SealedMessage:
aead: object SealedMessage
sealWithPassword:
chacha: proc sealWithPassword(plainText, password: string; salt: RandomBytes): ChachaMessage
SecretKey:
signs: type SecretKey
secretKeyFromHex:
signs: proc secretKeyFromHex(s: string): SecretKey
secretKeyToHex:
signs: proc secretKeyToHex(k: SecretKey): string
Seed32:
signs: type Seed32
seqPtr:
utils: proc seqPtr(data: var seq[uint8]): ptr uint8
sha512:
sha512: proc sha512(message: openArray[byte]): Sha512Digest
sha512: proc sha512(message: string): Sha512Digest
Sha512BlockSize:
sha512: const Sha512BlockSize
Sha512Digest:
sha512: type Sha512Digest
Sha512DigestSize:
sha512: const Sha512DigestSize
sha512Hex:
sha512: proc sha512Hex(message: openArray[byte]): string
sha512: proc sha512Hex(message: string): string
Sha512Hmac:
sha512: type Sha512Hmac
sha512Hmac:
sha512: proc sha512Hmac(key, message: openArray[byte]): Sha512Hmac
sha512: proc sha512Hmac(key, message: string): Sha512Hmac
sha512HmacHex:
sha512: proc sha512HmacHex(key, message: openArray[byte]): string
sha512: proc sha512HmacHex(key, message: string): string
Sha512HmacState:
sha512: object Sha512HmacState
Sha512Prk:
sha512: type Sha512Prk
Sha512State:
sha512: object Sha512State
sharedSecret:
aead: proc sharedSecret(mySecret: Key32; theirPublic: Key32): Key32
sign:
signs: proc sign(secretKey: SecretKey; message: openArray[uint8]): Signature
signs: proc sign(secretKey: SecretKey; message: string): Signature
Signature:
signs: type Signature
signatureFromHex:
signs: proc signatureFromHex(s: string): Signature
signatureToHex:
signs: proc signatureToHex(s: Signature): string
SigningKeyPair:
signs: object SigningKeyPair
strPtr:
utils: proc strPtr(s: string): ptr uint8
toHex:
utils: proc toHex[T](v: T): string
toHexDigest:
blake2b: proc toHexDigest(digest: openArray[byte]): string
toPtr:
utils: proc toPtr(data: openArray[byte]): ptr uint8
unseal:
aead: proc unseal(msg: SealedMessage; key: Key32): string
chacha: proc unseal(msg: ChachaMessage; key: Key32): string
unsealWithPassword:
chacha: proc unsealWithPassword(msg: ChachaMessage; password: string; salt: RandomBytes): string
update:
blake2b: proc update(state: var Blake2b; chunk: openArray[byte])
blake2b: proc update(state: var Blake2b; chunk: string)
sha512: proc update(state: var Sha512HmacState; message: openArray[byte])
sha512: proc update(state: var Sha512HmacState; message: string)
sha512: proc update(state: var Sha512State; message: openArray[byte])
sha512: proc update(state: var Sha512State; message: string)
verify:
signs: proc verify(publicKey: PublicKey; message: openArray[uint8]; signature: Signature): bool
signs: proc verify(publicKey: PublicKey; message: string; signature: Signature): bool
verifyChallengeMac:
aead: proc verifyChallengeMac(secret: Key32; challenge: Mac16; received: Mac16): bool
verifyDigest:
blake2b: proc verifyDigest(a, b: openArray[byte]): bool
blake2b: proc verifyDigest(a, b: string): bool
verifyPassword:
password: proc verifyPassword(password, stored: string): bool
x25519KeyPair:
aead: proc x25519KeyPair(secret: Key32): (Key32, Key32)