aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives
Commit message (Expand)AuthorAgeFilesLines
* Have the pem public/private key loading docs point to x.509Alex Gaynor2015-01-271-0/+8
* Include an example of loading a public keyAlex Gaynor2015-01-271-0/+15
* Move RSA*Key interfaces to cryptography.hazmat.primitives.asymmetric.rsaAlex Stapleton2015-01-243-134/+144
* Move DSA* interfaces to interfaces.dsa moduleAlex Stapleton2015-01-222-167/+166
* doc updatePaul Kehrer2015-01-181-2/+2
* various improvements to rsa_recover_prime_factors per review feedbackPaul Kehrer2015-01-181-4/+3
* recover (p, q) given (n, e, d). fixes #975Paul Kehrer2015-01-181-0/+15
* Bump some more yearsAlex Gaynor2015-01-081-1/+1
* Increase the year in some of our docsAlex Gaynor2015-01-081-2/+2
* IV should be 16 bytesGregory Haynes2015-01-031-1/+1
* iv should be 32 bytesGregory Haynes2015-01-031-1/+1
* Assign iv to var and remove testsetup blockGregory Haynes2015-01-031-8/+3
* Make the symmetric-enc example an exampleGregory Haynes2014-12-301-1/+3
* Merge branch 'master' into openssh-elliptic-curveAlex Gaynor2014-12-241-82/+0
|\
| * Removed documentation for features which were removedAlex Gaynor2014-12-241-82/+0
* | Bring back text about unsupported formatsAlex Gaynor2014-12-241-0/+4
* | Update the docs a bitAlex Gaynor2014-12-241-7/+6
|/
* Provide background on asymmetric crypto in indexAlex Gaynor2014-12-211-0/+22
* Missing charAlex Gaynor2014-12-191-1/+1
* Describe key generation and key loading in the RSA docsAlex Gaynor2014-12-191-1/+37
* Merge pull request #1562 from alex/spruce-it-upPaul Kehrer2014-12-191-40/+57
|\
| * Fixed reST mistakeAlex Gaynor2014-12-191-1/+1
| * SPellingAlex Gaynor2014-12-191-1/+1
| * Spruced up teh RSA docs. Contains a bit more prose and hopefully helps people...Alex Gaynor2014-12-191-40/+57
* | Merge pull request #1561 from alex/link-randomlvh2014-12-193-40/+44
|\ \ | |/ |/|
| * Anywhere we tell someone to randomly generate something, link the RNG docs. F...Alex Gaynor2014-12-193-40/+44
* | Fixed #1555 and fixed #1556 -- moved the RSA padding docs into the primary RS...Alex Gaynor2014-12-193-81/+77
|/
* Merge pull request #1499 from reaperhulk/x509-ossl-implAlex Gaynor2014-12-171-52/+0
|\
| * reorganize a bunch of things related to the x509certificate interfacePaul Kehrer2014-12-151-52/+0
| * change it to not_valid_* why notPaul Kehrer2014-12-151-2/+2
| * improve phrasing on X509Certificate fingerprint method paramPaul Kehrer2014-12-151-2/+2
| * update docs, test invalid x509 versionPaul Kehrer2014-12-151-1/+1
* | update docs, hoist b64decode up and re-add test for itPaul Kehrer2014-12-171-4/+9
|/
* A handful of tiny fixesAlex Gaynor2014-12-151-2/+3
* Minor documentation corrections for load_ssh_public_keyMark Adams2014-12-131-2/+3
* Privatized the load_ssh_rsa_public_key function and fixed some coverage issue...Mark Adams2014-12-131-18/+0
* Added load_ssh_rsa_public_key to hazmat.primitives.serialization to allow for...Mark Adams2014-12-131-0/+55
* Use HTTPS for a number of URLs in the docsAlex Gaynor2014-12-123-5/+5
* add encode_rfc6979_signature and refactor tests to use itPaul Kehrer2014-11-271-0/+10
* add decode_rfc6979_signature helper for DSA/ECDSAPaul Kehrer2014-11-274-2/+22
* add X509Certificate version attributePaul Kehrer2014-11-251-0/+6
* link datetime better and add naïve to spelling listPaul Kehrer2014-11-241-2/+2
* update docs with review feedbackPaul Kehrer2014-11-241-5/+8
* Initial minimal X509Certificate interfacesPaul Kehrer2014-11-241-0/+44
* A few more docs fixesAlex Gaynor2014-11-231-4/+4
* A handful of different fixes for the interface docsAlex Gaynor2014-11-221-11/+12
* fixed a syntax error in the docsAlex Gaynor2014-11-202-3/+3
* Merge pull request #1480 from alex/document-in-more-placesDavid Reid2014-11-172-0/+12
|\
| * Describe teh format of the result of signer.finalize(). Fixes #1479Alex Gaynor2014-11-172-0/+12
* | Improved the interface docs for DSA and ECDSA signaturesAlex Gaynor2014-11-171-4/+8
|/
und-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# =============================================================================
#               ____ _   _ ____  _          _
#  _ __  _   _ / ___| | | |  _ \| |      __| | ___  _ __ ___
# | '_ \| | | | |  _| |_| | | | | |     / _` |/ _ \| '_ ` _ \
# | |_) | |_| | |_| |  _  | |_| | |___ | (_| | (_) | | | | | |
# | .__/ \__, |\____|_| |_|____/|_____(_)__,_|\___/|_| |_| |_|
# |_|    |___/
# =============================================================================
# Authors:
#   Patrick Lehmann
#
# Package module:   DOM: Sequential statements.
#
# License:
# ============================================================================
#  Copyright (C) 2019-2021 Tristan Gingold
#
#  This program is free software: you can redistribute it and/or modify
#  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 typing import Iterable

