aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/backends/index.rst
blob: aec7a1e0d4bc095b713cfbd95beda1399d4937bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.. hazmat::

Backends
========

Getting a backend
-----------------

.. currentmodule:: cryptography.hazmat.backends

``cryptography`` aims to support multiple backends to ensure it can provide
the widest number of supported cryptographic algorithms as well as supporting
platform specific implementations.

You can get the default backend by calling :func:`~default_backend`.

The default backend will change over time as we implement new backends and
the libraries we use in those backends changes.


.. function:: default_backend()

    :returns: An object that provides at least
        :class:`~interfaces.CipherBackend`, :class:`~interfaces.HashBackend`, and
        :class:`~interfaces.HMACBackend`.

Individual backends
-------------------

.. toctree::
    :maxdepth: 1

    openssl
    commoncrypto
    multibackend
    interfaces
n> # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <gnu.org/licenses>. # # SPDX-License-Identifier: GPL-2.0-or-later # ============================================================================ from pyTooling.Decorators import export from pyGHDL.libghdl._types import Iir, NameId from pyGHDL.libghdl._decorator import BindToLibGHDL from pyGHDL.libghdl import name_table, files_map from pyGHDL.libghdl.vhdl import nodes @export @BindToLibGHDL("vhdl__utils__get_source_identifier") def Get_Source_Identifier(Decl: Iir) -> NameId: """ Like ``Get_Identifier`` but return a ``NameId`` for the same casing as it appears in the source file. Not useful for analysis as VHDL is case insensitive, but could be useful for error messages or tooling. :param Decl: Iir Node. Type: ``Iir`` """ return 0 @export def Get_Source_Identifier_Str(n: Iir) -> str: loc = nodes.Get_Location(n) l = name_table.Get_Name_Length(nodes.Get_Identifier(n)) sfe = files_map.Location_To_File(loc) pos = files_map.Location_File_To_Pos(loc, sfe) buf = files_map.Get_File_Buffer(sfe) return buf[pos : pos + l].decode("utf-8")