Skip to content
Snippets Groups Projects
Select Git revision
  • 99e8976d555a39496b13e57dea1b6417183025b9
  • x86_ghash
  • x86_poly
  • ppc-poly1305-multi
  • ppc-poly-multi-44
  • power7-chacha-fix
  • ppc-r64-44-n
  • ppc-r64-44
  • s390x-gief-fix
  • chacha_m4_fix
  • arm64-poly
  • poly_avx2
  • s390x-poly
  • ppc-poly
  • s390x-ghash-refactor
  • arm64-chacha
  • s390x-ecc-7748
  • s390x-ecc-mod
  • s390x-vf-fix
  • s390x-chacha
  • s390x-sha1
  • 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

testutils.h

Blame
  • Forked from Nettle / nettle
    Source project has a limited visibility.
    testutils.h 3.31 KiB
    #ifndef NETTLE_TESTUTILS_H_INCLUDED
    #define NETTLE_TESTUTILS_H_INCLUDED
    
    #if HAVE_CONFIG_H
    # include "config.h"
    #endif
    
    #include "nettle-types.h"
    
    #include <string.h>
    #include <stdlib.h>
    #include <stdio.h>
    
    #if HAVE_LIBGMP
    # include "bignum.h"
    #endif
    
    #if WITH_HOGWEED
    # include "rsa.h"
    # include "dsa.h"
    #endif
    
    #include "nettle-meta.h"
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    void *
    xalloc(size_t size);
    
    /* Decodes a NUL-terminated hex string. */
    
    unsigned
    decode_hex_length(const char *hex);
    
    int
    decode_hex(uint8_t *dst, const char *hex);
    
    /* Allocates space */
    const uint8_t *
    decode_hex_dup(const char *hex);
    
    void
    print_hex(unsigned length, const uint8_t *data);
    
    /* The main program */
    int
    test_main(void);
    
    extern int verbose;
    
    void
    test_cipher(const struct nettle_cipher *cipher,
    	    unsigned key_length,
    	    const uint8_t *key,
    	    unsigned length,
    	    const uint8_t *cleartext,
    	    const uint8_t *ciphertext);
    
    void
    test_cipher_cbc(const struct nettle_cipher *cipher,
    		unsigned key_length,
    		const uint8_t *key,
    		unsigned length,
    		const uint8_t *cleartext,
    		const uint8_t *ciphertext,
    		const uint8_t *iv);
    
    void