from pydecor import export

from pyGHDL.dom.Concurrent import (
    WaveformElement,
    ParameterAssociationItem,
)  # TODO: move out from concurrent?
from pyGHDL.dom.Range import Range
from pyVHDLModel.SyntaxModel import (
    IfBranch as VHDLModel_IfBranch,
    ElsifBranch as VHDLModel_ElsifBranch,
    ElseBranch as VHDLModel_ElseBranch,
    IfStatement as VHDLModel_IfStatement,
    IndexedChoice as VHDLModel_IndexedChoice,
    RangedChoice as VHDLModel_RangedChoice,
    OthersCase as VHDLModel_OthersCase,
    Case as VHDLModel_Case,
    CaseStatement as VHDLModel_CaseStatement,
    ForLoopStatement as VHDLModel_ForLoopStatement,
    SequentialSimpleSignalAssignment as VHDLModel_SequentialSimpleSignalAssignment,
    SequentialProcedureCall as VHDLModel_SequentialProcedureCall,
    SequentialAssertStatement as VHDLModel_SequentialAssertStatement,
    SequentialReportStatement as VHDLModel_SequentialReportStatement,
    WaitStatement as VHDLModel_WaitStatement,
    Name,
    SequentialStatement,
    ExpressionUnion,
    SequentialChoice,
    SequentialCase,
)


from pyGHDL.libghdl import Iir, utils
from pyGHDL.libghdl.vhdl import nodes
from pyGHDL.dom import DOMMixin, Position, DOMException
from pyGHDL.dom._Utils import GetNameOfNode


@export
class IfBranch(VHDLModel_IfBranch):
    def __init__(
        self,
        branchNode: Iir,
        condition: ExpressionUnion,
        statements: Iterable[SequentialStatement] = None,
    ):
        super().__init__(condition, statements)
        DOMMixin.__init__(self, branchNode)

    @classmethod
    def parse(cls, branchNode: Iir, label: str) -> "IfBranch":
        from pyGHDL.dom._Translate import (
            GetSequentialStatementsFromChainedNodes,
            GetExpressionFromNode,
        )

        condition = GetExpressionFromNode(nodes.Get_Condition(branchNode))
        statementChain = nodes.Get_Sequential_Statement_Chain(branchNode)
        statements = GetSequentialStatementsFromChainedNodes(
            statementChain, "if branch", label
        )

        return cls(branchNode, condition, statements)


@export
class ElsifBranch(VHDLModel_ElsifBranch):
    def __init__(
        self,
        branchNode: Iir,
        condition: ExpressionUnion,
        statements: Iterable[SequentialStatement] = None,
    ):
        super().__init__(condition, statements)
        DOMMixin.__init__(self, branchNode)

    @classmethod
    def parse(cls, branchNode: Iir, condition: Iir, label: str) -> "ElsifBranch":