Packages

SRP (Secure Remote Password) 6a library for Elixir

Current section

Files

Jump to
cryptx lib cryptxc.ex
Raw

lib/cryptxc.ex

defmodule CryptxC do
@moduledoc false
@n_number Application.get_env(:cryptx, :N, "0x0")
@k_number Application.get_env(:cryptx, :k, "0x0")
@g_number Application.get_env(:cryptx, :g, "0x0")
@compile {:autoload, false}
@on_load {:init, 0}
def init do
case load_nif() do
:ok -> :ok
_ -> raise """
An error occurred when loading CryptxC.
"""
end
end
defp load_nif do
path = :filename.join(:code.priv_dir(:cryptx), 'cryptxc')
:erlang.load_nif(path, [@n_number, @k_number, @g_number])
end
def sha1(_a) do
raise "NIF sha1/1 not implemented"
end
def sha512(_a) do
raise "NIF sha512/1 not implemented"
end
def compute_B(_a) do
raise "NIF compute_B/1 not implemented"
end
def compute_u(_a, _b) do
raise "NIF compute_u/2 not implemented"
end
def compute_K(_a, _b, _c, _d) do
raise "NIF compute_K/4 not implemented"
end
def compute_M(_a, _b, _c, _d, _e) do
raise "NIF compute_M/5 not implemented"
end
def compute_R(_a, _b, _c) do
raise "NIF compute_R/3 not implemented"
end
def compute_s() do
raise "NIF compute_s/0 not implemented"
end
def compute_v(_a) do
raise "NIF compute_v/1 not implemented"
end
def is_zero_mod_N(_a) do
raise "NIF is_zero_mod_N/1 not implemented"
end
end