inst_pbkdf2.bend checks
raw source on the hub · import bend-osdev-crypto@0.1.0.0/inst_pbkdf2.bend as Inst_pbkdf2
The named PBKDF2 instances (pbkdf2.bend): PBKDF2-HMAC-SHA-256 (over bend-collections' SHA-256, inst_sha2.bend) and PBKDF2-HMAC-SHA-1 (over the hashes package's SHA-1), each taking the password, salt, iteration count and output length. As KDFs (kdf.bend), with c iterations: ~Pb.CrPbkdf2.derive(~Hm.CrHmacKey, ~Hm.CrHmac.key_of(~64n, ~SH.CrSha2.sha256), ~Hm.CrHmac.mac(~SH.CrSha2.sha256), ~32n, ~c) ~Pb.CrPbkdf2.derive(~Hm.CrHmacKey, ~Hm.CrHmac.key_of(~64n, ~S1.HsSha1.digest), ~Hm.CrHmac.mac(~S1.HsSha1.digest), ~20n, ~c) PBKDF2 over HMAC over any other hash is the same tuple with that hash's block size, one-shot digest and digest size.
7 imports
import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import bend-osdev-hashes@0.1.0.0/sha1.bend as S1 import ./crypto.bend as Cr import ./hmac.bend as Hm import ./pbkdf2.bend as Pb import ./inst_sha2.bend as SH
Definitions
def CrPbkdf2.hmac_sha256 source · line 17 · raw
@password:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @salt:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @c:U32 -> @n:Nat -> Result<&2, &2, 0x01313a4f070f7ffd2bd276fcd2143eda/crypto.CrError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>
def CrPbkdf2.hmac_sha1 source · line 20 · raw
@password:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @salt:0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets -> @c:U32 -> @n:Nat -> Result<&2, &2, 0x01313a4f070f7ffd2bd276fcd2143eda/crypto.CrError, 0x9df7f91779a4a1c215bfa96cd0864601/bytes.Octets>