Files
Minos Galanakis 9280214a90 code_wrapper: Minor fixes
* 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]>
2024-07-05 09:35:41 +01:00

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