quic_crypto_nif (quic v1.10.0)

View Source

Summary

Functions

hp_block(Ctx, Sample)

-spec hp_block(reference(), binary()) -> binary() | {error, atom()}.

is_loaded()

-spec is_loaded() -> boolean().

new_aead_ctx(Cipher, Key, Enc)

-spec new_aead_ctx(atom(), binary(), boolean()) -> {ok, reference()} | {error, atom()}.

new_hp_ctx(Cipher, Key)

-spec new_hp_ctx(atom(), binary()) -> {ok, reference()} | {error, atom()}.

open(Ctx, Nonce, AAD, CipherText, Tag)

-spec open(reference(), binary(), iodata(), iodata(), binary()) -> binary() | error | {error, atom()}.

open_packet(AeadCtx, HpCtx, IV, LargestRecv, ExpectedPhase, Header, EncPayload)

-spec open_packet(reference(), reference(), binary(), integer(), 0 | 1, binary(), binary()) ->
                     {non_neg_integer(), byte(), binary()} | error | key_phase | {error, atom()}.

open_run(AeadCtx, HpCtx, IV, LargestRecv, ExpectedPhase, DcidLen, Datagrams)

-spec open_run(reference(), reference(), binary(), integer(), 0 | 1, non_neg_integer(), [binary()]) ->
                  {ok, [{non_neg_integer(), byte(), [term()] | {raw, binary()}}]} | {error, atom()}.

protect_run(AeadCtx, HpCtx, IV, PN0, FirstByteBase, DCID, Payloads)

-spec protect_run(reference(), reference(), binary(), non_neg_integer(), byte(), iodata(), [iodata()]) ->
                     [binary()] | {error, atom()}.

seal(Ctx, Nonce, AAD, Plain)

-spec seal(reference(), binary(), iodata(), iodata()) -> binary() | {error, atom()}.