Sha256: 076c9744e2a88b54012905f6d567fb531bc342118abf2cd5c39ebf8fa0591f05

Contents?: true

Size: 524 Bytes

Versions: 3

Compression:

Stored size: 524 Bytes

Contents

#include <string.h>

#include "crypto_hash_sha512.h"
#include "crypto_scalarmult_curve25519.h"
#include "api.h"
#include "randombytes.h"

int crypto_box_seed_keypair(
  unsigned char *pk,
  unsigned char *sk,
  const unsigned char *seed
)
{
  unsigned char hash[64];
  crypto_hash_sha512(hash,seed,32);
  memmove(sk,hash,32);
  return crypto_scalarmult_curve25519_base(pk,sk);
}

int crypto_box_keypair(
  unsigned char *pk,
  unsigned char *sk
)
{
  randombytes(sk,32);
  return crypto_scalarmult_curve25519_base(pk,sk);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rbnacl-libsodium-0.7.0 vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c
rbnacl-libsodium-0.6.1 vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c
rbnacl-libsodium-0.6.0 vendor/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c