<commit_before>/**
 * libkeccak – Keccak-family hashing library
 * 
 * Copyright © 2014  <NAME> (<EMAIL>)
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef LIBKECCAK_SPEC_H
#define LIBKECCAK_SPEC_H  1


/**
 * This datastructure describes the parameters
 * that should be used when hashing
 */
typedef struct libkeccak_spec
{
  /**
   * The bitrate
   */
  long bitrate;
  
  /**
   * The capacity
   */
  long capacity;
  
  /**
   * The output size
   */
  long output;
  
} libkeccak_spec_t;


#undef
<commit_msg>specs for sha3, rawshake and shake<commit_after>/**
 * libkeccak – Keccak-family hashing library
 * 
 * Copyright © 2014  <NAME> (<EMAIL>)
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef LIBKECCAK_SPEC_H
#define LIBKECCAK_SPEC_H  1


/**
 * Message suffix for SHA3 hashing
 */
#define LIBKECCAK_SHA3_SUFFIX  "01"

/**
 * Message suffix for RawSHAKE hashing
 */
#define LIBKECCAK_RAWSHAKE_SUFFIX  "11"

/**
 * Message suffix for SHAKE hashing
 */
#define LIBKECCAK_SHAKE_SUFFIX  "1111"



/**
 * Datastructure that describes the parameters
 * that should be used when hashing
 */
typedef struct libkeccak_spec
{
  /**
   * The bitrate
   */
  long bitrate;
  
  /**
   * The capacity
   */
  long capacity;
  
  /**
   * The output size
   */
  long output;
  
} libkeccak_spec_t;



/**
 * Fill in a `libkeccak_spec_t` for a SHA3-x hashing
 * 
 * @param  spec  The specifications datastructure to fill in
 * @param  x     The value of x in `SHA3-x`, the output size
 */
static inline __attribute__((leaf, nonnull, nothrow))
void libkeccak_spec_sha3(libkeccak_spec_t* restrict spec, long x)
{
  spec->bitrate = 1600 - 2 * x;
  spec->capacity = 2 * x;
  spec->output = x;
}


/**
 * Fill in a `libkeccak_spec_t` for a RawSHAKEx hashing
 * 
 * @param  spec  The specifications datastructure to fill in
 * @param  x     The value of x in `RawSHAKEx`, half the capacity
 * @param  d     The output size
 */
static inline __attribute__((leaf, nonnull, nothrow))
void libkeccak_spec_rawshake(libkeccak_spec_t* restrict spec, long x, long d)
{
  spec->bitrate = 1600 - 2 * x;
  spec->capacity = 2 * x;
  spec->output = d;
}


/**
 * Fill in a `libkeccak_spec_t` for a SHAKEx hashing
 * 
 * @param  spec:libkeccak_spec_t*  The specifications datastructure to fill in
 * @param  x:long                  The value of x in `SHAKEx`, half the capacity
 * @param  d:long                  The output size
 */
#define libkeccak_spec_shake  libkeccak_spec_rawshake


#undef

{'fraction_non_alphanumeric': 0.08598130841121496, 'fraction_numerical': 0.010146862483311082, 'mean_word_length': 3.208988764044944, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5768957', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1175, 'n_words': 459}