Skip to content
Snippets Groups Projects
Select Git revision
  • 0dcdec81ab76e07c16650f5c49fc337fbccc85a2
  • master default protected
  • hpke
  • ppc-chacha-4core
  • delete-internal-name-mangling
  • master-updates
  • ppc-gcm
  • ppc-chacha-2core
  • refactor-ecc-mod
  • ppc-chacha-core
  • use-mpn_cnd-functions
  • optimize-ecc-invert
  • default-m4-quote-char
  • power-asm-wip
  • test-fat
  • chacha-3core-neon
  • x86_64-salsa20-2core
  • salsa20-2core-neon
  • bcrypt
  • arm-salsa20-chacha-vsra
  • test-shlib-dir
  • nettle_3.6_release_20200429
  • nettle_3.6rc3
  • nettle_3.6rc2
  • nettle_3.6rc1
  • nettle_3.5.1_release_20190627
  • nettle_3.5_release_20190626
  • nettle_3.5rc1
  • nettle_3.4.1_release_20181204
  • nettle_3.4.1rc1
  • nettle_3.4_release_20171119
  • nettle_3.4rc2
  • nettle_3.4rc1
  • nettle_3.3_release_20161001
  • nettle_3.2_release_20160128
  • nettle_3.1.1_release_20150424
  • nettle_3.1_release_20150407
  • nettle_3.1rc3
  • nettle_3.1rc2
  • nettle_3.1rc1
  • nettle_3.0_release_20140607
41 results

sha.h

Blame
  • Forked from Nettle / nettle
    3815 commits behind the upstream repository.
    Niels Möller's avatar
    Niels Möller authored
    non-static. Use the READ_UINT32 and WRITE_UINT32 macros from
    lsh_types.h.
    
    Rev: src/symmetric/include/sha.h:1.4
    Rev: src/symmetric/sha.c:1.5
    ef76209d
    History
    sha.h 914 B
    /* 
     * $Id$
     */
    
    #include "crypto_types.h"
    
    /* The SHA block size and message digest sizes, in bytes */
    
    #define SHA_DATASIZE    64
    #define SHA_DATALEN     16
    #define SHA_DIGESTSIZE  20
    #define SHA_DIGESTLEN    5
    /* The structure for storing SHA info */
    
    struct sha_ctx {
      UINT32 digest[SHA_DIGESTLEN];  /* Message digest */
      UINT32 count_l, count_h;       /* 64-bit block count */
      UINT8 block[SHA_DATASIZE];     /* SHA data buffer */
      int index;                     /* index into buffer */
    };
    
    void sha_init(struct sha_ctx *ctx);
    void sha_update(struct sha_ctx *ctx, const UINT8 *buffer, UINT32 len);
    void sha_final(struct sha_ctx *ctx);
    void sha_digest(struct sha_ctx *ctx, UINT8 *s);
    void sha_copy(struct sha_ctx *dest, struct sha_ctx *src);
    
    /* The core compression function, mapping 5 + 16 32-bit words to 5
     * words. Destroys the data in the process. */
    void sha_transform(UINT32 *state, UINT32 *data);