Code Monkey home page Code Monkey logo

1's People

Contributors

outdamud avatar

Watchers

 avatar

1's Issues

*/deploy

*/

#ifndef SHA3_H
#define SHA3_H

#include <stdint.h>
#include "options.h"

#ifdef __cplusplus
extern "C" {
#endif

#define sha3_224_hash_size 28
#define sha3_256_hash_size 32
#define sha3_384_hash_size 48
#define sha3_512_hash_size 64
#define sha3_max_permutation_size 25
#define sha3_max_rate_in_qwords 24

/**

  • SHA3 Algorithm context.
    /
    typedef struct SHA3_CTX
    {
    /
    1600 bits algorithm hashing state /
    uint64_t hash[sha3_max_permutation_size];
    /
    1536-bit buffer for leftovers /
    uint64_t message[sha3_max_rate_in_qwords];
    /
    count of bytes in the message[] buffer /
    unsigned rest;
    /
    size of a message block processed at once */
    unsigned block_size;
    } SHA3_CTX;

/* methods for calculating the hash function */

void sha3_224_Init(SHA3_CTX *ctx);
void sha3_256_Init(SHA3_CTX *ctx);
void sha3_384_Init(SHA3_CTX *ctx);
void sha3_512_Init(SHA3_CTX *ctx);
void sha3_Update(SHA3_CTX ctx, const unsigned char msg, size_t size);
void sha3_Final(SHA3_CTX ctx, unsigned char result);

#if USE_KECCAK
#define keccak_224_Init sha3_224_Init
#define keccak_256_Init sha3_256_Init
#define keccak_384_Init sha3_384_Init
#define keccak_512_Init sha3_512_Init
#define keccak_Update sha3_Update
void keccak_Final(SHA3_CTX ctx, unsigned char result);
#endif

#ifdef __cplusplus
} /* extern "C" /
#endif /
__cplusplus */

#endif /* SHA3_H */

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.