Skip to content

Instantly share code, notes, and snippets.

@RoadRunnr
RoadRunnr / aes_cmac.erl
Created August 21, 2016 12:38
Erlang AES CMAC
-module(aes_cmac).
%% R20 will have CMAC in crypto....
-export([aes_cmac/2, generate_subkeys/1]).
-define(Zero, <<0:128>>).
-define(Rb, <<16#87:128>>).
-define(BlockSize, 16).
%% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@RoadRunnr
RoadRunnr / dtls_client.erl
Created February 8, 2016 07:50
Erlang DTLS sample client
-module(dtls_client).
-export([connect/1]).
psk_verify(Username, UserState) ->
io:format("Server Hint: ~p~n", [Username]),
{ok, UserState}.
connect(Port) ->
[application:start(X) || X <- [crypto, asn1, public_key, ssl]],