OPTIGA Trust M  1.1.0
C++ library for Optiga Trust M Chip Security Controller
optiga_lib_common.c File Reference

This file implements the commonly used functions by the OPTIGA Library . More...

Include dependency graph for optiga_lib_common.c:

Functions

uint32_t optiga_common_get_uint32 (const uint8_t *p_input_buffer)
 Prepares uint32 [Big endian] type value from the buffer and store. More...
 
void optiga_common_set_uint16 (uint8_t *p_output_buffer, uint16_t two_byte_value)
 Copies 2 bytes of uint16 type value to the buffer. More...
 
void optiga_common_set_uint32 (uint8_t *p_output_buffer, uint32_t four_byte_value)
 Copies 4 bytes of uint32 [Big endian] type value to the buffer and stores in the output pointer. More...
 
void optiga_common_get_uint16 (const uint8_t *p_input_buffer, uint16_t *p_two_byte_value)
 Prepares uint16 [Big endian] type value from the buffer and stores in the output pointer. More...
 

Detailed Description

This file implements the commonly used functions by the OPTIGA Library .

Copyright (c) 2019 Infineon Technologies AG

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

\endcopyright

Author
Infineon Technologies AG

Function Documentation

◆ optiga_common_get_uint16()

void optiga_common_get_uint16 ( const uint8_t *  p_input_buffer,
uint16_t *  p_two_byte_value 
)

Prepares uint16 [Big endian] type value from the buffer and stores in the output pointer.

Prepares uint16 [Big endian] type value from the buffer and store

  • Return first 2 bytes from input buffer as uint16_t.
Precondition
  • None
Note
  • None
Parameters
[in]p_input_bufferPointer to the buffer
[in,out]p_two_byte_valuePointer to the value tobe assigne

◆ optiga_common_get_uint32()

uint32_t optiga_common_get_uint32 ( const uint8_t *  p_input_buffer)

Prepares uint32 [Big endian] type value from the buffer and store.

Prepares uint32 [Big endian] type value from the buffer and store

  • Return first 4 bytes from input buffer as uint32_t.
Precondition
  • None
Note
  • None
Parameters
[in]p_input_bufferPointer to the buffer
Return values
return32 bit value

◆ optiga_common_set_uint16()

void optiga_common_set_uint16 ( uint8_t *  p_output_buffer,
uint16_t  two_byte_value 
)

Copies 2 bytes of uint16 type value to the buffer.

Copies 2 bytes of uint16 type value to the buffer

  • Copies the 2 bytes value to input buffer in big endian format.
Precondition
  • None
Note
  • None
Parameters
[in,out]p_output_bufferPointer to the buffer
[in]two_byte_value16 bit value

◆ optiga_common_set_uint32()

void optiga_common_set_uint32 ( uint8_t *  p_output_buffer,
uint32_t  four_byte_value 
)

Copies 4 bytes of uint32 [Big endian] type value to the buffer and stores in the output pointer.

Copies 4 bytes of uint32 [Big endian] type value to the buffer and store

  • Copies the 4 bytes value to input buffer in big endian format.
Precondition
  • None
Note
  • None
Parameters
[in,out]p_output_bufferPointer to the buffer
[in]four_byte_value32 bit value