aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/include
diff options
context:
space:
mode:
authorletrhee-nsr <letrhee@nsr.re.kr>2017-04-18 19:39:46 +0900
committerAndy Polyakov <appro@openssl.org>2017-04-20 22:55:40 +0200
commitdc99b885ded3cbc586d5ffec779f0e75a269bda3 (patch)
treed3c9d2f6b52f3f1263a1195e24dacb4dbb56f092 /crypto/include
parent6e64c560663f5542fdc2580bb7b030c19b6919e4 (diff)
downloadopenssl-dc99b885ded3cbc586d5ffec779f0e75a269bda3.tar.gz
Add ARIA 32-bit implementation
Modified code from http://seed.kisa.or.kr to human readable code. Previous 8-bit code is available with -DOPENSSL_SMALL_FOOTPRINT. New code is >2x faster. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3242)
Diffstat (limited to 'crypto/include')
-rw-r--r--crypto/include/internal/aria.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/include/internal/aria.h b/crypto/include/internal/aria.h
index 4d37189ae4..59b6f4f6e5 100644
--- a/crypto/include/internal/aria.h
+++ b/crypto/include/internal/aria.h
@@ -11,6 +11,8 @@
* Copyright (c) 2017 Oracle and/or its affiliates. All rights reserved.
*/
+ /* Copyright (c) 2017 National Security Resarch Institute. All rights reserved. */
+
#ifndef HEADER_ARIA_H
# define HEADER_ARIA_H
@@ -20,8 +22,6 @@
# error ARIA is disabled.
# endif
-# include <stddef.h>
-
# define ARIA_ENCRYPT 1
# define ARIA_DECRYPT 0
@@ -32,11 +32,14 @@
extern "C" {
# endif
-typedef unsigned char ARIA_u128[ARIA_BLOCK_SIZE];
+typedef union {
+ unsigned char c[ARIA_BLOCK_SIZE];
+ unsigned int u[ARIA_BLOCK_SIZE / sizeof(unsigned int)];
+} ARIA_u128;
struct aria_key_st {
- unsigned int rounds;
ARIA_u128 rd_key[ARIA_MAX_KEYS];
+ unsigned int rounds;
};
typedef struct aria_key_st ARIA_KEY;