File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Cipher/__pycache__/PKCS1_OAEP.cpython-310.pyc
Back
o ;j�! � @ s| d dl mZ d dlZd dlmZ d dlZd dlmZmZm Z d dl mZ d dlmZ ddl mZ G d d � d �Zddd �ZdS )� )�MGF1N)�_copy_bytes)�ceil_div� bytes_to_long� long_to_bytes)�strxor)�Random� )�oaep_decodec @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� ZdS ) �PKCS1OAEP_CipherzXCipher object for PKCS#1 v1.5 OAEP. Do not create directly: use :func:`new` instead.c sN |� _ |r |� _ntjj� _|r|� _n� fdd�� _tdd|�� _|� _dS )a Initialize this PKCS#1 OAEP cipher object. :Parameters: key : an RSA key object If a private half is given, both encryption and decryption are possible. If a public half is given, only encryption is possible. hashAlgo : hash object The hash function to use. This can be a module under `Cryptodome.Hash` or an existing hash object created from any of such modules. If not specified, `Cryptodome.Hash.SHA1` is used. mgfunc : callable A mask generation function that accepts two parameters: a string to use as seed, and the lenth of the mask to generate, in bytes. If not specified, the standard MGF1 consistent with ``hashAlgo`` is used (a safe choice). label : bytes/bytearray/memoryview A label to apply to this particular encryption. If not specified, an empty string is used. Specifying a label does not improve security. randfunc : callable A function that returns random bytes. :attention: Modify the mask generation function only if you know what you are doing. Sender and receiver must use the same one. c s t | |� j�S )N)r �_hashObj)�x�y��self� �P/opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Cipher/PKCS1_OAEP.py�<lambda>I s z+PKCS1OAEP_Cipher.__init__.<locals>.<lambda>N) �_keyr � CryptodomeZHash�SHA1�_mgfr �_label� _randfunc)r �key�hashAlgo�mgfunc�label�randfuncr r r �__init__&