source: EcnlProtoTool/trunk/openssl-1.1.0e/crypto/ripemd/rmd_locl.h@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr
File size: 2.7 KB
Line 
1/*
2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include <stdlib.h>
11#include <string.h>
12#include <openssl/opensslconf.h>
13#include <openssl/ripemd.h>
14
15/*
16 * DO EXAMINE COMMENTS IN crypto/md5/md5_locl.h & crypto/md5/md5_dgst.c
17 * FOR EXPLANATIONS ON FOLLOWING "CODE."
18 * <appro@fy.chalmers.se>
19 */
20#ifdef RMD160_ASM
21# if defined(__i386) || defined(__i386__) || defined(_M_IX86)
22# define ripemd160_block_data_order ripemd160_block_asm_data_order
23# endif
24#endif
25
26void ripemd160_block_data_order(RIPEMD160_CTX *c, const void *p, size_t num);
27
28#define DATA_ORDER_IS_LITTLE_ENDIAN
29
30#define HASH_LONG RIPEMD160_LONG
31#define HASH_CTX RIPEMD160_CTX
32#define HASH_CBLOCK RIPEMD160_CBLOCK
33#define HASH_UPDATE RIPEMD160_Update
34#define HASH_TRANSFORM RIPEMD160_Transform
35#define HASH_FINAL RIPEMD160_Final
36#define HASH_MAKE_STRING(c,s) do { \
37 unsigned long ll; \
38 ll=(c)->A; (void)HOST_l2c(ll,(s)); \
39 ll=(c)->B; (void)HOST_l2c(ll,(s)); \
40 ll=(c)->C; (void)HOST_l2c(ll,(s)); \
41 ll=(c)->D; (void)HOST_l2c(ll,(s)); \
42 ll=(c)->E; (void)HOST_l2c(ll,(s)); \
43 } while (0)
44#define HASH_BLOCK_DATA_ORDER ripemd160_block_data_order
45
46#include "internal/md32_common.h"
47
48/*
49 * Transformed F2 and F4 are courtesy of Wei Dai <weidai@eskimo.com>
50 */
51#define F1(x,y,z) ((x) ^ (y) ^ (z))
52#define F2(x,y,z) ((((y) ^ (z)) & (x)) ^ (z))
53#define F3(x,y,z) (((~(y)) | (x)) ^ (z))
54#define F4(x,y,z) ((((x) ^ (y)) & (z)) ^ (y))
55#define F5(x,y,z) (((~(z)) | (y)) ^ (x))
56
57#define RIPEMD160_A 0x67452301L
58#define RIPEMD160_B 0xEFCDAB89L
59#define RIPEMD160_C 0x98BADCFEL
60#define RIPEMD160_D 0x10325476L
61#define RIPEMD160_E 0xC3D2E1F0L
62
63#include "rmdconst.h"
64
65#define RIP1(a,b,c,d,e,w,s) { \
66 a+=F1(b,c,d)+X(w); \
67 a=ROTATE(a,s)+e; \
68 c=ROTATE(c,10); }
69
70#define RIP2(a,b,c,d,e,w,s,K) { \
71 a+=F2(b,c,d)+X(w)+K; \
72 a=ROTATE(a,s)+e; \
73 c=ROTATE(c,10); }
74
75#define RIP3(a,b,c,d,e,w,s,K) { \
76 a+=F3(b,c,d)+X(w)+K; \
77 a=ROTATE(a,s)+e; \
78 c=ROTATE(c,10); }
79
80#define RIP4(a,b,c,d,e,w,s,K) { \
81 a+=F4(b,c,d)+X(w)+K; \
82 a=ROTATE(a,s)+e; \
83 c=ROTATE(c,10); }
84
85#define RIP5(a,b,c,d,e,w,s,K) { \
86 a+=F5(b,c,d)+X(w)+K; \
87 a=ROTATE(a,s)+e; \
88 c=ROTATE(c,10); }
Note: See TracBrowser for help on using the repository browser.