Increase optimization level

This commit is contained in:
Daan Sprenkels
2017-05-12 12:10:25 +02:00
parent d058b3a453
commit fe0627959f
2 changed files with 22 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
CFLAGS = -Wall -g -O2
CFLAGS = -Wall -g -O3
SRCS = hazmat.c randombytes.c serialize.c sss.c keccak.c tweetnacl.c
OBJS := ${SRCS:.c=.o}

View File

@@ -1,8 +1,29 @@
/*
* Implementation of the hazardous parts of the SSS library
*
* Author: Daan Sprenkels <hello@dsprenkels.com>
*
* This code contains the actual Shamir secret sharing functionality. The
* implementation of this code is based on the idea that the user likes to
* generate/combine 32 shares (in GF(2^8) at the same time, because a 256 bit
* key will be exactly 32 bytes. Therefore we bitslice all the input and
* unbitslice the output right before returning.
*
* This bitslice approach optimizes natively on all architectures that are 32
* bit or more. Care is taken to use not too many registers, to ensure that no
* values have to be leaked to the stack.
*
* All functions in this module are implemented constant time and constant
* lookup operations, as all proper crypto code must be.
*/
#include "hazmat.h"
#include "tweetnacl.h"
#include <assert.h>
#include <string.h>
typedef struct {
uint8_t x;
uint8_t y;