tlslite.mathtls module¶
Miscellaneous helper functions.
-
class
tlslite.mathtls.
MAC_SSL
¶ Bases:
object
-
copy
()¶
-
create
(k, digestmod=None)¶
-
digest
()¶
-
update
(m)¶
-
-
tlslite.mathtls.
PAD
(n, x)¶
-
tlslite.mathtls.
PRF
(secret, label, seed, length)¶
-
tlslite.mathtls.
PRF_1_2
(secret, label, seed, length)¶ Pseudo Random Function for TLS1.2 ciphers that use SHA256
-
tlslite.mathtls.
PRF_1_2_SHA384
(secret, label, seed, length)¶ Pseudo Random Function for TLS1.2 ciphers that use SHA384
-
tlslite.mathtls.
PRF_SSL
(secret, seed, length)¶
-
tlslite.mathtls.
P_hash
(macFunc, secret, seed, length)¶
-
tlslite.mathtls.
calcExtendedMasterSecret
(version, cipherSuite, premasterSecret, handshakeHashes)¶ Derive Extended Master Secret from premaster and handshake msgs
-
tlslite.mathtls.
calcFinished
(version, masterSecret, cipherSuite, handshakeHashes, isClient)¶ Calculate the Handshake protocol Finished value
Parameters: - version – TLS protocol version tuple
- masterSecret – negotiated master secret of the connection
- cipherSuite – negotiated cipher suite of the connection,
- handshakeHashes – running hash of the handshake messages
- isClient – whether the calculation should be performed for message sent by client (True) or by server (False) side of connection
-
tlslite.mathtls.
calcMasterSecret
(version, cipherSuite, premasterSecret, clientRandom, serverRandom)¶ Derive Master Secret from premaster secret and random values
-
tlslite.mathtls.
createHMAC
(k, digestmod=<built-in function openssl_sha1>)¶
-
tlslite.mathtls.
createMAC_SSL
(k, digestmod=None)¶
-
tlslite.mathtls.
makeK
(N, g)¶
-
tlslite.mathtls.
makeU
(N, A, B)¶
-
tlslite.mathtls.
makeVerifier
(username, password, bits)¶
-
tlslite.mathtls.
makeX
(salt, username, password)¶
-
tlslite.mathtls.
paramStrength
(param)¶ Return level of security for DH, DSA and RSA parameters.
Provide the approximate level of security for algorithms based on finite field (DSA, DH) or integer factorisation cryptography (RSA) when provided with the prime defining the field or the modulus of the public key.
Parameters: param (int) – prime or modulus