Commit 7c8272ba authored by Jesper Louis Andersen's avatar Jesper Louis Andersen
Browse files

Keypair generation cannot fail.

Do not return an `ok` style tuple if key generation cannot fail.
parent f2053989
......@@ -113,7 +113,7 @@ ERL_NIF_TERM enif_crypto_box_keypair(ErlNifEnv *env, int argc, ERL_NIF_TERM cons
crypto_box_keypair(pk.data, sk.data);
return enif_make_tuple3(env, enif_make_atom(env, "ok"), enif_make_binary(env, &pk), enif_make_binary(env, &sk));
return enif_make_tuple2(env, enif_make_binary(env, &pk), enif_make_binary(env, &sk));
}
static
......@@ -216,7 +216,7 @@ ERL_NIF_TERM enif_crypto_sign_keypair(ErlNifEnv *env, int argc, ERL_NIF_TERM con
crypto_sign_keypair(pk.data, sk.data);
return enif_make_tuple3(env, enif_make_atom(env, "ok"), enif_make_binary(env, &pk), enif_make_binary(env, &sk));
return enif_make_tuple2(env, enif_make_binary(env, &pk), enif_make_binary(env, &sk));
}
static
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment