sodium-native

sodium-native

  • Get Started
  • API
  • Github

›API

Get Started

  • Introduction
  • Projects using sodium-native

API

  • Compatibility
  • API
  • Memory Protection
  • Generating Random Data
  • Helpers
  • Padding
  • Signing
  • Generic Hashing
  • Public/Secret Key Box Encryption
  • Sealed Box Encryption
  • Secret Key Box Encryption
  • AEAD (Authenticated Encryption with Additional Data)
  • Non-Authenticated Streaming Encryption
  • Authentication
  • Stream Encryption
  • One-Time Authentication
  • Password Hashing
  • Key Exchange
  • Diffie-Hellman
  • Finite Field Arithmetic
  • Short Hashes
  • Key Derivation
  • SHA
  • License

Diffie-Hellman

Bindings for the crypto_scalarmult API. See the libsodium crypto_scalarmult docs for more information.

Constants

Buffer lengths (integer)

  • crypto_scalarmult_BYTES
  • crypto_scalarmult_SCALARBYTES

crypto_scalarmult_base

sodium-native sodium-javascript

sodium.crypto_scalarmult_base(q, n)

Creates a scalar multiplication public key based on a secret key.

  • q should be a buffer of length crypto_scalarmult_BYTES
  • n should be a buffer of length crypto_scalarmult_SCALARBYTES

The generated public key is stored in q.


crypto_scalarmult

sodium-native sodium-javascript

sodium.crypto_scalarmult(q, n, p)

Derives a shared secret from a local secret key and a remote public key.

  • q should be a buffer of length crypto_scalarmult_BYTES
  • n should be a buffer of length crypto_scalarmult_SCALARBYTES
  • p should be a buffer of length crypto_scalarmult_BYTES

The generated shared secret is stored in q.

← Key ExchangeFinite Field Arithmetic →
  • Constants
  • crypto_scalarmult_base
  • crypto_scalarmult
Docs
Get StartedAPI
Community
LibsodiumHyperdivisionHyperdivision on Twitter
More
GitHubStar
Copyright © 2020 Hyperdivision