Exemplo n.º 1
0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import, division, print_function

import sys

import nacl.exceptions as exc
from nacl._sodium import ffi, lib
from nacl.exceptions import ensure


crypto_pwhash_scryptsalsa208sha256_SALTBYTES = \
    lib.crypto_pwhash_scryptsalsa208sha256_saltbytes()
crypto_pwhash_scryptsalsa208sha256_STRBYTES = \
    lib.crypto_pwhash_scryptsalsa208sha256_strbytes()
crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE = \
    lib.crypto_pwhash_scryptsalsa208sha256_opslimit_interactive()
crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE = \
    lib.crypto_pwhash_scryptsalsa208sha256_memlimit_interactive()
crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE = \
    lib.crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive()
crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE = \
    lib.crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive()

SCRYPT_OPSLIMIT_INTERACTIVE = \
    crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE
SCRYPT_MEMLIMIT_INTERACTIVE = \
    crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE
Exemplo n.º 2
0
crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX = 0
crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN = 0
crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX = 0
crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE = 0
crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE = 0
crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE = 0
crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE = 0

if has_crypto_pwhash_scryptsalsa208sha256:
    crypto_pwhash_scryptsalsa208sha256_STRPREFIX = \
        ffi.string(ffi.cast("char *",
                            lib.crypto_pwhash_scryptsalsa208sha256_strprefix()
                            )
                   )[:]
    crypto_pwhash_scryptsalsa208sha256_SALTBYTES = \
        lib.crypto_pwhash_scryptsalsa208sha256_saltbytes()
    crypto_pwhash_scryptsalsa208sha256_STRBYTES = \
        lib.crypto_pwhash_scryptsalsa208sha256_strbytes()
    crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN = \
        lib.crypto_pwhash_scryptsalsa208sha256_passwd_min()
    crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX = \
        lib.crypto_pwhash_scryptsalsa208sha256_passwd_max()
    crypto_pwhash_scryptsalsa208sha256_BYTES_MIN = \
        lib.crypto_pwhash_scryptsalsa208sha256_bytes_min()
    crypto_pwhash_scryptsalsa208sha256_BYTES_MAX = \
        lib.crypto_pwhash_scryptsalsa208sha256_bytes_max()
    crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN = \
        lib.crypto_pwhash_scryptsalsa208sha256_memlimit_min()
    crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX = \
        lib.crypto_pwhash_scryptsalsa208sha256_memlimit_max()
    crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN = \