Merge pull request #23 from haydenroche5/fips

Modify hashes.py to use correct hash type values when FIPS is enabled.
pull/24/head
Daniele Lacamera 2021-07-14 06:37:02 -07:00 committed by GitHub
commit 8ed0316993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 4 deletions

View File

@ -260,10 +260,17 @@ if _lib.SHA3_ENABLED:
# Hmac types
_TYPE_SHA = 4
_TYPE_SHA256 = 6
_TYPE_SHA384 = 7
_TYPE_SHA512 = 8
if _lib.FIPS_ENABLED:
_TYPE_SHA = 1
_TYPE_SHA256 = 2
_TYPE_SHA384 = 5
_TYPE_SHA512 = 4
else:
_TYPE_SHA = 4
_TYPE_SHA256 = 6
_TYPE_SHA384 = 7
_TYPE_SHA512 = 8
_HMAC_TYPES = [_TYPE_SHA, _TYPE_SHA256, _TYPE_SHA384, _TYPE_SHA512]