<commit_before>/*
 * GMAC
 * (C) 2016 <NAME>, <NAME>
 *
 * Botan is released under the Simplified BSD License (see license.txt)
 */

#ifndef BOTAN_GMAC_H_
#define BOTAN_GMAC_H_

#include <botan/mac.h>
#include <botan/gcm.h>
#include <botan/block_cipher.h>

namespace Botan {

/**
* GMAC
*/
class BOTAN_PUBLIC_API(2,0) GMAC final : public MessageAuthenticationCode, public GHASH
   {
   public:
      void clear() override;
      std::string name() const override;
      size_t output_length() const override;
      MessageAuthenticationCode* clone() const override;

      /**
      * Must be called to set the initialization vector prior to GMAC
      * calculation.
      *
      * @param nonce Initialization vector.
      * @param nonce_len size of initialization vector.
      */
      void start(const uint8_t nonce[], size_t nonce_len);

      /**
      * Must be called to set the initialization vector prior to GMAC
      * calculation.
      *
      * @param nonce Initialization vector.
      */
      void start(const secure_vector<uint8_t>& nonce);

      /**
      * Must be called to set the initialization vector prior to GMAC
      * calculation.
      *
      * @param nonce Initialization vector.
      */
      void start(const std::vector<uint8_t>& nonce);

      Key_Length_Specification key_spec() const override
         {
         return m_cipher->key_spec();
         }

      /**
      * Creates a new GMAC instance.
      *
      * @param cipher the underlying block cipher to use<commit_msg>Avoid bogus declarations in GMAC<commit_after>/*
 * GMAC
 * (C) 2016 <NAME>, <NAME>
 *
 * Botan is released under the Simplified BSD License (see license.txt)
 */

#ifndef BOTAN_GMAC_H_
#define BOTAN_GMAC_H_

#include <botan/mac.h>
#include <botan/gcm.h>
#include <botan/block_cipher.h>

namespace Botan {

/**
* GMAC
*
* GMAC requires a unique initialization vector be used for each message.
* This must be provided via the MessageAuthenticationCode::start() API
*/
class BOTAN_PUBLIC_API(2,0) GMAC final : public MessageAuthenticationCode, public GHASH
   {
   public:
      void clear() override;
      std::string name() const override;
      size_t output_length() const override;
      MessageAuthenticationCode* clone() const override;

      Key_Length_Specification key_spec() const override
         {
         return m_cipher->key_spec();
         }

      /**
      * Creates a new GMAC instance.
      *
      * @param cipher the underlying block cipher to use
{'fraction_non_alphanumeric': 0.09426393902928198, 'fraction_numerical': 0.006016847172081829, 'mean_word_length': 2.7616892911010558, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5967885', 'n_tokens_mistral': 775, 'n_tokens_neox': 747, 'n_words': 234}