mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-27 04:07:12 +09:00
Remove implementation-specific header crypto_onetimeauth_poly1305_donna.h
Remove macro magic for poly1305_donna by the way
This commit is contained in:
@@ -53,7 +53,6 @@ libsodium_la_SOURCES = \
|
||||
crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \
|
||||
crypto_onetimeauth/poly1305/onetimeauth_poly1305_api.c \
|
||||
crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c \
|
||||
crypto_onetimeauth/poly1305/donna/api.h \
|
||||
crypto_onetimeauth/poly1305/donna/poly1305_donna.h \
|
||||
crypto_onetimeauth/poly1305/donna/poly1305_donna32.h \
|
||||
crypto_onetimeauth/poly1305/donna/poly1305_donna64.h \
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
|
||||
#include "crypto_onetimeauth_poly1305.h"
|
||||
|
||||
#define crypto_onetimeauth_poly1305_implementation_name \
|
||||
crypto_onetimeauth_poly1305_donna_implementation_name
|
||||
|
||||
#define crypto_onetimeauth crypto_onetimeauth_poly1305_donna
|
||||
#define crypto_onetimeauth_verify crypto_onetimeauth_poly1305_donna_verify
|
||||
@@ -1,10 +1,6 @@
|
||||
|
||||
#include "api.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "crypto_onetimeauth_poly1305_donna.h"
|
||||
#include "poly1305_donna.h"
|
||||
|
||||
#ifdef HAVE_TI_MODE
|
||||
# include "poly1305_donna64.h"
|
||||
#else
|
||||
@@ -50,8 +46,9 @@ poly1305_update(poly1305_context *ctx, const unsigned char *m,
|
||||
}
|
||||
|
||||
int
|
||||
crypto_onetimeauth(unsigned char *out, const unsigned char *m,
|
||||
unsigned long long inlen, const unsigned char *key)
|
||||
crypto_onetimeauth_poly1305_donna(unsigned char *out, const unsigned char *m,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *key)
|
||||
{
|
||||
poly1305_context ctx;
|
||||
poly1305_init(&ctx, key);
|
||||
@@ -62,14 +59,14 @@ crypto_onetimeauth(unsigned char *out, const unsigned char *m,
|
||||
}
|
||||
|
||||
const char *
|
||||
crypto_onetimeauth_poly1305_implementation_name(void)
|
||||
crypto_onetimeauth_poly1305_donna_implementation_name(void)
|
||||
{
|
||||
return POLY1305_IMPLEMENTATION_NAME;
|
||||
}
|
||||
|
||||
struct crypto_onetimeauth_poly1305_implementation
|
||||
crypto_onetimeauth_poly1305_donna_implementation = {
|
||||
_SODIUM_C99(.implementation_name =) crypto_onetimeauth_poly1305_implementation_name,
|
||||
_SODIUM_C99(.onetimeauth =) crypto_onetimeauth,
|
||||
_SODIUM_C99(.onetimeauth_verify =) crypto_onetimeauth_verify
|
||||
_SODIUM_C99(.implementation_name =) crypto_onetimeauth_poly1305_donna_implementation_name,
|
||||
_SODIUM_C99(.onetimeauth =) crypto_onetimeauth_poly1305_donna,
|
||||
_SODIUM_C99(.onetimeauth_verify =) crypto_onetimeauth_poly1305_donna_verify
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef POLY1305_DONNA_H
|
||||
#define POLY1305_DONNA_H
|
||||
#ifndef __POLY1305_DONNA_H__
|
||||
#define __POLY1305_DONNA_H__
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -7,5 +7,18 @@
|
||||
|
||||
typedef crypto_onetimeauth_poly1305_state poly1305_context;
|
||||
|
||||
#endif /* POLY1305_DONNA_H */
|
||||
extern struct crypto_onetimeauth_poly1305_implementation
|
||||
crypto_onetimeauth_poly1305_donna_implementation;
|
||||
|
||||
const char *crypto_onetimeauth_poly1305_donna_implementation_name(void);
|
||||
|
||||
int crypto_onetimeauth_poly1305_donna(unsigned char *out,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k);
|
||||
|
||||
int crypto_onetimeauth_poly1305_donna_verify(const unsigned char *h,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k);
|
||||
#endif /* POLY1305_DONNA_H */
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#include "api.h"
|
||||
#include "crypto_onetimeauth_poly1305_donna.h"
|
||||
#include "crypto_onetimeauth_poly1305.h"
|
||||
#include "crypto_verify_16.h"
|
||||
#include "poly1305_donna.h"
|
||||
|
||||
int
|
||||
crypto_onetimeauth_verify(const unsigned char *h,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k)
|
||||
crypto_onetimeauth_poly1305_donna_verify(const unsigned char *h,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k)
|
||||
{
|
||||
unsigned char correct[16];
|
||||
|
||||
crypto_onetimeauth(correct,in,inlen,k);
|
||||
crypto_onetimeauth_poly1305_donna(correct,in,inlen,k);
|
||||
return crypto_verify_16(h,correct);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#include "crypto_onetimeauth_poly1305.h"
|
||||
#include "crypto_onetimeauth_poly1305_donna.h"
|
||||
#include "donna/poly1305_donna.h"
|
||||
|
||||
static const crypto_onetimeauth_poly1305_implementation *implementation =
|
||||
&crypto_onetimeauth_poly1305_donna_implementation;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <string.h>
|
||||
#include "crypto_onetimeauth.h"
|
||||
#include "crypto_onetimeauth_poly1305.h"
|
||||
#include "crypto_onetimeauth_poly1305_donna.h"
|
||||
#include "utils.h"
|
||||
#include "donna/poly1305_donna.h"
|
||||
|
||||
crypto_onetimeauth_poly1305_implementation *
|
||||
crypto_onetimeauth_pick_best_implementation(void)
|
||||
|
||||
@@ -19,7 +19,6 @@ SODIUM_EXPORT = \
|
||||
sodium/crypto_hash_sha512.h \
|
||||
sodium/crypto_onetimeauth.h \
|
||||
sodium/crypto_onetimeauth_poly1305.h \
|
||||
sodium/crypto_onetimeauth_poly1305_donna.h \
|
||||
sodium/crypto_pwhash_scryptsalsa208sha256.h \
|
||||
sodium/crypto_scalarmult.h \
|
||||
sodium/crypto_scalarmult_curve25519.h \
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#ifndef crypto_onetimeauth_poly1305_donna_H
|
||||
#define crypto_onetimeauth_poly1305_donna_H
|
||||
|
||||
#include "crypto_onetimeauth_poly1305.h"
|
||||
#include "export.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
# endif
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
SODIUM_EXPORT
|
||||
extern struct crypto_onetimeauth_poly1305_implementation
|
||||
crypto_onetimeauth_poly1305_donna_implementation;
|
||||
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_onetimeauth_poly1305_donna_implementation_name(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_poly1305_donna(unsigned char *out,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_onetimeauth_poly1305_donna_verify(const unsigned char *h,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen,
|
||||
const unsigned char *k);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user