BSL v0.0.0
AMMOS Bundle Protocol Security Library (BSL)
Loading...
Searching...
No Matches
DefaultSecContext_Private.h File Reference

Contains functions only used internally, however, test utilities can include this to unit test them. More...

#include <stdint.h>
#include <qcbor/qcbor_encode.h>
#include <BPSecLib_Private.h>
#include <BPSecLib_Public.h>
#include <CryptoInterface.h>
#include "rfc9173.h"
+ Include dependency graph for DefaultSecContext_Private.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BSLX_BlockMetadata_s
 
struct  BSLX_Bytestr_s
 
struct  BSLX_BIB_s
 
struct  BSLX_BCB_s
 BCB encryption context with crypto primitives. More...
 
struct  BSLX_ScratchSpace_s
 Wrapper for large, variable-sized buffer holding all working data to compete a BCB operation. More...
 

Typedefs

typedef struct BSLX_BlockMetadata_s BSLX_BlockMetadata_t
 
typedef struct BSLX_Bytestr_s BSLX_Bytestr_t
 
typedef struct BSLX_BIB_s BSLX_BIB_t
 
typedef struct BSLX_BCB_s BSLX_BCB_t
 BCB encryption context with crypto primitives.
 
typedef struct BSLX_ScratchSpace_s BSLX_ScratchSpace_t
 Wrapper for large, variable-sized buffer holding all working data to compete a BCB operation.
 

Functions

size_t BSLX_Bytestr_GetCapacity (void)
 
BSL_Data_t BSLX_Bytestr_AsData (BSLX_Bytestr_t *self)
 
int BSLX_BIB_InitFromSecOper (BSLX_BIB_t *self, const BSL_SecOper_t *sec_oper)
 Populate the BIB parameters convenience struct from the security operation struct.
 
int BSLX_BIB_GenIPPT (BSLX_BIB_t *self, BSL_Data_t ippt_space)
 Computes the Integrity-Protected Plaintext (IPPT) for a canonical bundle block (non-primary)
 
int BSLX_BIB_GenHMAC (BSLX_BIB_t *self, BSL_Data_t ippt_data)
 Performs the actual HMAC over the given IPPT, placing the result in hmac_result.
 
void * BSLX_ScratchSpace_take (BSLX_ScratchSpace_t *scratch, size_t len)
 This means "give me len bytes from the scratch space and increment a counter." This is a convenience to assign space within the scratch space for certain structs.
 
int BSLX_BCB_GetParams (const BSL_BundleRef_t *bundle, BSLX_BCB_t *bcb_context, const BSL_SecOper_t *sec_oper)
 
int BSLX_BCB_Init (BSLX_BCB_t *bcb_context, const BSL_BundleRef_t *bundle, const BSL_SecOper_t *sec_oper)
 
int BSLX_BCB_ComputeAAD (BSLX_BCB_t *bcb_context)
 
int BSLX_BCB_Encrypt (BSLX_BCB_t *bcb_context)
 
void BSLX_EncodeHeader (const BSL_CanonicalBlock_t *block, QCBOREncodeContext *encoder)
 

Detailed Description

Contains functions only used internally, however, test utilities can include this to unit test them.

Definition in file DefaultSecContext_Private.h.

Typedef Documentation

◆ BSLX_ScratchSpace_t

Wrapper for large, variable-sized buffer holding all working data to compete a BCB operation.

Deprecated:

Function Documentation

◆ BSLX_BCB_ComputeAAD()

int BSLX_BCB_ComputeAAD ( BSLX_BCB_t bcb_context)

Definition at line 40 of file BCB_AES_GCM.c.

◆ BSLX_BCB_Encrypt()

int BSLX_BCB_Encrypt ( BSLX_BCB_t bcb_context)

Definition at line 218 of file BCB_AES_GCM.c.

◆ BSLX_BCB_GetParams()

int BSLX_BCB_GetParams ( const BSL_BundleRef_t bundle,
BSLX_BCB_t bcb_context,
const BSL_SecOper_t sec_oper 
)

Definition at line 384 of file BCB_AES_GCM.c.

◆ BSLX_BCB_Init()

int BSLX_BCB_Init ( BSLX_BCB_t bcb_context,
const BSL_BundleRef_t bundle,
const BSL_SecOper_t sec_oper 
)

Definition at line 530 of file BCB_AES_GCM.c.

◆ BSLX_BIB_GenHMAC()

int BSLX_BIB_GenHMAC ( BSLX_BIB_t self,
BSL_Data_t  ippt_data 
)

Performs the actual HMAC over the given IPPT, placing the result in hmac_result.

Returns the number of bytes written into hmac_result. Negative indicates error. NOTE: This does NOT resize the result, the caller must do so.

Definition at line 251 of file BIB_HMAC_SHA2.c.

References BSL_AuthCtx_Deinit(), BSL_AuthCtx_DigestBuffer(), BSL_AuthCtx_Finalize(), BSL_AuthCtx_Init(), BSL_ERR_SECURITY_OPERATION_FAILED, BSL_LOG_ERR, BSL_Data_s::len, and BSL_Data_s::ptr.

◆ BSLX_BIB_GenIPPT()

int BSLX_BIB_GenIPPT ( BSLX_BIB_t self,
BSL_Data_t  ippt_space 
)

Computes the Integrity-Protected Plaintext (IPPT) for a canonical bundle block (non-primary)

Definition at line 188 of file BIB_HMAC_SHA2.c.

References BSL_CanonicalBlock_s::block_num, BSL_ERR_ENCODING, BSL_ERR_FAILURE, BSL_LOG_ERR, BSL_CanonicalBlock_s::btsd, BSL_CanonicalBlock_s::btsd_len, BSL_Data_s::len, and BSL_Data_s::ptr.

◆ BSLX_BIB_InitFromSecOper()

int BSLX_BIB_InitFromSecOper ( BSLX_BIB_t self,
const BSL_SecOper_t sec_oper 
)

◆ BSLX_Bytestr_AsData()

BSL_Data_t BSLX_Bytestr_AsData ( BSLX_Bytestr_t self)

Definition at line 68 of file BIB_HMAC_SHA2.c.

◆ BSLX_Bytestr_GetCapacity()

size_t BSLX_Bytestr_GetCapacity ( void  )

Definition at line 63 of file BIB_HMAC_SHA2.c.

◆ BSLX_EncodeHeader()

void BSLX_EncodeHeader ( const BSL_CanonicalBlock_t block,
QCBOREncodeContext *  encoder 
)

Definition at line 41 of file DefaultSecContext.c.

◆ BSLX_ScratchSpace_take()

void * BSLX_ScratchSpace_take ( BSLX_ScratchSpace_t scratch,
size_t  len 
)

This means "give me len bytes from the scratch space and increment a counter." This is a convenience to assign space within the scratch space for certain structs.

Definition at line 51 of file DefaultSecContext.c.