示例#1
0
 def __init__(self, key):
     from cryptography.hazmat.backends.openssl.backend import backend
     if not backend.poly1305_supported():
         raise UnsupportedAlgorithm(
             "poly1305 is not supported by this version of OpenSSL.",
             _Reasons.UNSUPPORTED_MAC)
     self._ctx = backend.create_poly1305_ctx(key)
示例#2
0
 def __init__(self, key):
     from cryptography.hazmat.backends.openssl.backend import backend
     if not backend.poly1305_supported():
         raise UnsupportedAlgorithm(
             "poly1305 is not supported by this version of OpenSSL.",
             _Reasons.UNSUPPORTED_MAC
         )
     self._ctx = backend.create_poly1305_ctx(key)