Commit a2039c87 authored by Matt Caswell's avatar Matt Caswell
Browse files

Remove some unneeded files and further flatten the curve 448 structure

parent abcd22bf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15,8 +15,8 @@
#include "word.h"
#include "field.h"

#include <decaf.h>
#include <decaf/ed448.h>
#include "point_448.h"
#include "ed448.h"

/* Template stuff */
#define API_NS(_id) decaf_448_##_id

crypto/ec/curve448/decaf.h

deleted100644 → 0
+0 −32
Original line number Diff line number Diff line
/**
 * @file decaf.h
 * @author Mike Hamburg
 *
 * @copyright
 *   Copyright (c) 2015-2016 Cryptography Research, Inc.  \n
 *   Released under the MIT License.  See LICENSE.txt for license information.
 *
 * Master header for Decaf library.
 *
 * The Decaf library implements cryptographic operations on a elliptic curve
 * groups of prime order p.  It accomplishes this by using a twisted Edwards
 * curve (isogenous to Ed448-Goldilocks or Ed25519) and wiping out the cofactor.
 *
 * The formulas are all complete and have no special cases.  However, some
 * functions can fail.  For example, decoding functions can fail because not
 * every string is the encoding of a valid group element.
 *
 * The formulas contain no data-dependent branches, timing or memory accesses,
 * except for decaf_XXX_base_double_scalarmul_non_secret.
 *
 * @warning This file was automatically generated in Python.
 * Please do not edit it.
 */

#ifndef __DECAF_H__
#define __DECAF_H__ 1

#include <decaf/point_255.h>
#include <decaf/point_448.h>

#endif /* __DECAF_H__ */
+0 −765

File deleted.

Preview size limit exceeded, changes collapsed.

crypto/ec/curve448/decaf/sha512.h

deleted100644 → 0
+0 −53
Original line number Diff line number Diff line
/**
 * @file decaf/shake.h
 * @copyright Public domain.
 * @author Mike Hamburg
 * @brief SHA2-512
 */

#ifndef __DECAF_SHA512_H__
#define __DECAF_SHA512_H__

#include <stdint.h>
#include <sys/types.h>
#include <stdlib.h> /* for NULL */

#include <decaf/common.h>

#ifdef __cplusplus
extern "C" {
#endif
    

typedef struct decaf_sha512_ctx_s {
    uint64_t state[8];
    uint8_t block[128];
    uint64_t bytes_processed;
} decaf_sha512_ctx_s, decaf_sha512_ctx_t[1];

void decaf_sha512_init(decaf_sha512_ctx_t ctx) DECAF_NONNULL DECAF_API_VIS;
void decaf_sha512_update(decaf_sha512_ctx_t ctx, const uint8_t *message, size_t length) DECAF_NONNULL DECAF_API_VIS;
void decaf_sha512_final(decaf_sha512_ctx_t ctx, uint8_t *out, size_t length) DECAF_NONNULL DECAF_API_VIS;

static inline void decaf_sha512_destroy(decaf_sha512_ctx_t ctx) {
    decaf_bzero(ctx,sizeof(*ctx));
}

static inline void decaf_sha512_hash(
    uint8_t *output,
    size_t output_len,
    const uint8_t *message,
    size_t message_len
) {
    decaf_sha512_ctx_t ctx;
    decaf_sha512_init(ctx);
    decaf_sha512_update(ctx,message,message_len);
    decaf_sha512_final(ctx,output,output_len);
    decaf_sha512_destroy(ctx);
}

#ifdef __cplusplus
} /* extern "C" */
#endif
    
#endif /* __DECAF_SHA512_H__ */
+1 −1
Original line number Diff line number Diff line
/** @warning: this file was automatically generated. */
#include "field.h"

#include <decaf.h>
#include "point_448.h"

#define API_NS(_id) decaf_448_##_id
const API_NS(point_t) API_NS(point_base) = {{
Loading