Home | History | Annotate | Line # | Download | only in prov
      1 /*
      2  * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
      3  *
      4  * Licensed under the Apache License 2.0 (the "License").  You may not use
      5  * this file except in compliance with the License.  You can obtain a copy
      6  * in the file LICENSE in the source distribution or at
      7  * https://www.openssl.org/source/license.html
      8  */
      9 
     10 #ifndef OSSL_PROV_HMAC_DRBG_H
     11 #define OSSL_PROV_HMAC_DRBG_H
     12 #pragma once
     13 
     14 #include <openssl/evp.h>
     15 #include "prov/provider_util.h"
     16 
     17 typedef struct drbg_hmac_st {
     18     EVP_MAC_CTX *ctx; /* H(x) = HMAC_hash OR H(x) = KMAC */
     19     PROV_DIGEST digest; /* H(x) = hash(x) */
     20     size_t blocklen;
     21     unsigned char K[EVP_MAX_MD_SIZE];
     22     unsigned char V[EVP_MAX_MD_SIZE];
     23 } PROV_DRBG_HMAC;
     24 
     25 int ossl_drbg_hmac_init(PROV_DRBG_HMAC *drbg,
     26     const unsigned char *ent, size_t ent_len,
     27     const unsigned char *nonce, size_t nonce_len,
     28     const unsigned char *pstr, size_t pstr_len);
     29 int ossl_drbg_hmac_generate(PROV_DRBG_HMAC *hmac,
     30     unsigned char *out, size_t outlen,
     31     const unsigned char *adin, size_t adin_len);
     32 
     33 #endif /* OSSL_PROV_HMAC_DRBG_H */
     34