Skip to content
Snippets Groups Projects
Select Git revision
  • nettle_3.1_release_20150407
  • 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.1rc3
  • nettle_3.1rc2
  • nettle_3.1rc1
  • nettle_3.0_release_20140607
40 results

aes-set-key-internal.c

Blame
  • Forked from Nettle / nettle
    Source project has a limited visibility.
    example3 9.59 KiB
    3. This example is a very simple www-server.
    
      For you who are not familiar with WWW (World Wide Web), it works by using
      client program which will fetch files from remote servers when asked.
      Usually by clicking a pitcure or text. This example is a program for the
      server which will send files to any computer that requests them. The
      protocol used to send the file is called HTTP. (HyperText Transfer Protocol)
    
      Usually WWW involves HTML. HTML (HyperText Markup Language) is a way to
      write documents with embedded pictures and links to other pages. These
      links are normally displayed underlined and if you click them your WWW-
      browser will load whatever document that link leads to.
    
    	#!/usr/local/bin/pike
    	
    	/* A very small httpd capable of fetching files only.
    	 * Written by Fredrik Hübinette as a demonstration of Pike.
    	 */
    
      A comment, /* begins the comment, and */ ends it.
    	
    	inherit "/precompiled/port";
    
      Inherit copies all the functionality of /precompiled/port into this program.
      /precompiled/port makes it possible to bind a TCP (Transmission Control
      Protocol, the internet stanard for computer communication) socket to accept
      incoming connections. A socket is simply a number to separate communications
      to and from different programs on the same computer.
    
      Next are some constants that will affect how uHTTPD will operate. This uses
      the preprocessor directive #define. The preprocessor is the first stage in
      the compiling process and can make textual processing of the code before
      it is compiled. As an example, after the first define below, all occurances
      of 'BLOCK' will be replaced with 16060.
    	
    	/* Amount of data moved in one operation */
    	#define BLOCK 16060
    	
    	/* Where do we have the html files ? */
    	#define BASE "/home/hubbe/pike/src/"
    	
    	/* File to return when we can't find the file requested */
    	#define NOFILE "/home/hubbe/www/html/nofile.html"
    	
    	/* Port to open */
    	#define PORT 1905
    
      A port is a destination for a TCP connection. It is simply a number on the
      local computer. 1905 is not the standard port for HTTP connections though,
      which means that if you want to access this WWW server from a browser you
      need to specify the port like this: http://my.host.my.domain:1905/
    
      Next we declare a global variable of the type program called output_class,
      and then we use the class construct to assign a program to it. class {}
      defines a clonable program. (or class for you C++ freaks)
    
    	program output_class=class
    	{
    	  inherit "/precompiled/file" : socket;
    	  inherit "/precompiled/file" : file;
    
      Our new class inherits /precompile/file twice. To be able to separate them
      they are then named 'socket' and 'file'.
    
    	  int offset=0;
    
      Then there is a global variable called offset which is initalized to zero.
      (each instance of this class will have it's own instance of this variable,
       so it is not truly global, but..) 
      Note that the initalization is done when the class is cloned. (or