diff options
| author | PProvost <[email protected]> | 2020-05-11 08:54:23 -0600 |
|---|---|---|
| committer | PProvost <[email protected]> | 2020-05-11 08:54:23 -0600 |
| commit | 0c4f784459a7564933ed91bf39f00d12608cf91c (patch) | |
| tree | cfa743731d1cfb11d83119bf1c8d0d942e8c3c73 /crypto_libraries/src/nx_crypto_null_cipher.c | |
Initial commit
Diffstat (limited to 'crypto_libraries/src/nx_crypto_null_cipher.c')
| -rw-r--r-- | crypto_libraries/src/nx_crypto_null_cipher.c | 215 |
1 files changed, 215 insertions, 0 deletions
diff --git a/crypto_libraries/src/nx_crypto_null_cipher.c b/crypto_libraries/src/nx_crypto_null_cipher.c new file mode 100644 index 00000000..34cab3db --- /dev/null +++ b/crypto_libraries/src/nx_crypto_null_cipher.c @@ -0,0 +1,215 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Crypto Component */ +/** */ +/** NULL Cipher */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + +#include "nx_crypto_null.h" + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_crypto_method_null_init PORTABLE C */ +/* 6.0 */ +/* AUTHOR */ +/* */ +/* Timothy Stapko, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function acts as a placeholder for TLS ciphersuites that do */ +/* not use a ciper for a particular operation. For example, the PSK */ +/* ciphersuite TLS_PSK_WITH_AES_128_CBC_SHA uses AES and SHA-1 but */ +/* no public cipher (e.g. RSA). */ +/* */ +/* INPUT */ +/* */ +/* method Crypto Method Object */ +/* key Key */ +/* key_size_in_bits Size of the key, in bits */ +/* handle Handle, specified by user */ +/* crypto_metadata Metadata area */ +/* crypto_metadata_size Size of the metadata area */ +/* */ +/* OUTPUT */ +/* */ +/* status Completion status */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* None */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 05-19-2020 Timothy Stapko Initial Version 6.0 */ +/* */ +/**************************************************************************/ +NX_CRYPTO_KEEP UINT _nx_crypto_method_null_init(struct NX_CRYPTO_METHOD_STRUCT *method, + UCHAR *key, NX_CRYPTO_KEY_SIZE key_size_in_bits, + VOID **handle, + VOID *crypto_metadata, + ULONG crypto_metadata_size) +{ + NX_CRYPTO_PARAMETER_NOT_USED(method); + NX_CRYPTO_PARAMETER_NOT_USED(key); + NX_CRYPTO_PARAMETER_NOT_USED(key_size_in_bits); + NX_CRYPTO_PARAMETER_NOT_USED(handle); + NX_CRYPTO_PARAMETER_NOT_USED(crypto_metadata); + NX_CRYPTO_PARAMETER_NOT_USED(crypto_metadata_size); + + return(NX_CRYPTO_SUCCESS); +} + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_crypto_method_null_cleanup PORTABLE C */ +/* 6.0 */ +/* AUTHOR */ +/* */ +/* Timothy Stapko, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function cleans up the crypto metadata. */ +/* */ +/* INPUT */ +/* */ +/* crypto_metadata Crypto metadata */ +/* */ +/* OUTPUT */ +/* */ +/* status Completion status */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 05-19-2020 Timothy Stapko Initial Version 6.0 */ +/* */ +/**************************************************************************/ +NX_CRYPTO_KEEP UINT _nx_crypto_method_null_cleanup(VOID *crypto_metadata) +{ + NX_CRYPTO_PARAMETER_NOT_USED(crypto_metadata); + + return(NX_CRYPTO_SUCCESS); +} + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _nx_crypto_method_aes_operation PORTABLE C */ +/* 6.0 */ +/* AUTHOR */ +/* */ +/* Timothy Stapko, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function encrypts and decrypts a message using */ +/* the AES algorithm. */ +/* */ +/* INPUT */ +/* */ +/* op AES operation */ +/* handle Crypto handle */ +/* method Cryption Method Object */ +/* key Encryption Key */ +/* key_size_in_bits Key size in bits */ +/* input Input data */ +/* input_length_in_byte Input data size */ +/* iv_ptr Initial vector */ +/* output Output buffer */ +/* output_length_in_byte Output buffer size */ +/* crypto_metadata Metadata area */ +/* crypto_metadata_size Metadata area size */ +/* packet_ptr Pointer to packet */ +/* nx_crypto_hw_process_callback Callback function pointer */ +/* */ +/* OUTPUT */ +/* */ +/* status Completion status */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 05-19-2020 Timothy Stapko Initial Version 6.0 */ +/* */ +/**************************************************************************/ +NX_CRYPTO_KEEP UINT _nx_crypto_method_null_operation(UINT op, /* Encrypt, Decrypt, Authenticate */ + VOID *handle, /* Crypto handler */ + struct NX_CRYPTO_METHOD_STRUCT *method, + UCHAR *key, + NX_CRYPTO_KEY_SIZE key_size_in_bits, + UCHAR *input, + ULONG input_length_in_byte, + UCHAR *iv_ptr, + UCHAR *output, + ULONG output_length_in_byte, + VOID *crypto_metadata, + ULONG crypto_metadata_size, + VOID *packet_ptr, + VOID (*nx_crypto_hw_process_callback)(VOID *packet_ptr, UINT status)) +{ + NX_CRYPTO_PARAMETER_NOT_USED(op); + NX_CRYPTO_PARAMETER_NOT_USED(handle); + NX_CRYPTO_PARAMETER_NOT_USED(method); + NX_CRYPTO_PARAMETER_NOT_USED(key); + NX_CRYPTO_PARAMETER_NOT_USED(key_size_in_bits); + NX_CRYPTO_PARAMETER_NOT_USED(input); + NX_CRYPTO_PARAMETER_NOT_USED(input_length_in_byte); + NX_CRYPTO_PARAMETER_NOT_USED(iv_ptr); + NX_CRYPTO_PARAMETER_NOT_USED(output); + NX_CRYPTO_PARAMETER_NOT_USED(output_length_in_byte); + NX_CRYPTO_PARAMETER_NOT_USED(crypto_metadata); + NX_CRYPTO_PARAMETER_NOT_USED(crypto_metadata_size); + NX_CRYPTO_PARAMETER_NOT_USED(packet_ptr); + NX_CRYPTO_PARAMETER_NOT_USED(nx_crypto_hw_process_callback); + + return(NX_CRYPTO_SUCCESS); +} + |
