mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-09-16 15:19:54 +00:00
* imports to mbedtls_framework set to relative package imports. * _C_TYPEDEF_DECLARATION_RE is regex compiled. * `read_typedefs()` set to use `read_logical_lines()` * `_write_prologue/epiloge()` modified to use f-strings * Moved poison_write/poison_mutliwrite logic to psa_wrapper Signed-off-by: Minos Galanakis <[email protected]>
30 lines
977 B
Python
30 lines
977 B
Python
""" PSA Buffer utility data-class.
|
|
"""
|
|
|
|
# Copyright The Mbed TLS Contributors
|
|
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
|
|
|
from typing import List
|
|
from .. import typing_util
|
|
|
|
class BufferParameter:
|
|
"""Description of an input or output buffer parameter sequence to a PSA function."""
|
|
#pylint: disable=too-few-public-methods
|
|
|
|
def __init__(self, i: int, is_output: bool,
|
|
buffer_name: str, size_name: str) -> None:
|
|
"""Initialize the parameter information.
|
|
|
|
i is the index of the function argument that is the pointer to the buffer.
|
|
The size is argument i+1. For a variable-size output, the actual length
|
|
goes in argument i+2.
|
|
|
|
buffer_name and size_names are the names of arguments i and i+1.
|
|
This class does not yet help with the output length.
|
|
"""
|
|
self.index = i
|
|
self.buffer_name = buffer_name
|
|
self.size_name = size_name
|
|
self.is_output = is_output
|
|
|