Path: blob/main/crypto/openssl/providers/implementations/include/prov/hmac_drbg.h
48535 views
/*1* Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.2*3* Licensed under the Apache License 2.0 (the "License"). You may not use4* this file except in compliance with the License. You can obtain a copy5* in the file LICENSE in the source distribution or at6* https://www.openssl.org/source/license.html7*/89#ifndef OSSL_PROV_HMAC_DRBG_H10# define OSSL_PROV_HMAC_DRBG_H11# pragma once1213#include <openssl/evp.h>14#include "prov/provider_util.h"1516typedef struct drbg_hmac_st {17EVP_MAC_CTX *ctx; /* H(x) = HMAC_hash OR H(x) = KMAC */18PROV_DIGEST digest; /* H(x) = hash(x) */19size_t blocklen;20unsigned char K[EVP_MAX_MD_SIZE];21unsigned char V[EVP_MAX_MD_SIZE];22} PROV_DRBG_HMAC;2324int ossl_drbg_hmac_init(PROV_DRBG_HMAC *drbg,25const unsigned char *ent, size_t ent_len,26const unsigned char *nonce, size_t nonce_len,27const unsigned char *pstr, size_t pstr_len);28int ossl_drbg_hmac_generate(PROV_DRBG_HMAC *hmac,29unsigned char *out, size_t outlen,30const unsigned char *adin, size_t adin_len);3132#endif /* OSSL_PROV_HMAC_DRBG_H */333435