SDAF(Secure Debug Authorization Framework) is a utility software used to facilitate secure debug operations on NXP's S32 processors configured with challenge and response authentication scheme.

Binaries included:
volkano.dll - manages cryptographic operations and storage of keys.
			- can be used by explicitly linking against it, or in conjunction with volkano.exe.
			- see volkano_interface.h for exported functions.
			- see error_codes.h for possible error codes returned by these functions.
			*NOTE: Should you use volkano.dll by explicitly linking against it, volkano_init function should be called before calling other functions.
			
volkano.exe – offers a command line API to volkano.dll.
			- available list of commands can be found below.
			
volkano_utils.exe – utility tool that helps with key derivation, transportation and various other cryptographic utilities.
				  - available list of commands can be found below.

Available commands in volkano.exe:
    discover              : list the UIDs and keys registered
    discover_uid          : check if the provided UID is registered
                             -uid <UID value>
    generate_wrapkey      : generate the wrapping key pair [*1]
    get_wrapkey_auth_tag  : get the authentication tag over wrapkey modulus [*1][*2]
    set_wrapkey_2         : save the wrapkey of another card for ADKP export purposes [*2]
                             -wk2 <second wrapkey value>
                             -tag <authentication tag over the second wrapkey>
    export_wrapkey        : export the public part of the wrapping key [*1]
                             -binfile [name of the binary file to use for export]
                               default is 'wrap_key.bin'
    register_adkp         : register the key ADKP
                             -uid <UID value>
                             -key <ADKP plain/wrapped with the wrapping key>
                             -keybin <input binary file>
    register_odak         : register the key ODAK [*3]
                             -uid <UID value>
                             -key <ODAK value wrapped with the wrapping key>
    delete_record         : delete a database record [*2]
                             -uid <UID value>
    update_pwd            : set the smart card user password or update it
                             -new_pwd <new password>
                             *NOTE: when using this to set the user password initially,
                                    the -pw parameter is not required. For other subsequent
                                    calls to this command targeting the same smart card,
                                    the -pw parameter is mandatory.
    get_response          : get the answer to a challenge
                             -uid <UID value>
                             -chlg <challenge value>
                             -key [key name]
                                  * is ignored when UID is 8 bytes long
                                  * use the key name given by discover command.
    get_wrapped_adkp      : retrieve the value of an ADKP wrapped with the second wrapkey [*2]
                             -uid <UID value>

    [*1]: does not require authentication (-pw parameter will be ignored)
    [*2]: only available on smart card starting with applet version 1.4
    [*3]: only available on smart card starting with applet version 1.5

Parameters are provided as hex-strings except for the "-binfile" parameter of the "export_wrapkey" command.
E.g: volkano.exe -cmd get_response -uid 0123456789ABCDEF -chlg 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef -pw <user_password>
E.g: volkano.exe -cmd get_response -uid 0123456789ABCDEF0123456789ABCDEF -chlg 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef -key ADKP -pw <user_password>

*NOTE -pw parameter is mandatory for all commands when using a smart card, except for wrapkey commands and for the first time you use update_pwd command.
						
Available commands in volkano_utils.exe:
    wrap_key           : wraps the input key with the given wrapkey (RSA-2048)
                           -input_key <key plain value>
                           -keybin [wrapping key binary file]
                           -key [wrapping key value as hex string]
                           -outputbin [output binary file]
                           *NOTE* If -keybin is provided, -key parameter will be ignored.

    derive_adkp         : get device dependent ADKP based on the master ADKP
                           -uid <UID value>
                           -adkpm <master ADKP value>

    generate_gmac       : generate GMAC authentication tag
                           -inputbin <input binary file>
                           -adkp <ADKP plain value/hash value>
                           -IV [Initialization Vector value]

    generate_cmac       : generate CMAC authentication tag
                           -inputbin <input file>
                           -key <key plain value>
                           -context <context plain value>
                           -label <label plain value>

Parameters are provided as hex-strings except for the "-keybin" parameter of the "wrap_key" command.
E.g: volkano_utils.exe -cmd wrap_key -input_key 0123456789abcdef0123456789abcdef -keybin wrap_key.bin

For checking the version of the executables you can use the "-v" or "--version" parameters
E.g: volkano.exe -v
						  					  
Known limitations:
Windows 10 x64 only.