mirror of
https://github.com/dsprenkels/sss.git
synced 2026-01-10 06:07:59 -05:00
Increase optimization level
This commit is contained in:
2
Makefile
2
Makefile
@@ -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}
|
||||
|
||||
|
||||
21
hazmat.c
21
hazmat.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user