Commit d0f2d55cce42f9a3a16d20c91f6c547acf66f43c

Authored by plank
1 parent 4e5e5cd1
Exists in master and in 3 other branches v1, v2, v3

Putting on the finishing touches.


git-svn-id: svn://mamba.eecs.utk.edu/home/plank/svn/Galois-Library@95 36f187d4-5712-4624-889c-152d48957efa
License.txt 0 → 100644
... ... @@ -0,0 +1,31 @@
  1 +Copyright (c) 2013, James S. Plank, Kevin M. Greenan, Ethan L. Miller, William B. Houston
  2 +All rights reserved.
  3 +
  4 +Redistribution and use in source and binary forms, with or without
  5 +modification, are permitted provided that the following conditions
  6 +are met:
  7 +
  8 + - Redistributions of source code must retain the above copyright
  9 + notice, this list of conditions and the following disclaimer.
  10 +
  11 + - Redistributions in binary form must reproduce the above copyright
  12 + notice, this list of conditions and the following disclaimer in
  13 + the documentation and/or other materials provided with the
  14 + distribution.
  15 +
  16 + - Neither the name of the University of Tennessee nor the names of its
  17 + contributors may be used to endorse or promote products derived
  18 + from this software without specific prior written permission.
  19 +
  20 +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21 +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22 +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23 +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24 +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  25 +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  26 +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  27 +OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  28 +AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29 +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
  30 +WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  31 +POSSIBILITY OF SUCH DAMAGE.
... ...
README.txt 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +This is GF-Complete, Revision 0.1.
  2 +
  3 +Please see http://www.cs.utk.edu/~plank/plank/papers/CS-13-703.html for the user's
  4 +manual and other important documentation about this library, including more
  5 +recent revisions.
... ...
gf_54.c
... ... @@ -11,8 +11,19 @@
11 11 main()
12 12 {
13 13 gf_t gf;
  14 + void *scratch;
  15 + int size;
14 16  
15   - gf_init_easy(&gf, 4);
16   - printf("%d\n", gf.multiply.w32(&gf, 5, 4));
17   - exit(0);
  17 + size = gf_scratch_size(16, GF_MULT_SPLIT_TABLE,
  18 + GF_REGION_SSE | GF_REGION_ALTMAP,
  19 + GF_DIVIDE_DEFAULT,
  20 + 16, 4);
  21 + if (size == -1) exit(1); /* It failed. That shouldn't happen*/
  22 + scratch = (void *) malloc(size);
  23 + if (scratch == NULL) { perror("malloc"); exit(1); }
  24 + if (!gf_init_hard(&gf, 16, GF_MULT_SPLIT_TABLE,
  25 + GF_REGION_SSE | GF_REGION_ALTMAP,
  26 + GF_DIVIDE_DEFAULT,
  27 + 0, 16, 4, NULL, scratch)) exit(1);
  28 + printf("Yo\n");
18 29 }
... ...
gf_time.c
... ... @@ -59,6 +59,9 @@ void usage(char *s)
59 59 fprintf(stderr, " D: Single: Divisions\n");
60 60 fprintf(stderr, " I: Single: Inverses\n");
61 61 fprintf(stderr, " G: Region: Buffer-Constant Multiplication\n");
  62 + fprintf(stderr, " 0: Region: Doing nothing, and bzero()\n");
  63 + fprintf(stderr, " 1: Region: Memcpy() and XOR\n");
  64 + fprintf(stderr, " 2: Region: Multiplying by two\n");
62 65 fprintf(stderr, "\n");
63 66 fprintf(stderr, "Use -1 for time(0) as a seed.\n");
64 67 fprintf(stderr, "\n");
... ...
junk.c
  1 +/*
  2 + * Multiplies four and five in GF(2^4).
  3 + */
  4 +
1 5 #include <stdio.h>
  6 +#include <stdint.h>
  7 +#include <stdlib.h>
  8 +
  9 +#include "gf_complete.h"
2 10  
3 11 main()
4 12 {
5   - int size, iterations;
6   - double ds, di, elapsed;
7   -
8   - elapsed = 0.614553;
9   - size = 8192;
10   - iterations = 655360;
11   -
12   - ds = size;
13   - di = iterations;
  13 + gf_t gf;
14 14  
15   - printf("%10.3lf\n", ((double) (size*iterations)) / (1024 * 1024 * elapsed));
16   - printf("%10.3lf\n", ds * di / 1024.0 / 1024.0 / elapsed);
  15 + gf_init_easy(&gf, 4);
  16 + printf("%d\n", gf.multiply.w32(&gf, 5, 4));
  17 + exit(0);
17 18 }
... ...