1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** NetX Crypto Component                                                 */
16 /**                                                                       */
17 /**   NULL Cipher                                                         */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 
23 /**************************************************************************/
24 /*                                                                        */
25 /*  APPLICATION INTERFACE DEFINITION                       RELEASE        */
26 /*                                                                        */
27 /*    nx_crypto_null.h                                    PORTABLE C      */
28 /*                                                           6.1          */
29 /*  AUTHOR                                                                */
30 /*                                                                        */
31 /*    Timothy Stapko, Microsoft Corporation                               */
32 /*                                                                        */
33 /*  DESCRIPTION                                                           */
34 /*                                                                        */
35 /*    This file defines the basic Application Interface (API) to the      */
36 /*    NetX Crypto NULL module.                                            */
37 /*                                                                        */
38 /*  RELEASE HISTORY                                                       */
39 /*                                                                        */
40 /*    DATE              NAME                      DESCRIPTION             */
41 /*                                                                        */
42 /*  05-19-2020     Timothy Stapko           Initial Version 6.0           */
43 /*  09-30-2020     Timothy Stapko           Modified comment(s),          */
44 /*                                            resulting in version 6.1    */
45 /*                                                                        */
46 /**************************************************************************/
47 
48 #ifndef NX_CRYPTO_NULL_H
49 #define NX_CRYPTO_NULL_H
50 
51 /* Determine if a C++ compiler is being used.  If so, ensure that standard
52    C is used to process the API information.  */
53 #ifdef __cplusplus
54 
55 /* Yes, C++ compiler is present.  Use standard C.  */
56 extern   "C" {
57 
58 #endif
59 
60 /* Include the ThreadX and port-specific data type file.  */
61 
62 #include "nx_crypto.h"
63 
64 /* Function prototypes */
65 
66 UINT _nx_crypto_method_null_operation(UINT op,      /* Encrypt, Decrypt, Authenticate */
67                                       VOID *handle, /* Crypto handler */
68                                       struct NX_CRYPTO_METHOD_STRUCT *method,
69                                       UCHAR *key, NX_CRYPTO_KEY_SIZE key_size_in_bits,
70                                       UCHAR *input, ULONG input_length_in_byte,
71                                       UCHAR *iv_ptr,
72                                       UCHAR *output, ULONG output_length_in_byte,
73                                       VOID *crypto_metadata, ULONG crypto_metadata_size,
74                                       VOID *packet_ptr,
75                                       VOID (*nx_crypto_hw_process_callback)(VOID *packet_ptr, UINT status));
76 
77 UINT _nx_crypto_method_null_init(struct NX_CRYPTO_METHOD_STRUCT *method,
78                                  UCHAR *key, NX_CRYPTO_KEY_SIZE key_size_in_bits,
79                                  VOID **handle,
80                                  VOID *crypto_metadata, ULONG crypto_metadata_size);
81 
82 UINT _nx_crypto_method_null_cleanup(VOID *crypto_metadata);
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif /* NX_CRYPTO_NULL_H */
89 
90