├── rebar ├── .gitignore ├── Makefile ├── test ├── data │ └── test-poly1305aes.full.out.zip └── poly1305aes_tests.erl ├── README.md ├── c_src ├── poly1305aes │ ├── cpucycles_zero.c │ ├── cpucycles_sparc.s │ ├── cpucycles_ppro.s │ ├── cpucycles_athlon.s │ ├── cpucycles_aix.s │ ├── cpucycles_aix.h │ ├── cpucycles_ppro.h │ ├── cpucycles_zero.h │ ├── cpucycles_macos.h │ ├── cpucycles_sparc.h │ ├── aes_aix.h │ ├── cpucycles_athlon.h │ ├── aes_ppro.h │ ├── aes_macos.h │ ├── aes_athlon.h │ ├── poly1305aes_sparc_fsr.s │ ├── aes_big.h │ ├── aes.h.do │ ├── aes_sparc.h │ ├── poly1305_aix.h │ ├── poly1305_ppro.h │ ├── poly1305.h.do │ ├── poly1305_macos.h │ ├── poly1305_sparc.h │ ├── poly1305_athlon.h │ ├── cpucycles.h.do │ ├── poly1305aes.h.do │ ├── poly1305_53.h │ ├── cpucycles_macos.s │ ├── poly1305aes_53_authenticate.c │ ├── poly1305aes_aix_authenticate.c │ ├── poly1305aes_ppro_authenticate.c │ ├── poly1305aes_macos_authenticate.c │ ├── cpucycles.a.do │ ├── poly1305aes_athlon_authenticate.c │ ├── poly1305aes_sparc_authenticate.c │ ├── poly1305aes_53_verify.c │ ├── poly1305aes_aix_verify.c │ ├── poly1305aes_ppro_verify.c │ ├── poly1305aes_macos_verify.c │ ├── poly1305aes_athlon_verify.c │ ├── poly1305aes_sparc_verify.c │ ├── speedreport.do │ ├── poly1305aes_53_clamp.c │ ├── poly1305aes_aix_clamp.c │ ├── poly1305aes_ppro_clamp.c │ ├── x86cpuid.c │ ├── poly1305aes_macos_clamp.c │ ├── poly1305aes_athlon_clamp.c │ ├── poly1305_macos_constants.s │ ├── poly1305aes_53.h │ ├── poly1305aes_aix.h │ ├── poly1305aes_ppro.h │ ├── poly1305aes_macos.h │ ├── poly1305aes_sparc.h │ ├── poly1305aes_athlon.h │ ├── poly1305aes.impl.check.c │ ├── test-poly1305aes.c │ ├── poly1305_53_constants.c │ ├── poly1305_aix_constants.c │ ├── poly1305_sparc_constants.c │ ├── FILES.lib │ ├── poly1305_ppro_constants.s │ ├── poly1305_athlon_constants.s │ ├── FILES │ ├── poly1305aes_53_isequal.c │ ├── poly1305aes.impl.do │ ├── poly1305aes.a.do │ ├── poly1305aes_sparc_clamp.s │ ├── Makefile.lib │ ├── poly1305aes_ppro_isequal.s │ ├── poly1305aes_athlon_isequal.s │ ├── Makefile │ ├── poly1305aes-speed.c │ ├── poly1305aes_macos_isequal.s │ ├── poly1305aes_aix_isequal.s │ ├── aes_big.c │ ├── poly1305aes_sparc_isequal.s │ ├── aes_ppro_constants.s │ ├── aes_athlon_constants.s │ ├── aes_aix_constants.s │ ├── aes_macos_constants.s │ ├── aes_sparc_constants.c │ └── aes_big_constants.c └── poly1305aes_nifs.c ├── src ├── poly1305aes.app.src └── poly1305aes.erl └── rebar.config /rebar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b/poly1305aes/master/rebar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | c_src/*.o 2 | .eunit 3 | ebin/ 4 | priv/*.so 5 | 6 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | ./rebar -v compile 3 | 4 | clean: 5 | ./rebar -v clean 6 | 7 | eunit: 8 | ./rebar -v eunit -------------------------------------------------------------------------------- /test/data/test-poly1305aes.full.out.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/b/poly1305aes/master/test/data/test-poly1305aes.full.out.zip -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### poly1305aes 2 | 3 | poly1305aes is a NIF wrapper around the Poly1305-AES MAC function, http://cr.yp.to/mac.html. 4 | 5 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_zero.c: -------------------------------------------------------------------------------- 1 | /* 2 | cpucycles_zero.c version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "cpucycles_zero.h" 8 | 9 | long long cpucycles_zero(void) 10 | { 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_sparc.s: -------------------------------------------------------------------------------- 1 | # cpucycles_sparc.s version 20050131 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .section ".text" 6 | .align 32 7 | .global cpucycles_sparc 8 | cpucycles_sparc: 9 | retl 10 | rd %tick,%o0 11 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_ppro.s: -------------------------------------------------------------------------------- 1 | # cpucycles_ppro.s version 20050213 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .text 6 | .p2align 4,0x90 7 | .globl cpucycles_ppro 8 | .globl _cpucycles_ppro 9 | cpucycles_ppro: 10 | _cpucycles_ppro: 11 | .byte 15 12 | .byte 49 13 | ret 14 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_athlon.s: -------------------------------------------------------------------------------- 1 | # cpucycles_athlon.s version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .text 6 | .p2align 4,0x90 7 | .globl cpucycles_athlon 8 | .globl _cpucycles_athlon 9 | cpucycles_athlon: 10 | _cpucycles_athlon: 11 | .byte 15 12 | .byte 49 13 | ret 14 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_aix.s: -------------------------------------------------------------------------------- 1 | .toc 2 | .csect cpucycles_aix[DS] 3 | .globl cpucycles_aix 4 | cpucycles_aix: 5 | .long .cpucycles_aix 6 | .long TOC[tc0] 7 | .long 0 8 | .csect .text[PR] 9 | .globl .cpucycles_aix 10 | .cpucycles_aix: 11 | mftbu 3 12 | mftb 4 13 | mftbu 5 14 | cmpw 3,5 15 | bne .cpucycles_aix 16 | blr 17 | -------------------------------------------------------------------------------- /src/poly1305aes.app.src: -------------------------------------------------------------------------------- 1 | {application, poly1305aes, 2 | [ 3 | {description, "Poly1305-AES NIF MAC function NIF"}, 4 | {vsn, "1.0.0"}, 5 | {modules, [ 6 | hex, 7 | poly1305aes 8 | ]}, 9 | {registered, []}, 10 | {applications, [ 11 | kernel, 12 | stdlib 13 | ]}, 14 | {env, []} 15 | ]}. 16 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_aix.h: -------------------------------------------------------------------------------- 1 | /* 2 | cpucycles_aix.h version 20050205 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef CPUCYCLES_AIX_H 8 | #define CPUCYCLES_AIX_H 9 | 10 | extern long long cpucycles_aix(void); 11 | 12 | #ifndef cpucycles_implementation 13 | #define cpucycles_implementation "cpucycles_aix" 14 | #define cpucycles cpucycles_aix 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_ppro.h: -------------------------------------------------------------------------------- 1 | /* 2 | cpucycles_ppro.h version 20050213 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef CPUCYCLES_PPRO_H 8 | #define CPUCYCLES_PPRO_H 9 | 10 | extern long long cpucycles_ppro(void); 11 | 12 | #ifndef cpucycles_implementation 13 | #define cpucycles_implementation "cpucycles_ppro" 14 | #define cpucycles cpucycles_ppro 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_zero.h: -------------------------------------------------------------------------------- 1 | /* 2 | cpucycles_zero.h version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef CPUCYCLES_ZERO_H 8 | #define CPUCYCLES_ZERO_H 9 | 10 | extern long long cpucycles_zero(void); 11 | 12 | #ifndef cpucycles_implementation 13 | #define cpucycles_implementation "cpucycles_zero" 14 | #define cpucycles cpucycles_zero 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_macos.h: -------------------------------------------------------------------------------- 1 | /* 2 | cpucycles_macos.h version 20050207 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef CPUCYCLES_MACOS_H 8 | #define CPUCYCLES_MACOS_H 9 | 10 | extern long long cpucycles_macos(void); 11 | 12 | #ifndef cpucycles_implementation 13 | #define cpucycles_implementation "cpucycles_macos" 14 | #define cpucycles cpucycles_macos 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_sparc.h: -------------------------------------------------------------------------------- 1 | /* 2 | cpucycles_sparc.h version 20050201 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef CPUCYCLES_SPARC_H 8 | #define CPUCYCLES_SPARC_H 9 | 10 | extern long long cpucycles_sparc(void); 11 | 12 | #ifndef cpucycles_implementation 13 | #define cpucycles_implementation "cpucycles_sparc" 14 | #define cpucycles cpucycles_sparc 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_aix.h: -------------------------------------------------------------------------------- 1 | /* 2 | aes_aix.h version 20050205 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef AES_AIX_H 8 | #define AES_AIX_H 9 | 10 | extern void aes_aix(unsigned char out[16], 11 | const unsigned char k[16], 12 | const unsigned char n[16]); 13 | 14 | #ifndef aes_implementation 15 | #define aes_implementation "aes_aix" 16 | #define aes aes_aix 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_athlon.h: -------------------------------------------------------------------------------- 1 | /* 2 | cpucycles_athlon.h version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef CPUCYCLES_ATHLON_H 8 | #define CPUCYCLES_ATHLON_H 9 | 10 | extern long long cpucycles_athlon(void); 11 | 12 | #ifndef cpucycles_implementation 13 | #define cpucycles_implementation "cpucycles_athlon" 14 | #define cpucycles cpucycles_athlon 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_ppro.h: -------------------------------------------------------------------------------- 1 | /* 2 | aes_ppro.h version 20050213 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef AES_PPRO_H 8 | #define AES_PPRO_H 9 | 10 | extern void aes_ppro(unsigned char out[16], 11 | const unsigned char k[16], 12 | const unsigned char n[16]); 13 | 14 | #ifndef aes_implementation 15 | #define aes_implementation "aes_ppro" 16 | #define aes aes_ppro 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_macos.h: -------------------------------------------------------------------------------- 1 | /* 2 | aes_macos.h version 20050207 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef AES_MACOS_H 8 | #define AES_MACOS_H 9 | 10 | extern void aes_macos(unsigned char out[16], 11 | const unsigned char k[16], 12 | const unsigned char n[16]); 13 | 14 | #ifndef aes_implementation 15 | #define aes_implementation "aes_macos" 16 | #define aes aes_macos 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_athlon.h: -------------------------------------------------------------------------------- 1 | /* 2 | aes_athlon.h version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef AES_ATHLON_H 8 | #define AES_ATHLON_H 9 | 10 | extern void aes_athlon(unsigned char out[16], 11 | const unsigned char k[16], 12 | const unsigned char n[16]); 13 | 14 | #ifndef aes_implementation 15 | #define aes_implementation "aes_athlon" 16 | #define aes aes_athlon 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_sparc_fsr.s: -------------------------------------------------------------------------------- 1 | # poly1305aes_sparc_fsr.s version 20050131 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .section ".data" 6 | .align 4 7 | .global zero 8 | zero: 9 | .long 0 10 | 11 | .section ".text" 12 | .align 32 13 | .global poly1305aes_sparc_fsr 14 | poly1305aes_sparc_fsr: 15 | sethi %hh(zero),%o0 16 | sethi %lm(zero),%o1 17 | or %o0,%hm(zero),%o0 18 | or %o1,%lo(zero),%o1 19 | sllx %o0,32,%o0 20 | retl 21 | ld [%o0+%o1],%fsr 22 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_big.h: -------------------------------------------------------------------------------- 1 | /* 2 | aes_big.h version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef AES_BIG_H 8 | #define AES_BIG_H 9 | 10 | extern void aes_big(unsigned char out[16], 11 | const unsigned char k[16], 12 | const unsigned char n[16]); 13 | 14 | #ifndef aes_implementation 15 | #define aes_implementation "aes_big" 16 | #define aes aes_big 17 | #endif 18 | 19 | extern const unsigned int aes_big_constants[1034]; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes.h.do: -------------------------------------------------------------------------------- 1 | # aes.h.do version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | case `cat poly1305aes.impl` in 6 | 53) echo '#include "aes_big.h"' ;; 7 | aix) echo '#include "aes_aix.h"' ;; 8 | athlon) echo '#include "aes_athlon.h"' ;; 9 | macos) echo '#include "aes_macos.h"' ;; 10 | ppro) echo '#include "aes_ppro.h"' ;; 11 | sparc) echo '#include "aes_sparc.h"' ;; 12 | *) echo 'unknown implementation' >&2; exit 1 ;; 13 | esac 14 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_sparc.h: -------------------------------------------------------------------------------- 1 | /* 2 | aes_sparc.h version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef AES_SPARC_H 8 | #define AES_SPARC_H 9 | 10 | extern void aes_sparc(unsigned char out[16], 11 | const unsigned char k[16], 12 | const unsigned char n[16]); 13 | 14 | #ifndef aes_implementation 15 | #define aes_implementation "aes_sparc" 16 | #define aes aes_sparc 17 | #endif 18 | 19 | extern const unsigned int aes_sparc_constants[1034]; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_aix.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305_aix.h version 20050205 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305_AIX_H 8 | #define POLY1305_AIX_H 9 | 10 | extern void poly1305_aix(unsigned char out[16], 11 | const unsigned char r[16], 12 | const unsigned char s[16], 13 | const unsigned char m[],unsigned int l); 14 | 15 | #ifndef poly1305_implementation 16 | #define poly1305_implementation "poly1305_aix" 17 | #define poly1305 poly1305_aix 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_ppro.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305_ppro.h version 20050213 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305_PPRO_H 8 | #define POLY1305_PPRO_H 9 | 10 | extern void poly1305_ppro(unsigned char out[16], 11 | const unsigned char r[16], 12 | const unsigned char s[16], 13 | const unsigned char m[],unsigned int l); 14 | 15 | #ifndef poly1305_implementation 16 | #define poly1305_implementation "poly1305_ppro" 17 | #define poly1305 poly1305_ppro 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305.h.do: -------------------------------------------------------------------------------- 1 | # poly1305.h.do version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | case `cat poly1305aes.impl` in 6 | 53) echo '#include "poly1305_53.h"' ;; 7 | aix) echo '#include "poly1305_aix.h"' ;; 8 | athlon) echo '#include "poly1305_athlon.h"' ;; 9 | macos) echo '#include "poly1305_macos.h"' ;; 10 | ppro) echo '#include "poly1305_ppro.h"' ;; 11 | sparc) echo '#include "poly1305_sparc.h"' ;; 12 | *) echo 'unknown implementation' >&2; exit 1 ;; 13 | esac 14 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_macos.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305_macos.h version 20050207 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305_MACOS_H 8 | #define POLY1305_MACOS_H 9 | 10 | extern void poly1305_macos(unsigned char out[16], 11 | const unsigned char r[16], 12 | const unsigned char s[16], 13 | const unsigned char m[],unsigned int l); 14 | 15 | #ifndef poly1305_implementation 16 | #define poly1305_implementation "poly1305_macos" 17 | #define poly1305 poly1305_macos 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_sparc.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305_sparc.h version 20050201 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305_SPARC_H 8 | #define POLY1305_SPARC_H 9 | 10 | extern void poly1305_sparc(unsigned char out[16], 11 | const unsigned char r[16], 12 | const unsigned char s[16], 13 | const unsigned char m[],unsigned int l); 14 | 15 | #ifndef poly1305_implementation 16 | #define poly1305_implementation "poly1305_sparc" 17 | #define poly1305 poly1305_sparc 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_athlon.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305_athon.h version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305_ATHLON_H 8 | #define POLY1305_ATHLON_H 9 | 10 | extern void poly1305_athon(unsigned char out[16], 11 | const unsigned char r[16], 12 | const unsigned char s[16], 13 | const unsigned char m[],unsigned int l); 14 | 15 | #ifndef poly1305_implementation 16 | #define poly1305_implementation "poly1305_athon" 17 | #define poly1305 poly1305_athon 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles.h.do: -------------------------------------------------------------------------------- 1 | # cpucycles.h.do version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | case `cat poly1305aes.impl` in 6 | 53) echo '#include "cpucycles_zero.h"' ;; 7 | aix) echo '#include "cpucycles_aix.h"' ;; 8 | athlon) echo '#include "cpucycles_athlon.h"' ;; 9 | macos) echo '#include "cpucycles_macos.h"' ;; 10 | ppro) echo '#include "cpucycles_ppro.h"' ;; 11 | sparc) echo '#include "cpucycles_sparc.h"' ;; 12 | *) echo 'unknown implementation' >&2; exit 1 ;; 13 | esac 14 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes.h.do: -------------------------------------------------------------------------------- 1 | # poly1305aes.h.do version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | case `cat poly1305aes.impl` in 6 | 53) echo '#include "poly1305aes_53.h"' ;; 7 | aix) echo '#include "poly1305aes_aix.h"' ;; 8 | athlon) echo '#include "poly1305aes_athlon.h"' ;; 9 | macos) echo '#include "poly1305aes_macos.h"' ;; 10 | ppro) echo '#include "poly1305aes_ppro.h"' ;; 11 | sparc) echo '#include "poly1305aes_sparc.h"' ;; 12 | *) echo 'unknown implementation' >&2; exit 1 ;; 13 | esac 14 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_53.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305_53.h version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305_53_H 8 | #define POLY1305_53_H 9 | 10 | extern void poly1305_53(unsigned char out[16], 11 | const unsigned char r[16], 12 | const unsigned char s[16], 13 | const unsigned char m[],unsigned int l); 14 | 15 | #ifndef poly1305_implementation 16 | #define poly1305_implementation "poly1305_53" 17 | #define poly1305 poly1305_53 18 | #endif 19 | 20 | extern const double poly1305_53_constants[]; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles_macos.s: -------------------------------------------------------------------------------- 1 | # cpucycles_macos.s version 20050207 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | # Is there a reliable way to determine the time base as CPU cycles? 6 | # It's 16 on a G4 I've tested; this code assumes 16 in general. 7 | 8 | .text 9 | .align 2 10 | .globl _cpucycles_macos 11 | .globl cpucycles_macos 12 | _cpucycles_macos: 13 | cpucycles_macos: 14 | mftbu r3 15 | mftb r4 16 | mftbu r5 17 | cmpw r3,r5 18 | bne cpucycles_macos 19 | rlwinm r3,r3,4,0xfffffff0 20 | rlwimi r3,r4,4,0x0000000f 21 | rlwinm r4,r4,4,0xfffffff0 22 | blr 23 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_53_authenticate.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_53_authenticate.c version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_53.h" 8 | #include "poly1305_53.h" 9 | #include "aes_big.h" 10 | 11 | void poly1305aes_53_authenticate(unsigned char out[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | aes_big(aeskn,k,n); 20 | poly1305_53(out,r,aeskn,m,l); 21 | } 22 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_aix_authenticate.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_aix_authenticate.c version 20050205 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_aix.h" 8 | #include "poly1305_aix.h" 9 | #include "aes_aix.h" 10 | 11 | void poly1305aes_aix_authenticate(unsigned char out[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | aes_aix(aeskn,k,n); 20 | poly1305_aix(out,r,aeskn,m,l); 21 | } 22 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_ppro_authenticate.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_ppro_authenticate.c version 20050213 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_ppro.h" 8 | #include "poly1305_ppro.h" 9 | #include "aes_ppro.h" 10 | 11 | void poly1305aes_ppro_authenticate(unsigned char out[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | aes_ppro(aeskn,k,n); 20 | poly1305_ppro(out,r,aeskn,m,l); 21 | } 22 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_macos_authenticate.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_macos_authenticate.c version 20050207 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_macos.h" 8 | #include "poly1305_macos.h" 9 | #include "aes_macos.h" 10 | 11 | void poly1305aes_macos_authenticate(unsigned char out[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | aes_macos(aeskn,k,n); 20 | poly1305_macos(out,r,aeskn,m,l); 21 | } 22 | -------------------------------------------------------------------------------- /c_src/poly1305aes/cpucycles.a.do: -------------------------------------------------------------------------------- 1 | # cpucycles.a.do version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | rm -f cpucyclestmp.a 6 | 7 | impl=`cat poly1305aes.impl` 8 | 9 | case $impl in 10 | 53) 11 | $* -c cpucycles_zero.c 12 | ar cr cpucyclestmp.a cpucycles_zero.o 13 | ;; 14 | aix|athlon|macos|ppro|sparc) 15 | $* -c cpucycles_${impl}.s 16 | ar cr cpucyclestmp.a cpucycles_${impl}.o 17 | ;; 18 | *) echo 'unknown implementation' >&2; exit 1 ;; 19 | esac 20 | 21 | ranlib cpucyclestmp.a >/dev/null 2>/dev/null || : 22 | cat cpucyclestmp.a 23 | rm cpucyclestmp.a 24 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_athlon_authenticate.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_athlon_authenticate.c version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_athlon.h" 8 | #include "poly1305_athlon.h" 9 | #include "aes_athlon.h" 10 | 11 | void poly1305aes_athlon_authenticate(unsigned char out[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | aes_athlon(aeskn,k,n); 20 | poly1305_athlon(out,r,aeskn,m,l); 21 | } 22 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_sparc_authenticate.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_sparc_authenticate.c version 20050131 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_sparc.h" 8 | #include "poly1305_sparc.h" 9 | #include "aes_sparc.h" 10 | 11 | void poly1305aes_sparc_authenticate(unsigned char out[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | poly1305aes_sparc_fsr(); 20 | aes_sparc(aeskn,k,n); 21 | poly1305_sparc(out,r,aeskn,m,l); 22 | } 23 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_53_verify.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_53_verify.c version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_53.h" 8 | #include "poly1305_53.h" 9 | #include "aes_big.h" 10 | 11 | int poly1305aes_53_verify(const unsigned char a[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | unsigned char valid[16]; 20 | aes_big(aeskn,k,n); 21 | poly1305_53(valid,r,aeskn,m,l); 22 | return poly1305aes_53_isequal(a,valid); 23 | } 24 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_aix_verify.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_aix_verify.c version 20050205 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_aix.h" 8 | #include "poly1305_aix.h" 9 | #include "aes_aix.h" 10 | 11 | int poly1305aes_aix_verify(const unsigned char a[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | unsigned char valid[16]; 20 | aes_aix(aeskn,k,n); 21 | poly1305_aix(valid,r,aeskn,m,l); 22 | return poly1305aes_aix_isequal(a,valid); 23 | } 24 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_ppro_verify.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_ppro_verify.c version 20050213 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_ppro.h" 8 | #include "poly1305_ppro.h" 9 | #include "aes_ppro.h" 10 | 11 | int poly1305aes_ppro_verify(const unsigned char a[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | unsigned char valid[16]; 20 | aes_ppro(aeskn,k,n); 21 | poly1305_ppro(valid,r,aeskn,m,l); 22 | return poly1305aes_ppro_isequal(a,valid); 23 | } 24 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_macos_verify.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_macos_verify.c version 20050207 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_macos.h" 8 | #include "poly1305_macos.h" 9 | #include "aes_macos.h" 10 | 11 | int poly1305aes_macos_verify(const unsigned char a[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | unsigned char valid[16]; 20 | aes_macos(aeskn,k,n); 21 | poly1305_macos(valid,r,aeskn,m,l); 22 | return poly1305aes_macos_isequal(a,valid); 23 | } 24 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_athlon_verify.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_athlon_verify.c version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_athlon.h" 8 | #include "poly1305_athlon.h" 9 | #include "aes_athlon.h" 10 | 11 | int poly1305aes_athlon_verify(const unsigned char a[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | unsigned char valid[16]; 20 | aes_athlon(aeskn,k,n); 21 | poly1305_athlon(valid,r,aeskn,m,l); 22 | return poly1305aes_athlon_isequal(a,valid); 23 | } 24 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_sparc_verify.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_sparc_verify.c version 20050131 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_sparc.h" 8 | #include "poly1305_sparc.h" 9 | #include "aes_sparc.h" 10 | 11 | int poly1305aes_sparc_verify(const unsigned char a[16], 12 | const unsigned char kr[32], 13 | #define k (kr + 0) 14 | #define r (kr + 16) 15 | const unsigned char n[16], 16 | const unsigned char m[],unsigned int l) 17 | { 18 | unsigned char aeskn[16]; 19 | unsigned char valid[16]; 20 | poly1305aes_sparc_fsr(); 21 | aes_sparc(aeskn,k,n); 22 | poly1305_sparc(valid,r,aeskn,m,l); 23 | return poly1305aes_sparc_isequal(a,valid); 24 | } 25 | -------------------------------------------------------------------------------- /c_src/poly1305aes/speedreport.do: -------------------------------------------------------------------------------- 1 | # Public domain. 2 | 3 | exec 2>&1 4 | echo 'poly1305aes speedreport version 20050218' 5 | echo '' 6 | echo '% uname -a' 7 | uname -a 8 | echo '% echo "$CC"' 9 | echo "$CC" 10 | echo '% gcc --version' 11 | gcc --version 12 | echo '% cat /proc/cpuinfo' 13 | cat /proc/cpuinfo 14 | echo '% sysctl -a hw.model' 15 | sysctl -a hw.model 16 | echo '% /usr/sbin/psrinfo -v' 17 | /usr/sbin/psrinfo -v 18 | echo '% cat x86cpuid.out' 19 | cat x86cpuid.out 20 | echo '% cat poly1305aes.h poly1305.h aes.h cpucycles.h' 21 | cat poly1305aes.h poly1305.h aes.h cpucycles.h 22 | echo '% echo _____; ./poly1305aes-speed; echo _____' 23 | echo _____; ./poly1305aes-speed; echo _____ 24 | echo '% ./test-poly1305aes | head -123456789 | tail -1' 25 | ./test-poly1305aes | head -123456789 | tail -1 26 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_53_clamp.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_53_clamp.c version 20050207 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_53.h" 8 | 9 | void poly1305aes_53_clamp(unsigned char kr[32]) 10 | { 11 | unsigned int r3; 12 | unsigned int r7; 13 | unsigned int r11; 14 | unsigned int r15; 15 | unsigned int r4; 16 | unsigned int r8; 17 | unsigned int r12; 18 | #define r (kr + 16) 19 | r3 = r[3]; 20 | r7 = r[7]; 21 | r11 = r[11]; 22 | r15 = r[15]; 23 | r4 = r[4]; 24 | r8 = r[8]; 25 | r12 = r[12]; 26 | r3 &= 15; 27 | r7 &= 15; 28 | r11 &= 15; 29 | r15 &= 15; 30 | r4 &= 252; 31 | r8 &= 252; 32 | r12 &= 252; 33 | r[3] = r3; 34 | r[7] = r7; 35 | r[11] = r11; 36 | r[15] = r15; 37 | r[4] = r4; 38 | r[8] = r8; 39 | r[12] = r12; 40 | } 41 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_aix_clamp.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_aix_clamp.c version 20050207 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_aix.h" 8 | 9 | void poly1305aes_aix_clamp(unsigned char kr[32]) 10 | { 11 | unsigned int r3; 12 | unsigned int r7; 13 | unsigned int r11; 14 | unsigned int r15; 15 | unsigned int r4; 16 | unsigned int r8; 17 | unsigned int r12; 18 | #define r (kr + 16) 19 | r3 = r[3]; 20 | r7 = r[7]; 21 | r11 = r[11]; 22 | r15 = r[15]; 23 | r4 = r[4]; 24 | r8 = r[8]; 25 | r12 = r[12]; 26 | r3 &= 15; 27 | r7 &= 15; 28 | r11 &= 15; 29 | r15 &= 15; 30 | r4 &= 252; 31 | r8 &= 252; 32 | r12 &= 252; 33 | r[3] = r3; 34 | r[7] = r7; 35 | r[11] = r11; 36 | r[15] = r15; 37 | r[4] = r4; 38 | r[8] = r8; 39 | r[12] = r12; 40 | } 41 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_ppro_clamp.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_ppro_clamp.c version 20050213 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_ppro.h" 8 | 9 | void poly1305aes_ppro_clamp(unsigned char kr[32]) 10 | { 11 | unsigned int r3; 12 | unsigned int r7; 13 | unsigned int r11; 14 | unsigned int r15; 15 | unsigned int r4; 16 | unsigned int r8; 17 | unsigned int r12; 18 | #define r (kr + 16) 19 | r3 = r[3]; 20 | r7 = r[7]; 21 | r11 = r[11]; 22 | r15 = r[15]; 23 | r4 = r[4]; 24 | r8 = r[8]; 25 | r12 = r[12]; 26 | r3 &= 15; 27 | r7 &= 15; 28 | r11 &= 15; 29 | r15 &= 15; 30 | r4 &= 252; 31 | r8 &= 252; 32 | r12 &= 252; 33 | r[3] = r3; 34 | r[7] = r7; 35 | r[11] = r11; 36 | r[15] = r15; 37 | r[4] = r4; 38 | r[8] = r8; 39 | r[12] = r12; 40 | } 41 | -------------------------------------------------------------------------------- /c_src/poly1305aes/x86cpuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void nope() 4 | { 5 | exit(1); 6 | } 7 | 8 | int main() 9 | { 10 | unsigned long x[4]; 11 | unsigned long y[4]; 12 | int i; 13 | int j; 14 | char c; 15 | 16 | signal(SIGILL,nope); 17 | 18 | x[0] = 0; 19 | x[1] = 0; 20 | x[2] = 0; 21 | x[3] = 0; 22 | 23 | asm volatile(".byte 15;.byte 162" : "=a"(x[0]),"=b"(x[1]),"=c"(x[3]),"=d"(x[2]) : "0"(0) ); 24 | if (!x[0]) return 0; 25 | asm volatile(".byte 15;.byte 162" : "=a"(y[0]),"=b"(y[1]),"=c"(y[2]),"=d"(y[3]) : "0"(1) ); 26 | 27 | for (i = 1;i < 4;++i) 28 | for (j = 0;j < 4;++j) { 29 | c = x[i] >> (8 * j); 30 | if (c < 32) c = 32; 31 | if (c > 126) c = 126; 32 | putchar(c); 33 | } 34 | 35 | printf("-%08x-%08x\n",y[0],y[3]); 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_macos_clamp.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_macos_clamp.c version 20050207 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_macos.h" 8 | 9 | void poly1305aes_macos_clamp(unsigned char kr[32]) 10 | { 11 | unsigned int r3; 12 | unsigned int r7; 13 | unsigned int r11; 14 | unsigned int r15; 15 | unsigned int r4; 16 | unsigned int r8; 17 | unsigned int r12; 18 | #define r (kr + 16) 19 | r3 = r[3]; 20 | r7 = r[7]; 21 | r11 = r[11]; 22 | r15 = r[15]; 23 | r4 = r[4]; 24 | r8 = r[8]; 25 | r12 = r[12]; 26 | r3 &= 15; 27 | r7 &= 15; 28 | r11 &= 15; 29 | r15 &= 15; 30 | r4 &= 252; 31 | r8 &= 252; 32 | r12 &= 252; 33 | r[3] = r3; 34 | r[7] = r7; 35 | r[11] = r11; 36 | r[15] = r15; 37 | r[4] = r4; 38 | r[8] = r8; 39 | r[12] = r12; 40 | } 41 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_athlon_clamp.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_athlon_clamp.c version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_athlon.h" 8 | 9 | void poly1305aes_athlon_clamp(unsigned char kr[32]) 10 | { 11 | unsigned int r3; 12 | unsigned int r7; 13 | unsigned int r11; 14 | unsigned int r15; 15 | unsigned int r4; 16 | unsigned int r8; 17 | unsigned int r12; 18 | #define r (kr + 16) 19 | r3 = r[3]; 20 | r7 = r[7]; 21 | r11 = r[11]; 22 | r15 = r[15]; 23 | r4 = r[4]; 24 | r8 = r[8]; 25 | r12 = r[12]; 26 | r3 &= 15; 27 | r7 &= 15; 28 | r11 &= 15; 29 | r15 &= 15; 30 | r4 &= 252; 31 | r8 &= 252; 32 | r12 &= 252; 33 | r[3] = r3; 34 | r[7] = r7; 35 | r[11] = r11; 36 | r[15] = r15; 37 | r[4] = r4; 38 | r[8] = r8; 39 | r[12] = r12; 40 | } 41 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_macos_constants.s: -------------------------------------------------------------------------------- 1 | # poly1305_macos_constants.s version 20050207 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .const 6 | .align 4 7 | .globl _poly1305_macos_constants 8 | .globl poly1305_macos_constants 9 | 10 | _poly1305_macos_constants: 11 | poly1305_macos_constants: 12 | .long 0x3e380000 13 | .long 0x0 14 | .long 0x40380000 15 | .long 0x0 16 | .long 0x42380000 17 | .long 0x0 18 | .long 0x43380000 19 | .long 0x0 20 | .long 0x44580000 21 | .long 0x0 22 | .long 0x45380000 23 | .long 0x0 24 | .long 0x46580000 25 | .long 0x0 26 | .long 0x47380000 27 | .long 0x0 28 | .long 0x48580000 29 | .long 0x0 30 | .long 0x49380000 31 | .long 0x0 32 | .long 0x4a380000 33 | .long 0x0 34 | .long 0x4b580000 35 | .long 0x0 36 | .long 0x37f40000 37 | .long 0x0 38 | .long 0x43380001 39 | .long 0xfffffffb 40 | .long 0x45380001 41 | .long 0xfffffffe 42 | .long 0x47380001 43 | .long 0xfffffffe 44 | .long 0x49380003 45 | .long 0xfffffffe 46 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_53.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_53.h version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305AES_53_H 8 | #define POLY1305AES_53_H 9 | 10 | extern void poly1305aes_53_clamp(unsigned char kr[32]); 11 | 12 | extern void poly1305aes_53_authenticate(unsigned char out[16], 13 | const unsigned char kr[32], 14 | const unsigned char n[16], 15 | const unsigned char m[],unsigned int l); 16 | 17 | extern int poly1305aes_53_verify(const unsigned char a[16], 18 | const unsigned char kr[32], 19 | const unsigned char n[16], 20 | const unsigned char m[],unsigned int l); 21 | 22 | #ifndef poly1305aes_implementation 23 | #define poly1305aes_implementation "poly1305aes_53" 24 | #define poly1305aes_clamp poly1305aes_53_clamp 25 | #define poly1305aes_authenticate poly1305aes_53_authenticate 26 | #define poly1305aes_verify poly1305aes_53_verify 27 | #endif 28 | 29 | extern int poly1305aes_53_isequal(const unsigned char x[16], 30 | const unsigned char y[16]); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_aix.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_aix.h version 20050205 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305AES_AIX_H 8 | #define POLY1305AES_AIX_H 9 | 10 | extern void poly1305aes_aix_clamp(unsigned char kr[32]); 11 | 12 | extern void poly1305aes_aix_authenticate(unsigned char out[16], 13 | const unsigned char kr[32], 14 | const unsigned char n[16], 15 | const unsigned char m[],unsigned int l); 16 | 17 | extern int poly1305aes_aix_verify(const unsigned char a[16], 18 | const unsigned char kr[32], 19 | const unsigned char n[16], 20 | const unsigned char m[],unsigned int l); 21 | 22 | #ifndef poly1305aes_implementation 23 | #define poly1305aes_implementation "poly1305aes_aix" 24 | #define poly1305aes_clamp poly1305aes_aix_clamp 25 | #define poly1305aes_authenticate poly1305aes_aix_authenticate 26 | #define poly1305aes_verify poly1305aes_aix_verify 27 | #endif 28 | 29 | extern int poly1305aes_aix_isequal(const unsigned char x[16], 30 | const unsigned char y[16]); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_ppro.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_ppro.h version 20050213 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305AES_PPRO_H 8 | #define POLY1305AES_PPRO_H 9 | 10 | extern void poly1305aes_ppro_clamp(unsigned char kr[32]); 11 | 12 | extern void poly1305aes_ppro_authenticate(unsigned char out[16], 13 | const unsigned char kr[32], 14 | const unsigned char n[16], 15 | const unsigned char m[],unsigned int l); 16 | 17 | extern int poly1305aes_ppro_verify(const unsigned char a[16], 18 | const unsigned char kr[32], 19 | const unsigned char n[16], 20 | const unsigned char m[],unsigned int l); 21 | 22 | #ifndef poly1305aes_implementation 23 | #define poly1305aes_implementation "poly1305aes_ppro" 24 | #define poly1305aes_clamp poly1305aes_ppro_clamp 25 | #define poly1305aes_authenticate poly1305aes_ppro_authenticate 26 | #define poly1305aes_verify poly1305aes_ppro_verify 27 | #endif 28 | 29 | extern int poly1305aes_ppro_isequal(const unsigned char x[16], 30 | const unsigned char y[16]); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_macos.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_macos.h version 20050207 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305AES_MACOS_H 8 | #define POLY1305AES_MACOS_H 9 | 10 | extern void poly1305aes_macos_clamp(unsigned char kr[32]); 11 | 12 | extern void poly1305aes_macos_authenticate(unsigned char out[16], 13 | const unsigned char kr[32], 14 | const unsigned char n[16], 15 | const unsigned char m[],unsigned int l); 16 | 17 | extern int poly1305aes_macos_verify(const unsigned char a[16], 18 | const unsigned char kr[32], 19 | const unsigned char n[16], 20 | const unsigned char m[],unsigned int l); 21 | 22 | #ifndef poly1305aes_implementation 23 | #define poly1305aes_implementation "poly1305aes_macos" 24 | #define poly1305aes_clamp poly1305aes_macos_clamp 25 | #define poly1305aes_authenticate poly1305aes_macos_authenticate 26 | #define poly1305aes_verify poly1305aes_macos_verify 27 | #endif 28 | 29 | extern int poly1305aes_macos_isequal(const unsigned char x[16], 30 | const unsigned char y[16]); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_sparc.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_sparc.h version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305AES_SPARC_H 8 | #define POLY1305AES_SPARC_H 9 | 10 | extern void poly1305aes_sparc_clamp(unsigned char kr[32]); 11 | 12 | extern void poly1305aes_sparc_authenticate(unsigned char out[16], 13 | const unsigned char kr[32], 14 | const unsigned char n[16], 15 | const unsigned char m[],unsigned int l); 16 | 17 | extern int poly1305aes_sparc_verify(const unsigned char a[16], 18 | const unsigned char kr[32], 19 | const unsigned char n[16], 20 | const unsigned char m[],unsigned int l); 21 | 22 | #ifndef poly1305aes_implementation 23 | #define poly1305aes_implementation "poly1305aes_sparc" 24 | #define poly1305aes_clamp poly1305aes_sparc_clamp 25 | #define poly1305aes_authenticate poly1305aes_sparc_authenticate 26 | #define poly1305aes_verify poly1305aes_sparc_verify 27 | #endif 28 | 29 | extern int poly1305aes_sparc_isequal(const unsigned char x[16], 30 | const unsigned char y[16]); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_athlon.h: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_athlon.h version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #ifndef POLY1305AES_ATHLON_H 8 | #define POLY1305AES_ATHLON_H 9 | 10 | extern void poly1305aes_athlon_clamp(unsigned char kr[32]); 11 | 12 | extern void poly1305aes_athlon_authenticate(unsigned char out[16], 13 | const unsigned char kr[32], 14 | const unsigned char n[16], 15 | const unsigned char m[],unsigned int l); 16 | 17 | extern int poly1305aes_athlon_verify(const unsigned char a[16], 18 | const unsigned char kr[32], 19 | const unsigned char n[16], 20 | const unsigned char m[],unsigned int l); 21 | 22 | #ifndef poly1305aes_implementation 23 | #define poly1305aes_implementation "poly1305aes_athlon" 24 | #define poly1305aes_clamp poly1305aes_athlon_clamp 25 | #define poly1305aes_authenticate poly1305aes_athlon_authenticate 26 | #define poly1305aes_verify poly1305aes_athlon_verify 27 | #endif 28 | 29 | extern int poly1305aes_athlon_isequal(const unsigned char x[16], 30 | const unsigned char y[16]); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /test/poly1305aes_tests.erl: -------------------------------------------------------------------------------- 1 | -module(poly1305aes_tests). 2 | 3 | -include_lib("eunit/include/eunit.hrl"). 4 | 5 | parse_lines(Lines) -> 6 | lists:map( 7 | fun(L) -> 8 | Line = case string:tokens(L, ",") of 9 | [Kr, N, M, Len, A] -> [Kr, N, M, Len, A]; 10 | [Kr, N, Len, A] -> [Kr, N, "", Len, A] 11 | end, 12 | lists:map(fun hex:hexstr_to_bin/1, Line) 13 | end, 14 | Lines). 15 | 16 | authenticate([Kr, N, M, _Len, A]) -> 17 | {ok, Out} = poly1305aes:authenticate(Kr, N, M), 18 | ?assertEqual(Out, A). 19 | 20 | verify([Kr, N, M, _Len, A]) -> 21 | ?assert(poly1305aes:verify(A, Kr, N, M)). 22 | 23 | test_data(Fun) -> 24 | {ok, Cwd} = file:get_cwd(), 25 | Filename = filename:join([Cwd, "..", "test", "data", "test-poly1305aes.full.out.zip"]), 26 | {ok, ZipHandle} = zip:zip_open(Filename, [memory]), 27 | {ok, {_, Data}} = zip:zip_get("test-poly1305aes.full.out", ZipHandle), 28 | 29 | lists:foreach( 30 | fun(L) -> 31 | Fun(L) 32 | end, parse_lines(string:tokens(binary_to_list(Data), "\n"))). 33 | 34 | authenticate_test_() -> {timeout, 60, fun() -> test_data(fun authenticate/1) end}. 35 | verify_test_() -> {timeout, 60, fun() -> test_data(fun verify/1) end}. 36 | 37 | % add tests for things that should fail 38 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes.impl.check.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes.impl.check.c version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes.impl.check.h" 8 | 9 | #define MAXLEN 100 10 | unsigned char out[16]; 11 | unsigned char kr[32]; 12 | unsigned char n[16]; 13 | unsigned char m[MAXLEN]; 14 | 15 | unsigned char exp[16] = { 16 | 0xf7,0xe7,0x71,0xd9,0xb6,0x09,0x67,0xcc,0x6a,0xaa,0x9a,0x04,0x1b,0xe5,0x53,0x65 17 | }; 18 | 19 | main() 20 | { 21 | int loop; 22 | int len; 23 | int i; 24 | int x; 25 | int y; 26 | 27 | for (loop = 0;loop < 10;++loop) { 28 | len = 0; 29 | for (;;) { 30 | poly1305aes_authenticate(out,kr,n,m,len); 31 | if (!poly1305aes_verify(out,kr,n,m,len)) return 1; 32 | x = random() & 15; 33 | y = 1 + (random() % 255); 34 | out[x] += y; 35 | if (poly1305aes_verify(out,kr,n,m,len)) return 1; 36 | out[x] -= y; 37 | if (len >= MAXLEN) break; 38 | n[0] ^= loop; 39 | for (i = 0;i < 16;++i) n[i] ^= out[i]; 40 | if (len % 2) for (i = 0;i < 16;++i) kr[i] ^= out[i]; 41 | if (len % 3) for (i = 0;i < 16;++i) kr[i + 16] ^= out[i]; 42 | poly1305aes_clamp(kr); 43 | m[len++] ^= out[0]; 44 | } 45 | } 46 | 47 | for (i = 0;i < 16;++i) if (out[i] != exp[i]) return 1; 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /src/poly1305aes.erl: -------------------------------------------------------------------------------- 1 | -module(poly1305aes). 2 | -author('b@b3k.us'). 3 | 4 | -export([init/0, 5 | make_key/0, 6 | make_nonce/0, 7 | clamp/1, 8 | authenticate/3, 9 | verify/4]). 10 | 11 | -on_load(init/0). 12 | 13 | init() -> 14 | case code:priv_dir(poly1305aes) of 15 | {error, bad_name} -> 16 | SoName = filename:join("../priv", "poly1305aes_nifs"); 17 | Dir -> 18 | SoName = filename:join(Dir, "poly1305aes_nifs") 19 | end, 20 | case erlang:load_nif(SoName, 0) of 21 | ok -> ok; 22 | {error, {load, _}} -> ok; 23 | {error, {reload, _}} -> ok; 24 | {error, {upgrade, _}} -> ok; 25 | Error -> Error 26 | end. 27 | 28 | -spec make_key() -> binary(). 29 | make_key() -> 30 | crypto:strong_rand_bytes(32). 31 | 32 | -spec make_nonce() -> binary(). 33 | make_nonce() -> 34 | crypto:strong_rand_bytes(16). 35 | 36 | -spec clamp(binary()) -> {ok, binary()} | {error, atom()}. 37 | clamp(_Kr) -> 38 | "NIF library not loaded". 39 | 40 | -spec authenticate(binary(), binary(), binary()) -> {ok, binary()} | {error, atom()}. 41 | authenticate(_Kr, _N, _M) -> 42 | "NIF library not loaded". 43 | 44 | -spec verify(binary(), binary(), binary(), binary()) -> boolean(). 45 | verify(_A, _Kr, _N, _M) -> 46 | "NIF library not loaded". 47 | -------------------------------------------------------------------------------- /c_src/poly1305aes/test-poly1305aes.c: -------------------------------------------------------------------------------- 1 | /* 2 | test-poly1305aes version 20050131 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include 8 | #include "poly1305aes.h" 9 | 10 | #define MAXLEN 1000 11 | unsigned char out[16]; 12 | unsigned char kr[32]; 13 | unsigned char n[16]; 14 | unsigned char m[MAXLEN]; 15 | 16 | main() 17 | { 18 | int loop; 19 | int len; 20 | int i; 21 | int x; 22 | int y; 23 | 24 | for (loop = 0;loop < 1000000;++loop) { 25 | len = 0; 26 | for (;;) { 27 | poly1305aes_authenticate(out,kr,n,m,len); 28 | for (i = 0;i < 16;++i) printf("%02x",(unsigned int) out[i]); 29 | printf("\n"); 30 | if (!poly1305aes_verify(out,kr,n,m,len)) { 31 | printf("poly1305aes_verify failed\n"); 32 | return 1; 33 | } 34 | x = random() & 15; 35 | y = 1 + (random() % 255); 36 | out[x] += y; 37 | if (poly1305aes_verify(out,kr,n,m,len)) { 38 | printf("poly1305aes_verify succeeded on bad input\n"); 39 | return 1; 40 | } 41 | out[x] -= y; 42 | if (len >= MAXLEN) break; 43 | n[0] ^= loop; 44 | for (i = 0;i < 16;++i) n[i] ^= out[i]; 45 | if (len % 2) for (i = 0;i < 16;++i) kr[i] ^= out[i]; 46 | if (len % 3) for (i = 0;i < 16;++i) kr[i + 16] ^= out[i]; 47 | poly1305aes_clamp(kr); 48 | m[len++] ^= out[0]; 49 | } 50 | } 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_53_constants.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305_53_constants.c version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | const double poly1305_53_constants[] = { 8 | 0.00000000558793544769287109375 /* alpham80 = 3 2^(-29) */ 9 | , 24.0 /* alpham48 = 3 2^3 */ 10 | , 103079215104.0 /* alpham16 = 3 2^35 */ 11 | , 6755399441055744.0 /* alpha0 = 3 2^51 */ 12 | , 1770887431076116955136.0 /* alpha18 = 3 2^69 */ 13 | , 29014219670751100192948224.0 /* alpha32 = 3 2^83 */ 14 | , 7605903601369376408980219232256.0 /* alpha50 = 3 2^101 */ 15 | , 124615124604835863084731911901282304.0 /* alpha64 = 3 2^115 */ 16 | , 32667107224410092492483962313449748299776.0 /* alpha82 = 3 2^133 */ 17 | , 535217884764734955396857238543560676143529984.0 /* alpha96 = 3 2^147 */ 18 | , 35076039295941670036888435985190792471742381031424.0 /* alpha112 = 3 2^163 */ 19 | , 9194973245195333150150082162901855101712434733101613056.0 /* alpha130 = 3 2^181 */ 20 | , 0.0000000000000000000000000000000000000036734198463196484624023016788195177431833298649127735047148490821200539357960224151611328125 /* scale = 5 2^(-130) */ 21 | , 6755408030990331.0 /* offset0 = alpha0 + 2^33 - 5 */ 22 | , 29014256564239239022116864.0 /* offset1 = alpha32 + 2^65 - 2^33 */ 23 | , 124615283061160854719918951570079744.0 /* offset2 = alpha64 + 2^97 - 2^65 */ 24 | , 535219245894202480694386063513315216128475136.0 /* offset3 = alpha96 + 2^130 - 2^97 */ 25 | } ; 26 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_aix_constants.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305_aix_constants.c version 20050205 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | const double poly1305_aix_constants[] = { 8 | 0.00000000558793544769287109375 /* alpham80 = 3 2^(-29) */ 9 | , 24.0 /* alpham48 = 3 2^3 */ 10 | , 103079215104.0 /* alpham16 = 3 2^35 */ 11 | , 6755399441055744.0 /* alpha0 = 3 2^51 */ 12 | , 1770887431076116955136.0 /* alpha18 = 3 2^69 */ 13 | , 29014219670751100192948224.0 /* alpha32 = 3 2^83 */ 14 | , 7605903601369376408980219232256.0 /* alpha50 = 3 2^101 */ 15 | , 124615124604835863084731911901282304.0 /* alpha64 = 3 2^115 */ 16 | , 32667107224410092492483962313449748299776.0 /* alpha82 = 3 2^133 */ 17 | , 535217884764734955396857238543560676143529984.0 /* alpha96 = 3 2^147 */ 18 | , 35076039295941670036888435985190792471742381031424.0 /* alpha112 = 3 2^163 */ 19 | , 9194973245195333150150082162901855101712434733101613056.0 /* alpha130 = 3 2^181 */ 20 | , 0.0000000000000000000000000000000000000036734198463196484624023016788195177431833298649127735047148490821200539357960224151611328125 /* scale = 5 2^(-130) */ 21 | , 6755408030990331.0 /* offset0 = alpha0 + 2^33 - 5 */ 22 | , 29014256564239239022116864.0 /* offset1 = alpha32 + 2^65 - 2^33 */ 23 | , 124615283061160854719918951570079744.0 /* offset2 = alpha64 + 2^97 - 2^65 */ 24 | , 535219245894202480694386063513315216128475136.0 /* offset3 = alpha96 + 2^130 - 2^97 */ 25 | } ; 26 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_sparc_constants.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305_sparc_constants.c version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | const double poly1305_sparc_constants[] = { 8 | 0.00000000558793544769287109375 /* alpham80 = 3 2^(-29) */ 9 | , 24.0 /* alpham48 = 3 2^3 */ 10 | , 103079215104.0 /* alpham16 = 3 2^35 */ 11 | , 6755399441055744.0 /* alpha0 = 3 2^51 */ 12 | , 1770887431076116955136.0 /* alpha18 = 3 2^69 */ 13 | , 29014219670751100192948224.0 /* alpha32 = 3 2^83 */ 14 | , 7605903601369376408980219232256.0 /* alpha50 = 3 2^101 */ 15 | , 124615124604835863084731911901282304.0 /* alpha64 = 3 2^115 */ 16 | , 32667107224410092492483962313449748299776.0 /* alpha82 = 3 2^133 */ 17 | , 535217884764734955396857238543560676143529984.0 /* alpha96 = 3 2^147 */ 18 | , 35076039295941670036888435985190792471742381031424.0 /* alpha112 = 3 2^163 */ 19 | , 9194973245195333150150082162901855101712434733101613056.0 /* alpha130 = 3 2^181 */ 20 | , 0.0000000000000000000000000000000000000036734198463196484624023016788195177431833298649127735047148490821200539357960224151611328125 /* scale = 5 2^(-130) */ 21 | , 6755408030990331.0 /* offset0 = alpha0 + 2^33 - 5 */ 22 | , 29014256564239239022116864.0 /* offset1 = alpha32 + 2^65 - 2^33 */ 23 | , 124615283061160854719918951570079744.0 /* offset2 = alpha64 + 2^97 - 2^65 */ 24 | , 535219245894202480694386063513315216128475136.0 /* offset3 = alpha96 + 2^130 - 2^97 */ 25 | } ; 26 | -------------------------------------------------------------------------------- /rebar.config: -------------------------------------------------------------------------------- 1 | {cover_enabled, true}. 2 | 3 | {erl_opts, [warnings_as_errors]}. 4 | 5 | {deps, [ 6 | {hex, ".*", {git, "git://github.com/b/hex", "HEAD"}} 7 | ]}. 8 | 9 | {port_specs, [ 10 | {"priv/poly1305aes_nifs.so", ["c_src/*.c"]} 11 | ]}. 12 | 13 | {port_env, [ 14 | {"CFLAGS", "$CFLAGS -fPIC"}, 15 | {"DRV_CFLAGS", "$DRV_CFLAGS -Werror -I c_src/poly1305aes"}, 16 | {"DRV_LDFLAGS", "$DRV_LDFLAGS c_src/poly1305aes/poly1305aes.a"}, 17 | 18 | %% Make sure to link -lstdc++ on linux or solaris 19 | {"(linux|solaris)", "CXXFLAGS", "-O2"}, 20 | {"(linux|solaris)", "LDFLAGS", "$LDFLAGS -lstdc++"}, 21 | 22 | %% OS X Leopard flags for 64-bit 23 | {"darwin9\.*-64-unix", "CXXFLAGS", "-O2 -m64"}, 24 | {"darwin9\.*-64-unix", "LDFLAGS", "-arch x86_64 -lstdc++"}, 25 | 26 | %% OS X Snow Leopard flags for 32-bit 27 | {"darwin1?\.*-32-unix", "CXXFLAGS", "-O2 -m32"}, 28 | {"darwin1?\.*-32-unix", "LDFLAGS", "-arch i386"}, 29 | 30 | %% OS X Snow Leopard/Lion flags for 64-bit 31 | {"darwin1?\.*-64-unix", "CXXFLAGS", "-O2 -m64"}, 32 | {"darwin1?\.*-64-unix", "LDFLAGS", "-arch x86_64"} 33 | ]}. 34 | 35 | {pre_hooks, [{compile, "make -C c_src/poly1305aes poly1305aes"}]}. 36 | 37 | {post_hooks, [{clean, "make -C c_src/poly1305aes clean"}]}. 38 | 39 | -------------------------------------------------------------------------------- /c_src/poly1305aes/FILES.lib: -------------------------------------------------------------------------------- 1 | poly1305aes.a.do 2 | poly1305aes.h.do 3 | poly1305.h.do 4 | aes.h.do 5 | poly1305aes.impl.do 6 | poly1305aes.impl.check.c 7 | x86cpuid.c 8 | poly1305aes_53.h 9 | poly1305aes_53_authenticate.c 10 | poly1305aes_53_clamp.c 11 | poly1305aes_53_isequal.c 12 | poly1305aes_53_verify.c 13 | poly1305aes_aix.h 14 | poly1305aes_aix_authenticate.c 15 | poly1305aes_aix_clamp.c 16 | poly1305aes_aix_isequal.s 17 | poly1305aes_aix_verify.c 18 | poly1305aes_athlon.h 19 | poly1305aes_athlon_authenticate.c 20 | poly1305aes_athlon_clamp.c 21 | poly1305aes_athlon_isequal.s 22 | poly1305aes_athlon_verify.c 23 | poly1305aes_macos.h 24 | poly1305aes_macos_authenticate.c 25 | poly1305aes_macos_clamp.c 26 | poly1305aes_macos_isequal.s 27 | poly1305aes_macos_verify.c 28 | poly1305aes_ppro.h 29 | poly1305aes_ppro_authenticate.c 30 | poly1305aes_ppro_clamp.c 31 | poly1305aes_ppro_isequal.s 32 | poly1305aes_ppro_verify.c 33 | poly1305aes_sparc.h 34 | poly1305aes_sparc_authenticate.c 35 | poly1305aes_sparc_clamp.s 36 | poly1305aes_sparc_fsr.s 37 | poly1305aes_sparc_isequal.s 38 | poly1305aes_sparc_verify.c 39 | poly1305_53.c 40 | poly1305_53.h 41 | poly1305_53_constants.c 42 | poly1305_aix.h 43 | poly1305_aix.s 44 | poly1305_aix_constants.c 45 | poly1305_athlon.h 46 | poly1305_athlon.s 47 | poly1305_athlon_constants.s 48 | poly1305_macos.h 49 | poly1305_macos.s 50 | poly1305_macos_constants.s 51 | poly1305_ppro.h 52 | poly1305_ppro.s 53 | poly1305_ppro_constants.s 54 | poly1305_sparc.h 55 | poly1305_sparc.s 56 | poly1305_sparc_constants.c 57 | aes_aix.h 58 | aes_aix.s 59 | aes_aix_constants.s 60 | aes_big.h 61 | aes_big.c 62 | aes_big_constants.c 63 | aes_athlon.h 64 | aes_athlon.s 65 | aes_athlon_constants.s 66 | aes_macos.h 67 | aes_macos.s 68 | aes_macos_constants.s 69 | aes_ppro.h 70 | aes_ppro.s 71 | aes_ppro_constants.s 72 | aes_sparc.h 73 | aes_sparc.s 74 | aes_sparc_constants.c 75 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_ppro_constants.s: -------------------------------------------------------------------------------- 1 | # poly1305_ppro_constants.s version 20050213 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .data 6 | .section .rodata 7 | .p2align 5 8 | 9 | .globl _poly1305_ppro_constants 10 | .globl poly1305_ppro_constants 11 | .globl poly1305_ppro_scale 12 | .globl poly1305_ppro_two32 13 | .globl poly1305_ppro_two64 14 | .globl poly1305_ppro_two96 15 | .globl poly1305_ppro_alpha32 16 | .globl poly1305_ppro_alpha64 17 | .globl poly1305_ppro_alpha96 18 | .globl poly1305_ppro_alpha130 19 | .globl poly1305_ppro_doffset0 20 | .globl poly1305_ppro_doffset1 21 | .globl poly1305_ppro_doffset2 22 | .globl poly1305_ppro_doffset3 23 | .globl poly1305_ppro_doffset3minustwo128 24 | .globl poly1305_ppro_hoffset0 25 | .globl poly1305_ppro_hoffset1 26 | .globl poly1305_ppro_hoffset2 27 | .globl poly1305_ppro_hoffset3 28 | .globl poly1305_ppro_rounding 29 | 30 | _poly1305_ppro_constants: 31 | poly1305_ppro_constants: 32 | poly1305_ppro_scale: 33 | .long 0x0,0x37f40000 34 | 35 | poly1305_ppro_two32: 36 | .long 0x0,0x41f00000 37 | 38 | poly1305_ppro_two64: 39 | .long 0x0,0x43f00000 40 | 41 | poly1305_ppro_two96: 42 | .long 0x0,0x45f00000 43 | 44 | poly1305_ppro_alpha32: 45 | .long 0x0,0x45e80000 46 | 47 | poly1305_ppro_alpha64: 48 | .long 0x0,0x47e80000 49 | 50 | poly1305_ppro_alpha96: 51 | .long 0x0,0x49e80000 52 | 53 | poly1305_ppro_alpha130: 54 | .long 0x0,0x4c080000 55 | 56 | poly1305_ppro_doffset0: 57 | .long 0x0,0x43300000 58 | 59 | poly1305_ppro_doffset1: 60 | .long 0x0,0x45300000 61 | 62 | poly1305_ppro_doffset2: 63 | .long 0x0,0x47300000 64 | 65 | poly1305_ppro_doffset3: 66 | .long 0x0,0x49300000 67 | 68 | poly1305_ppro_doffset3minustwo128: 69 | .long 0x0,0x492ffffe 70 | 71 | poly1305_ppro_hoffset0: 72 | .long 0xfffffffb,0x43300001 73 | 74 | poly1305_ppro_hoffset1: 75 | .long 0xfffffffe,0x45300001 76 | 77 | poly1305_ppro_hoffset2: 78 | .long 0xfffffffe,0x47300001 79 | 80 | poly1305_ppro_hoffset3: 81 | .long 0xfffffffe,0x49300003 82 | 83 | poly1305_ppro_rounding: 84 | .byte 0x7f 85 | .byte 0x13 86 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305_athlon_constants.s: -------------------------------------------------------------------------------- 1 | # poly1305_athlon_constants.s version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .data 6 | .section .rodata 7 | .p2align 5 8 | 9 | .globl _poly1305_athlon_constants 10 | .globl poly1305_athlon_constants 11 | .globl poly1305_athlon_scale 12 | .globl poly1305_athlon_two32 13 | .globl poly1305_athlon_two64 14 | .globl poly1305_athlon_two96 15 | .globl poly1305_athlon_alpha32 16 | .globl poly1305_athlon_alpha64 17 | .globl poly1305_athlon_alpha96 18 | .globl poly1305_athlon_alpha130 19 | .globl poly1305_athlon_doffset0 20 | .globl poly1305_athlon_doffset1 21 | .globl poly1305_athlon_doffset2 22 | .globl poly1305_athlon_doffset3 23 | .globl poly1305_athlon_doffset3minustwo128 24 | .globl poly1305_athlon_hoffset0 25 | .globl poly1305_athlon_hoffset1 26 | .globl poly1305_athlon_hoffset2 27 | .globl poly1305_athlon_hoffset3 28 | .globl poly1305_athlon_rounding 29 | 30 | _poly1305_athlon_constants: 31 | poly1305_athlon_constants: 32 | poly1305_athlon_scale: 33 | .long 0x0,0x37f40000 34 | 35 | poly1305_athlon_two32: 36 | .long 0x0,0x41f00000 37 | 38 | poly1305_athlon_two64: 39 | .long 0x0,0x43f00000 40 | 41 | poly1305_athlon_two96: 42 | .long 0x0,0x45f00000 43 | 44 | poly1305_athlon_alpha32: 45 | .long 0x0,0x45e80000 46 | 47 | poly1305_athlon_alpha64: 48 | .long 0x0,0x47e80000 49 | 50 | poly1305_athlon_alpha96: 51 | .long 0x0,0x49e80000 52 | 53 | poly1305_athlon_alpha130: 54 | .long 0x0,0x4c080000 55 | 56 | poly1305_athlon_doffset0: 57 | .long 0x0,0x43300000 58 | 59 | poly1305_athlon_doffset1: 60 | .long 0x0,0x45300000 61 | 62 | poly1305_athlon_doffset2: 63 | .long 0x0,0x47300000 64 | 65 | poly1305_athlon_doffset3: 66 | .long 0x0,0x49300000 67 | 68 | poly1305_athlon_doffset3minustwo128: 69 | .long 0x0,0x492ffffe 70 | 71 | poly1305_athlon_hoffset0: 72 | .long 0xfffffffb,0x43300001 73 | 74 | poly1305_athlon_hoffset1: 75 | .long 0xfffffffe,0x45300001 76 | 77 | poly1305_athlon_hoffset2: 78 | .long 0xfffffffe,0x47300001 79 | 80 | poly1305_athlon_hoffset3: 81 | .long 0xfffffffe,0x49300003 82 | 83 | poly1305_athlon_rounding: 84 | .byte 0x7f 85 | .byte 0x13 86 | -------------------------------------------------------------------------------- /c_src/poly1305aes/FILES: -------------------------------------------------------------------------------- 1 | FILES 2 | FILES.lib 3 | Makefile 4 | Makefile.lib 5 | test-poly1305aes.c 6 | test-aes.c 7 | poly1305aes-speed.c 8 | speedreport.do 9 | cpucycles.a.do 10 | cpucycles.h.do 11 | cpucycles_aix.h 12 | cpucycles_aix.s 13 | cpucycles_athlon.h 14 | cpucycles_athlon.s 15 | cpucycles_macos.h 16 | cpucycles_macos.s 17 | cpucycles_ppro.h 18 | cpucycles_ppro.s 19 | cpucycles_sparc.h 20 | cpucycles_sparc.s 21 | cpucycles_zero.c 22 | cpucycles_zero.h 23 | poly1305aes.a.do 24 | poly1305aes.h.do 25 | poly1305.h.do 26 | aes.h.do 27 | poly1305aes.impl.do 28 | poly1305aes.impl.check.c 29 | x86cpuid.c 30 | poly1305aes_53.h 31 | poly1305aes_53_authenticate.c 32 | poly1305aes_53_clamp.c 33 | poly1305aes_53_isequal.c 34 | poly1305aes_53_verify.c 35 | poly1305aes_aix.h 36 | poly1305aes_aix_authenticate.c 37 | poly1305aes_aix_clamp.c 38 | poly1305aes_aix_isequal.s 39 | poly1305aes_aix_verify.c 40 | poly1305aes_athlon.h 41 | poly1305aes_athlon_authenticate.c 42 | poly1305aes_athlon_clamp.c 43 | poly1305aes_athlon_isequal.s 44 | poly1305aes_athlon_verify.c 45 | poly1305aes_macos.h 46 | poly1305aes_macos_authenticate.c 47 | poly1305aes_macos_clamp.c 48 | poly1305aes_macos_isequal.s 49 | poly1305aes_macos_verify.c 50 | poly1305aes_ppro.h 51 | poly1305aes_ppro_authenticate.c 52 | poly1305aes_ppro_clamp.c 53 | poly1305aes_ppro_isequal.s 54 | poly1305aes_ppro_verify.c 55 | poly1305aes_sparc.h 56 | poly1305aes_sparc_authenticate.c 57 | poly1305aes_sparc_clamp.s 58 | poly1305aes_sparc_fsr.s 59 | poly1305aes_sparc_isequal.s 60 | poly1305aes_sparc_verify.c 61 | poly1305_53.c 62 | poly1305_53.h 63 | poly1305_53_constants.c 64 | poly1305_aix.h 65 | poly1305_aix.s 66 | poly1305_aix_constants.c 67 | poly1305_athlon.h 68 | poly1305_athlon.s 69 | poly1305_athlon_constants.s 70 | poly1305_macos.h 71 | poly1305_macos.s 72 | poly1305_macos_constants.s 73 | poly1305_ppro.h 74 | poly1305_ppro.s 75 | poly1305_ppro_constants.s 76 | poly1305_sparc.h 77 | poly1305_sparc.s 78 | poly1305_sparc_constants.c 79 | aes_aix.h 80 | aes_aix.s 81 | aes_aix_constants.s 82 | aes_big.h 83 | aes_big.c 84 | aes_big_constants.c 85 | aes_athlon.h 86 | aes_athlon.s 87 | aes_athlon_constants.s 88 | aes_macos.h 89 | aes_macos.s 90 | aes_macos_constants.s 91 | aes_ppro.h 92 | aes_ppro.s 93 | aes_ppro_constants.s 94 | aes_sparc.h 95 | aes_sparc.s 96 | aes_sparc_constants.c 97 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_53_isequal.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes_53_isequal.c version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "poly1305aes_53.h" 8 | 9 | #define uchar unsigned char 10 | #define uint32 unsigned int 11 | 12 | int poly1305aes_53_isequal(const unsigned char x[16], 13 | const unsigned char y[16]) 14 | { 15 | register uint32 d; 16 | register uint32 x0; 17 | register uint32 x1; 18 | register uint32 x2; 19 | register uint32 x3; 20 | register uint32 x4; 21 | register uint32 x5; 22 | register uint32 x6; 23 | register uint32 x7; 24 | register uint32 x8; 25 | register uint32 x9; 26 | register uint32 x10; 27 | register uint32 x11; 28 | register uint32 x12; 29 | register uint32 x13; 30 | register uint32 x14; 31 | register uint32 x15; 32 | register uint32 y0; 33 | register uint32 y1; 34 | register uint32 y2; 35 | register uint32 y3; 36 | register uint32 y4; 37 | register uint32 y5; 38 | register uint32 y6; 39 | register uint32 y7; 40 | register uint32 y8; 41 | register uint32 y9; 42 | register uint32 y10; 43 | register uint32 y11; 44 | register uint32 y12; 45 | register uint32 y13; 46 | register uint32 y14; 47 | register uint32 y15; 48 | 49 | x0 = *(uchar *) (x + 0); 50 | y0 = *(uchar *) (y + 0); 51 | x1 = *(uchar *) (x + 1); 52 | y1 = *(uchar *) (y + 1); 53 | x2 = *(uchar *) (x + 2); 54 | y2 = *(uchar *) (y + 2); 55 | d = y0 ^ x0; 56 | x3 = *(uchar *) (x + 3); 57 | y1 ^= x1; 58 | y3 = *(uchar *) (y + 3); 59 | d |= y1; 60 | x4 = *(uchar *) (x + 4); 61 | y2 ^= x2; 62 | y4 = *(uchar *) (y + 4); 63 | d |= y2; 64 | x5 = *(uchar *) (x + 5); 65 | y3 ^= x3; 66 | y5 = *(uchar *) (y + 5); 67 | d |= y3; 68 | x6 = *(uchar *) (x + 6); 69 | y4 ^= x4; 70 | y6 = *(uchar *) (y + 6); 71 | d |= y4; 72 | x7 = *(uchar *) (x + 7); 73 | y5 ^= x5; 74 | y7 = *(uchar *) (y + 7); 75 | d |= y5; 76 | x8 = *(uchar *) (x + 8); 77 | y6 ^= x6; 78 | y8 = *(uchar *) (y + 8); 79 | d |= y6; 80 | x9 = *(uchar *) (x + 9); 81 | y7 ^= x7; 82 | y9 = *(uchar *) (y + 9); 83 | d |= y7; 84 | x10 = *(uchar *) (x + 10); 85 | y8 ^= x8; 86 | y10 = *(uchar *) (y + 10); 87 | d |= y8; 88 | x11 = *(uchar *) (x + 11); 89 | y9 ^= x9; 90 | y11 = *(uchar *) (y + 11); 91 | d |= y9; 92 | x12 = *(uchar *) (x + 12); 93 | y10 ^= x10; 94 | y12 = *(uchar *) (y + 12); 95 | d |= y10; 96 | x13 = *(uchar *) (x + 13); 97 | y11 ^= x11; 98 | y13 = *(uchar *) (y + 13); 99 | d |= y11; 100 | x14 = *(uchar *) (x + 14); 101 | y12 ^= x12; 102 | y14 = *(uchar *) (y + 14); 103 | d |= y12; 104 | x15 = *(uchar *) (x + 15); 105 | y13 ^= x13; 106 | y15 = *(uchar *) (y + 15); 107 | d |= y13; 108 | y14 ^= x14; 109 | d |= y14; 110 | y15 ^= x15; 111 | d |= y15; 112 | d -= 1; 113 | d >>= 8; 114 | 115 | return d; 116 | } 117 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes.impl.do: -------------------------------------------------------------------------------- 1 | # poly1305aes.impl.do version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | echo '#include "poly1305aes_athlon.h"' > poly1305aes.impl.check.h 6 | if gcc -o x86cpuid x86cpuid.c >/dev/null 2>&1 \ 7 | && ./x86cpuid > x86cpuid.out \ 8 | && grep '^AuthenticAMD' x86cpuid.out >/dev/null 2>&1 \ 9 | && $* -o poly1305aes.impl.check poly1305aes.impl.check.c \ 10 | aes_athlon.s aes_athlon_constants.s \ 11 | poly1305_athlon.s poly1305_athlon_constants.s \ 12 | poly1305aes_athlon_authenticate.c poly1305aes_athlon_verify.c \ 13 | poly1305aes_athlon_clamp.c poly1305aes_athlon_isequal.s >/dev/null 2>&1 \ 14 | && ./poly1305aes.impl.check 15 | then 16 | echo athlon 17 | exit 0 18 | fi 19 | 20 | echo '#include "poly1305aes_ppro.h"' > poly1305aes.impl.check.h 21 | if $* -o poly1305aes.impl.check poly1305aes.impl.check.c \ 22 | aes_ppro.s aes_ppro_constants.s \ 23 | poly1305_ppro.s poly1305_ppro_constants.s \ 24 | poly1305aes_ppro_authenticate.c poly1305aes_ppro_verify.c \ 25 | poly1305aes_ppro_clamp.c poly1305aes_ppro_isequal.s >/dev/null 2>&1 \ 26 | && ./poly1305aes.impl.check 27 | then 28 | echo ppro 29 | exit 0 30 | fi 31 | 32 | echo '#include "poly1305aes_macos.h"' > poly1305aes.impl.check.h 33 | if $* -o poly1305aes.impl.check poly1305aes.impl.check.c \ 34 | aes_macos.s aes_macos_constants.s \ 35 | poly1305_macos.s poly1305_macos_constants.s \ 36 | poly1305aes_macos_authenticate.c poly1305aes_macos_verify.c \ 37 | poly1305aes_macos_clamp.c poly1305aes_macos_isequal.s >/dev/null 2>&1 \ 38 | && ./poly1305aes.impl.check 39 | then 40 | echo macos 41 | exit 0 42 | fi 43 | 44 | echo '#include "poly1305aes_aix.h"' > poly1305aes.impl.check.h 45 | if $* -o poly1305aes.impl.check poly1305aes.impl.check.c \ 46 | aes_aix.s aes_aix_constants.s \ 47 | poly1305_aix.s poly1305_aix_constants.c \ 48 | poly1305aes_aix_authenticate.c poly1305aes_aix_verify.c \ 49 | poly1305aes_aix_clamp.c poly1305aes_aix_isequal.s >/dev/null 2>&1 \ 50 | && ./poly1305aes.impl.check 51 | then 52 | echo aix 53 | exit 0 54 | fi 55 | 56 | echo '#include "poly1305aes_sparc.h"' > poly1305aes.impl.check.h 57 | if $* -o poly1305aes.impl.check poly1305aes.impl.check.c \ 58 | aes_sparc.s aes_sparc_constants.c \ 59 | poly1305_sparc.s poly1305_sparc_constants.c \ 60 | poly1305aes_sparc_authenticate.c poly1305aes_sparc_verify.c \ 61 | poly1305aes_sparc_clamp.s poly1305aes_sparc_isequal.s \ 62 | poly1305aes_sparc_fsr.s >/dev/null 2>&1 \ 63 | && ./poly1305aes.impl.check 64 | then 65 | echo sparc 66 | exit 0 67 | fi 68 | 69 | echo '#include "poly1305aes_53.h"' > poly1305aes.impl.check.h 70 | if $* -o poly1305aes.impl.check poly1305aes.impl.check.c \ 71 | aes_big.c aes_big_constants.c \ 72 | poly1305_53.c poly1305_53_constants.c \ 73 | poly1305aes_53_authenticate.c poly1305aes_53_verify.c \ 74 | poly1305aes_53_clamp.c poly1305aes_53_isequal.c >/dev/null 2>&1 \ 75 | && ./poly1305aes.impl.check 76 | then 77 | echo 53 78 | exit 0 79 | fi 80 | 81 | echo 'poly1305aes.impl.do: fatal: all tests failed!' >&2 82 | exit 1 83 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes.a.do: -------------------------------------------------------------------------------- 1 | # poly1305aes.a.do version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | rm -f poly1305aestmp.a 6 | 7 | impl=`cat poly1305aes.impl` 8 | 9 | case ${impl} in 10 | 53) 11 | $* -c aes_big.c 12 | $* -c aes_big_constants.c 13 | $* -c poly1305_${impl}.c 14 | $* -c poly1305_${impl}_constants.c 15 | $* -c poly1305aes_${impl}_authenticate.c 16 | $* -c poly1305aes_${impl}_clamp.c 17 | $* -c poly1305aes_${impl}_isequal.c 18 | $* -c poly1305aes_${impl}_verify.c 19 | ar cr poly1305aestmp.a \ 20 | poly1305aes_${impl}_verify.o \ 21 | poly1305aes_${impl}_isequal.o \ 22 | poly1305aes_${impl}_clamp.o \ 23 | poly1305aes_${impl}_authenticate.o \ 24 | poly1305_${impl}.o \ 25 | poly1305_${impl}_constants.o \ 26 | aes_big.o \ 27 | aes_big_constants.o 28 | ;; 29 | aix) 30 | $* -c aes_${impl}.s 31 | $* -c aes_${impl}_constants.s 32 | $* -c poly1305_${impl}.s 33 | $* -c poly1305_${impl}_constants.c 34 | $* -c poly1305aes_${impl}_authenticate.c 35 | $* -c poly1305aes_${impl}_clamp.c 36 | $* -c poly1305aes_${impl}_isequal.s 37 | $* -c poly1305aes_${impl}_verify.c 38 | ar cr poly1305aestmp.a \ 39 | poly1305aes_${impl}_verify.o \ 40 | poly1305aes_${impl}_isequal.o \ 41 | poly1305aes_${impl}_clamp.o \ 42 | poly1305aes_${impl}_authenticate.o \ 43 | poly1305_${impl}.o \ 44 | poly1305_${impl}_constants.o \ 45 | aes_${impl}.o \ 46 | aes_${impl}_constants.o 47 | ;; 48 | athlon|macos|ppro) 49 | $* -c aes_${impl}.s 50 | $* -c aes_${impl}_constants.s 51 | $* -c poly1305_${impl}.s 52 | $* -c poly1305_${impl}_constants.s 53 | $* -c poly1305aes_${impl}_authenticate.c 54 | $* -c poly1305aes_${impl}_clamp.c 55 | $* -c poly1305aes_${impl}_isequal.s 56 | $* -c poly1305aes_${impl}_verify.c 57 | ar cr poly1305aestmp.a \ 58 | poly1305aes_${impl}_verify.o \ 59 | poly1305aes_${impl}_isequal.o \ 60 | poly1305aes_${impl}_clamp.o \ 61 | poly1305aes_${impl}_authenticate.o \ 62 | poly1305_${impl}.o \ 63 | poly1305_${impl}_constants.o \ 64 | aes_${impl}.o \ 65 | aes_${impl}_constants.o 66 | ;; 67 | sparc) 68 | $* -c aes_${impl}.s 69 | $* -c aes_${impl}_constants.c 70 | $* -c poly1305_${impl}.s 71 | $* -c poly1305_${impl}_constants.c 72 | $* -c poly1305aes_${impl}_authenticate.c 73 | $* -c poly1305aes_${impl}_clamp.s 74 | $* -c poly1305aes_${impl}_fsr.s 75 | $* -c poly1305aes_${impl}_isequal.s 76 | $* -c poly1305aes_${impl}_verify.c 77 | ar cr poly1305aestmp.a \ 78 | poly1305aes_${impl}_verify.o \ 79 | poly1305aes_${impl}_isequal.o \ 80 | poly1305aes_${impl}_clamp.o \ 81 | poly1305aes_${impl}_authenticate.o \ 82 | poly1305aes_${impl}_fsr.o \ 83 | poly1305_${impl}.o \ 84 | poly1305_${impl}_constants.o \ 85 | aes_${impl}.o \ 86 | aes_${impl}_constants.o 87 | ;; 88 | *) echo 'unknown implementation' >&2; exit 1 ;; 89 | esac 90 | 91 | ranlib poly1305aestmp.a >/dev/null 2>/dev/null || : 92 | cat poly1305aestmp.a 93 | rm poly1305aestmp.a 94 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_sparc_clamp.s: -------------------------------------------------------------------------------- 1 | # poly1305aes_sparc_clamp.s version 20050131 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | # translated by qhasm-sparc version 20050131 6 | 7 | # input line 1: register int64 kr 8 | 9 | # input line 2: register int64 r3 10 | 11 | # input line 3: register int64 r7 12 | 13 | # input line 4: register int64 r11 14 | 15 | # input line 5: register int64 r15 16 | 17 | # input line 6: register int64 r4 18 | 19 | # input line 7: register int64 r8 20 | 21 | # input line 8: register int64 r12 22 | 23 | # input line 9: 24 | 25 | # input line 10: enter poly1305aes_sparc_clamp 26 | .section ".text" 27 | .align 32 28 | .global poly1305aes_sparc_clamp 29 | poly1305aes_sparc_clamp: 30 | save %sp,-176,%sp 31 | 32 | # input line 11: input kr 33 | 34 | # input line 12: 35 | 36 | # input line 13: r3 = *(uchar *) (kr + 19) 37 | # r3!%l0 = *(uchar *) (kr!%i0 + 19) 38 | ldub [%i0+19],%l0 39 | # live registers: 2 int64, 0 double 40 | 41 | # input line 14: r7 = *(uchar *) (kr + 23) 42 | # r7!%l1 = *(uchar *) (kr!%i0 + 23) 43 | ldub [%i0+23],%l1 44 | # live registers: 3 int64, 0 double 45 | 46 | # input line 15: r11 = *(uchar *) (kr + 27) 47 | # r11!%l2 = *(uchar *) (kr!%i0 + 27) 48 | ldub [%i0+27],%l2 49 | # live registers: 4 int64, 0 double 50 | 51 | # input line 16: r15 = *(uchar *) (kr + 31) 52 | # r15!%l3 = *(uchar *) (kr!%i0 + 31) 53 | ldub [%i0+31],%l3 54 | # live registers: 5 int64, 0 double 55 | 56 | # input line 17: r4 = *(uchar *) (kr + 20) 57 | # r4!%l4 = *(uchar *) (kr!%i0 + 20) 58 | ldub [%i0+20],%l4 59 | # live registers: 6 int64, 0 double 60 | 61 | # input line 18: r8 = *(uchar *) (kr + 24) 62 | # r8!%l5 = *(uchar *) (kr!%i0 + 24) 63 | ldub [%i0+24],%l5 64 | # live registers: 7 int64, 0 double 65 | 66 | # input line 19: r12 = *(uchar *) (kr + 28) 67 | # r12!%l6 = *(uchar *) (kr!%i0 + 28) 68 | ldub [%i0+28],%l6 69 | # live registers: 8 int64, 0 double 70 | 71 | # input line 20: 72 | 73 | # input line 21: r3 &= 15 74 | # r3#2!%l0 = r3!%l0 & 15 75 | and %l0,15,%l0 76 | # live registers: 8 int64, 0 double 77 | 78 | # input line 22: *(uchar *) (kr + 19) = r3 79 | # *(uchar *) (kr!%i0 + 19) = r3#2!%l0 80 | stub %l0,[%i0+19] 81 | # live registers: 7 int64, 0 double 82 | 83 | # input line 23: r7 &= 15 84 | # r7#2!%l0 = r7!%l1 & 15 85 | and %l1,15,%l0 86 | # live registers: 7 int64, 0 double 87 | 88 | # input line 24: *(uchar *) (kr + 23) = r7 89 | # *(uchar *) (kr!%i0 + 23) = r7#2!%l0 90 | stub %l0,[%i0+23] 91 | # live registers: 6 int64, 0 double 92 | 93 | # input line 25: r11 &= 15 94 | # r11#2!%l0 = r11!%l2 & 15 95 | and %l2,15,%l0 96 | # live registers: 6 int64, 0 double 97 | 98 | # input line 26: *(uchar *) (kr + 27) = r11 99 | # *(uchar *) (kr!%i0 + 27) = r11#2!%l0 100 | stub %l0,[%i0+27] 101 | # live registers: 5 int64, 0 double 102 | 103 | # input line 27: r15 &= 15 104 | # r15#2!%l0 = r15!%l3 & 15 105 | and %l3,15,%l0 106 | # live registers: 5 int64, 0 double 107 | 108 | # input line 28: *(uchar *) (kr + 31) = r15 109 | # *(uchar *) (kr!%i0 + 31) = r15#2!%l0 110 | stub %l0,[%i0+31] 111 | # live registers: 4 int64, 0 double 112 | 113 | # input line 29: r4 &= 252 114 | # r4#2!%l0 = r4!%l4 & 252 115 | and %l4,252,%l0 116 | # live registers: 4 int64, 0 double 117 | 118 | # input line 30: *(uchar *) (kr + 20) = r4 119 | # *(uchar *) (kr!%i0 + 20) = r4#2!%l0 120 | stub %l0,[%i0+20] 121 | # live registers: 3 int64, 0 double 122 | 123 | # input line 31: r8 &= 252 124 | # r8#2!%l0 = r8!%l5 & 252 125 | and %l5,252,%l0 126 | # live registers: 3 int64, 0 double 127 | 128 | # input line 32: *(uchar *) (kr + 24) = r8 129 | # *(uchar *) (kr!%i0 + 24) = r8#2!%l0 130 | stub %l0,[%i0+24] 131 | # live registers: 2 int64, 0 double 132 | 133 | # input line 33: r12 &= 252 134 | # r12#2!%l0 = r12!%l6 & 252 135 | and %l6,252,%l0 136 | # live registers: 2 int64, 0 double 137 | 138 | # input line 34: *(uchar *) (kr + 28) = r12 139 | # *(uchar *) (kr!%i0 + 28) = r12#2!%l0 140 | stub %l0,[%i0+28] 141 | # live registers: 0 int64, 0 double 142 | 143 | # input line 35: 144 | 145 | # input line 36: leave 146 | ret 147 | restore 148 | -------------------------------------------------------------------------------- /c_src/poly1305aes_nifs.c: -------------------------------------------------------------------------------- 1 | #include "erl_nif.h" 2 | #include "poly1305aes/poly1305aes.h" 3 | 4 | #define AN_GIGABYTE 1000000000 5 | 6 | // Prototypes 7 | ERL_NIF_TERM poly1305_aes_clamp(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); 8 | ERL_NIF_TERM poly1305_aes_authenticate(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); 9 | ERL_NIF_TERM poly1305_aes_verify(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); 10 | 11 | // lifecycle 12 | int load(ErlNifEnv* env, void ** priv_data, ERL_NIF_TERM load_info); 13 | int reload(ErlNifEnv* env, void** priv, ERL_NIF_TERM load_info); 14 | int upgrade(ErlNifEnv* env, void** priv, void** old_priv, ERL_NIF_TERM load_info); 15 | void unload(ErlNifEnv* env, void* priv); 16 | 17 | static ErlNifFunc nif_funcs[] = 18 | { 19 | {"clamp", 1, poly1305_aes_clamp}, 20 | {"authenticate", 3, poly1305_aes_authenticate}, 21 | {"verify", 4, poly1305_aes_verify} 22 | }; 23 | 24 | ERL_NIF_INIT(poly1305aes, nif_funcs, load, NULL, NULL, NULL); 25 | 26 | int load(ErlNifEnv* env, void ** priv_data, ERL_NIF_TERM load_info) 27 | { 28 | return 0; 29 | } 30 | 31 | int reload(ErlNifEnv* env, void** priv, ERL_NIF_TERM load_info) 32 | { 33 | return 0; 34 | } 35 | 36 | int upgrade(ErlNifEnv* env, void** priv, void** old_priv, ERL_NIF_TERM load_info) 37 | { 38 | return 0; 39 | } 40 | 41 | void unload(ErlNifEnv* env, void* priv) 42 | { 43 | return; 44 | } 45 | 46 | ERL_NIF_TERM poly1305_aes_clamp(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) 47 | { 48 | ErlNifBinary kr; 49 | enif_inspect_binary(env, argv[0], &kr); 50 | 51 | if (kr.size != 32) 52 | { 53 | return enif_make_tuple2(env, enif_make_atom(env, "error"), enif_make_atom(env, "invalid_key")); 54 | } 55 | 56 | poly1305aes_clamp(kr.data); 57 | 58 | return enif_make_tuple2(env, enif_make_atom(env, "ok"), enif_make_binary(env, &kr)); 59 | } 60 | 61 | ERL_NIF_TERM poly1305_aes_authenticate(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) 62 | { 63 | ErlNifBinary out, kr, n, m; 64 | 65 | enif_inspect_binary(env, argv[0], &kr); 66 | if (kr.size != 32) 67 | { 68 | return enif_make_tuple2(env, enif_make_atom(env, "error"), enif_make_atom(env, "invalid_key")); 69 | } 70 | 71 | enif_inspect_binary(env, argv[1], &n); 72 | if (n.size != 16) 73 | { 74 | return enif_make_tuple2(env, enif_make_atom(env, "error"), enif_make_atom(env, "invalid_nonce")); 75 | } 76 | 77 | enif_inspect_binary(env, argv[2], &m); 78 | if (m.size > AN_GIGABYTE) 79 | { 80 | return enif_make_tuple2(env, enif_make_atom(env, "error"), enif_make_atom(env, "too_much_data")); 81 | } 82 | 83 | if (!enif_alloc_binary(16, &out)) 84 | { 85 | return enif_make_tuple2(env, enif_make_atom(env, "error"), enif_make_atom(env, "authenticator_alloc_failed")); 86 | } 87 | 88 | poly1305aes_authenticate(out.data, kr.data, n.data, m.data, m.size); 89 | 90 | return enif_make_tuple2(env, enif_make_atom(env, "ok"), enif_make_binary(env, &out)); 91 | } 92 | 93 | ERL_NIF_TERM poly1305_aes_verify(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) 94 | { 95 | ErlNifBinary a, kr, n, m; 96 | 97 | enif_inspect_binary(env, argv[0], &a); 98 | if (a.size != 16) 99 | { 100 | return enif_make_tuple2(env, enif_make_atom(env, "error"), enif_make_atom(env, "invalid_authenticator")); 101 | } 102 | 103 | enif_inspect_binary(env, argv[1], &kr); 104 | if (kr.size != 32) 105 | { 106 | return enif_make_tuple2(env, enif_make_atom(env, "error"), enif_make_atom(env, "invalid_key")); 107 | } 108 | 109 | enif_inspect_binary(env, argv[2], &n); 110 | if (n.size != 16) 111 | { 112 | return enif_make_tuple2(env, enif_make_atom(env, "error"), enif_make_atom(env, "invalid_nonce")); 113 | } 114 | 115 | enif_inspect_binary(env, argv[3], &m); 116 | if (m.size > AN_GIGABYTE) 117 | { 118 | return enif_make_tuple2(env, enif_make_atom(env, "error"), enif_make_atom(env, "too_much_data")); 119 | } 120 | 121 | if (poly1305aes_verify(a.data, kr.data, n.data, m.data, m.size) == 0) 122 | { 123 | return enif_make_atom(env, "false"); 124 | } else { 125 | return enif_make_atom(env, "true"); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /c_src/poly1305aes/Makefile.lib: -------------------------------------------------------------------------------- 1 | 2 | # poly1305aes Makefile.lib version 20050218 3 | # D. J. Bernstein 4 | # Public domain. 5 | 6 | poly1305aes: poly1305aes.a poly1305aes.h poly1305.h aes.h 7 | 8 | poly1305aes.h: poly1305aes.impl \ 9 | poly1305aes.h.do 10 | sh -e poly1305aes.h.do > poly1305aes.h.new 11 | mv poly1305aes.h.new poly1305aes.h 12 | 13 | poly1305.h: poly1305aes.impl \ 14 | poly1305.h.do 15 | sh -e poly1305.h.do > poly1305.h.new 16 | mv poly1305.h.new poly1305.h 17 | 18 | aes.h: poly1305aes.impl \ 19 | aes.h.do 20 | sh -e aes.h.do > aes.h.new 21 | mv aes.h.new aes.h 22 | 23 | poly1305aes.a: poly1305aes.impl \ 24 | poly1305aes.a.do \ 25 | aes_aix.h \ 26 | aes_aix.s \ 27 | aes_aix_constants.s \ 28 | aes_athlon.h \ 29 | aes_athlon.s \ 30 | aes_athlon_constants.s \ 31 | aes_big.c \ 32 | aes_big.h \ 33 | aes_big_constants.c \ 34 | aes_macos.h \ 35 | aes_macos.s \ 36 | aes_macos_constants.s \ 37 | aes_ppro.h \ 38 | aes_ppro.s \ 39 | aes_ppro_constants.s \ 40 | aes_sparc.h \ 41 | aes_sparc.s \ 42 | aes_sparc_constants.c \ 43 | poly1305_53.c \ 44 | poly1305_53.h \ 45 | poly1305_53_constants.c \ 46 | poly1305_aix.h \ 47 | poly1305_aix.s \ 48 | poly1305_aix_constants.c \ 49 | poly1305_athlon.h \ 50 | poly1305_athlon.s \ 51 | poly1305_athlon_constants.s \ 52 | poly1305_macos.h \ 53 | poly1305_macos.s \ 54 | poly1305_macos_constants.s \ 55 | poly1305_ppro.h \ 56 | poly1305_ppro.s \ 57 | poly1305_ppro_constants.s \ 58 | poly1305_sparc.h \ 59 | poly1305_sparc.s \ 60 | poly1305_sparc_constants.c \ 61 | poly1305aes_53.h \ 62 | poly1305aes_53_authenticate.c \ 63 | poly1305aes_53_clamp.c \ 64 | poly1305aes_53_isequal.c \ 65 | poly1305aes_53_verify.c \ 66 | poly1305aes_aix.h \ 67 | poly1305aes_aix_authenticate.c \ 68 | poly1305aes_aix_clamp.c \ 69 | poly1305aes_aix_isequal.s \ 70 | poly1305aes_aix_verify.c \ 71 | poly1305aes_athlon.h \ 72 | poly1305aes_athlon_authenticate.c \ 73 | poly1305aes_athlon_clamp.c \ 74 | poly1305aes_athlon_isequal.s \ 75 | poly1305aes_athlon_verify.c \ 76 | poly1305aes_macos.h \ 77 | poly1305aes_macos_authenticate.c \ 78 | poly1305aes_macos_clamp.c \ 79 | poly1305aes_macos_isequal.s \ 80 | poly1305aes_macos_verify.c \ 81 | poly1305aes_ppro.h \ 82 | poly1305aes_ppro_authenticate.c \ 83 | poly1305aes_ppro_clamp.c \ 84 | poly1305aes_ppro_isequal.s \ 85 | poly1305aes_ppro_verify.c \ 86 | poly1305aes_sparc.h \ 87 | poly1305aes_sparc_authenticate.c \ 88 | poly1305aes_sparc_clamp.s \ 89 | poly1305aes_sparc_fsr.s \ 90 | poly1305aes_sparc_isequal.s \ 91 | poly1305aes_sparc_verify.c 92 | sh -e poly1305aes.a.do $(CC) > poly1305aes.a.new 93 | mv poly1305aes.a.new poly1305aes.a 94 | 95 | poly1305aes.impl: \ 96 | poly1305aes.impl.do \ 97 | x86cpuid.c \ 98 | poly1305aes.impl.check.c \ 99 | aes_aix.h \ 100 | aes_aix.s \ 101 | aes_aix_constants.s \ 102 | aes_athlon.h \ 103 | aes_athlon.s \ 104 | aes_athlon_constants.s \ 105 | aes_big.c \ 106 | aes_big.h \ 107 | aes_big_constants.c \ 108 | aes_macos.h \ 109 | aes_macos.s \ 110 | aes_macos_constants.s \ 111 | aes_ppro.h \ 112 | aes_ppro.s \ 113 | aes_ppro_constants.s \ 114 | aes_sparc.h \ 115 | aes_sparc.s \ 116 | aes_sparc_constants.c \ 117 | poly1305_53.c \ 118 | poly1305_53.h \ 119 | poly1305_53_constants.c \ 120 | poly1305_aix.h \ 121 | poly1305_aix.s \ 122 | poly1305_aix_constants.c \ 123 | poly1305_athlon.h \ 124 | poly1305_athlon.s \ 125 | poly1305_athlon_constants.s \ 126 | poly1305_macos.h \ 127 | poly1305_macos.s \ 128 | poly1305_macos_constants.s \ 129 | poly1305_ppro.h \ 130 | poly1305_ppro.s \ 131 | poly1305_ppro_constants.s \ 132 | poly1305_sparc.h \ 133 | poly1305_sparc.s \ 134 | poly1305_sparc_constants.c \ 135 | poly1305aes_53.h \ 136 | poly1305aes_53_authenticate.c \ 137 | poly1305aes_53_clamp.c \ 138 | poly1305aes_53_isequal.c \ 139 | poly1305aes_53_verify.c \ 140 | poly1305aes_aix.h \ 141 | poly1305aes_aix_authenticate.c \ 142 | poly1305aes_aix_clamp.c \ 143 | poly1305aes_aix_isequal.s \ 144 | poly1305aes_aix_verify.c \ 145 | poly1305aes_athlon.h \ 146 | poly1305aes_athlon_authenticate.c \ 147 | poly1305aes_athlon_clamp.c \ 148 | poly1305aes_athlon_isequal.s \ 149 | poly1305aes_athlon_verify.c \ 150 | poly1305aes_macos.h \ 151 | poly1305aes_macos_authenticate.c \ 152 | poly1305aes_macos_clamp.c \ 153 | poly1305aes_macos_isequal.s \ 154 | poly1305aes_macos_verify.c \ 155 | poly1305aes_ppro.h \ 156 | poly1305aes_ppro_authenticate.c \ 157 | poly1305aes_ppro_clamp.c \ 158 | poly1305aes_ppro_isequal.s \ 159 | poly1305aes_ppro_verify.c \ 160 | poly1305aes_sparc.h \ 161 | poly1305aes_sparc_authenticate.c \ 162 | poly1305aes_sparc_clamp.s \ 163 | poly1305aes_sparc_fsr.s \ 164 | poly1305aes_sparc_isequal.s \ 165 | poly1305aes_sparc_verify.c 166 | sh -e poly1305aes.impl.do $(CC) > poly1305aes.impl.new 167 | mv poly1305aes.impl.new poly1305aes.impl 168 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_ppro_isequal.s: -------------------------------------------------------------------------------- 1 | # poly1305aes_ppro_isequal.s version 20050213 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | # translated by qhasm-x86 version 20050213 6 | 7 | ## input line 1: register int32 x 8 | 9 | ## input line 2: register int32 y 10 | 11 | ## input line 3: register int32 d 12 | 13 | ## input line 4: register int32 x1 14 | 15 | ## input line 5: register int32 x2 16 | 17 | ## input line 6: register int32 x3 18 | 19 | ## input line 7: register int32 result 20 | 21 | ## input line 8: 22 | 23 | ## input line 9: enter poly1305aes_ppro_isequal 24 | .text 25 | .p2align 5 26 | .globl _poly1305aes_ppro_isequal 27 | .globl poly1305aes_ppro_isequal 28 | _poly1305aes_ppro_isequal: 29 | poly1305aes_ppro_isequal: 30 | sub $16,%esp 31 | ## live mem32 values: 2 32 | ## live int32 values: 4 33 | ## live flags values: 0 34 | 35 | ## input line 10: input x 36 | 37 | ## input line 11: input y 38 | 39 | ## input line 12: 40 | 41 | ## input line 13: store callerint ebx 42 | movl %ebx,0(%esp) 43 | ## live mem32 values: 3 44 | ## live int32 values: 3 45 | ## live flags values: 0 46 | 47 | ## input line 14: 48 | 49 | ## input line 15: load x 50 | movl 20(%esp),%eax 51 | ## live mem32 values: 2 52 | ## live int32 values: 4 53 | ## live flags values: 0 54 | 55 | ## input line 16: load y 56 | movl 24(%esp),%ecx 57 | ## live mem32 values: 1 58 | ## live int32 values: 5 59 | ## live flags values: 0 60 | 61 | ## input line 17: 62 | 63 | ## input line 18: d = *(uint32 *) (x + 0) 64 | ## d = *(uint32 *) (x + 0) 65 | ## int32#3 = *(uint32 *) (int32#1 + 0) 66 | ## %edx = *(uint32 *) (%eax + 0) 67 | movl 0(%eax),%edx 68 | ## live mem32 values: 1 69 | ## live int32 values: 6 70 | ## live flags values: 0 71 | 72 | ## input line 19: inplace d ^= *(uint32 *) (y + 0) 73 | ## d ^= *(uint32 *) (y + 0) 74 | ## int32#3 ^= *(uint32 *) (int32#2 + 0) 75 | ## %edx ^= *(uint32 *) (%ecx + 0) 76 | xorl 0(%ecx),%edx 77 | ## live mem32 values: 1 78 | ## live int32 values: 6 79 | ## live flags values: 0 80 | 81 | ## input line 20: 82 | 83 | ## input line 21: x1 = *(uint32 *) (x + 4) 84 | ## x1 = *(uint32 *) (x + 4) 85 | ## int32#4 = *(uint32 *) (int32#1 + 4) 86 | ## %ebx = *(uint32 *) (%eax + 4) 87 | movl 4(%eax),%ebx 88 | ## live mem32 values: 1 89 | ## live int32 values: 7 90 | ## live flags values: 0 91 | 92 | ## input line 22: inplace x1 ^= *(uint32 *) (y + 4) 93 | ## x1 ^= *(uint32 *) (y + 4) 94 | ## int32#4 ^= *(uint32 *) (int32#2 + 4) 95 | ## %ebx ^= *(uint32 *) (%ecx + 4) 96 | xorl 4(%ecx),%ebx 97 | ## live mem32 values: 1 98 | ## live int32 values: 7 99 | ## live flags values: 0 100 | 101 | ## input line 23: inplace d |= x1 102 | ## d |= x1 103 | ## int32#3 |= int32#4 104 | ## %edx |= %ebx 105 | or %ebx,%edx 106 | ## live mem32 values: 1 107 | ## live int32 values: 6 108 | ## live flags values: 0 109 | 110 | ## input line 24: 111 | 112 | ## input line 25: x2 = *(uint32 *) (x + 8) 113 | ## x2 = *(uint32 *) (x + 8) 114 | ## int32#4 = *(uint32 *) (int32#1 + 8) 115 | ## %ebx = *(uint32 *) (%eax + 8) 116 | movl 8(%eax),%ebx 117 | ## live mem32 values: 1 118 | ## live int32 values: 7 119 | ## live flags values: 0 120 | 121 | ## input line 26: inplace x2 ^= *(uint32 *) (y + 8) 122 | ## x2 ^= *(uint32 *) (y + 8) 123 | ## int32#4 ^= *(uint32 *) (int32#2 + 8) 124 | ## %ebx ^= *(uint32 *) (%ecx + 8) 125 | xorl 8(%ecx),%ebx 126 | ## live mem32 values: 1 127 | ## live int32 values: 7 128 | ## live flags values: 0 129 | 130 | ## input line 27: inplace d |= x2 131 | ## d |= x2 132 | ## int32#3 |= int32#4 133 | ## %edx |= %ebx 134 | or %ebx,%edx 135 | ## live mem32 values: 1 136 | ## live int32 values: 6 137 | ## live flags values: 0 138 | 139 | ## input line 28: 140 | 141 | ## input line 29: x3 = *(uint32 *) (x + 12) 142 | ## x3 = *(uint32 *) (x + 12) 143 | ## int32#1 = *(uint32 *) (int32#1 + 12) 144 | ## %eax = *(uint32 *) (%eax + 12) 145 | movl 12(%eax),%eax 146 | ## live mem32 values: 1 147 | ## live int32 values: 6 148 | ## live flags values: 0 149 | 150 | ## input line 30: inplace x3 ^= *(uint32 *) (y + 12) 151 | ## x3 ^= *(uint32 *) (y + 12) 152 | ## int32#1 ^= *(uint32 *) (int32#2 + 12) 153 | ## %eax ^= *(uint32 *) (%ecx + 12) 154 | xorl 12(%ecx),%eax 155 | ## live mem32 values: 1 156 | ## live int32 values: 5 157 | ## live flags values: 0 158 | 159 | ## input line 31: inplace d |= x3 160 | ## d |= x3 161 | ## int32#3 |= int32#1 162 | ## %edx |= %eax 163 | or %eax,%edx 164 | ## live mem32 values: 1 165 | ## live int32 values: 4 166 | ## live flags values: 0 167 | 168 | ## input line 32: 169 | 170 | ## input line 33: d -= 1 171 | ## d -= 1 172 | ## int32#3 -= 1 173 | ## %edx -= 1 174 | sub $1,%edx 175 | ## live mem32 values: 1 176 | ## live int32 values: 4 177 | ## live flags values: 1 178 | 179 | ## input line 34: 180 | 181 | ## input line 35: d += 1 182 | ## d += 1 183 | ## int32#3 += 1 184 | ## %edx += 1 185 | add $1,%edx 186 | ## live mem32 values: 1 187 | ## live int32 values: 3 188 | ## live flags values: 1 189 | 190 | ## input line 36: result = 0 191 | ## result = 0 192 | ## int32#1 = 0 193 | ## %eax = 0 194 | mov $0,%eax 195 | ## live mem32 values: 1 196 | ## live int32 values: 4 197 | ## live flags values: 1 198 | 199 | ## input line 37: 200 | 201 | ## input line 38: kill d 202 | 203 | ## input line 39: 204 | 205 | ## input line 40: carry result += result + carry 206 | ## carry result += result + carry 207 | ## carry int32#1 += int32#1 + carry 208 | ## carry %eax += %eax + carry 209 | adc %eax,%eax 210 | ## live mem32 values: 1 211 | ## live int32 values: 4 212 | ## live flags values: 0 213 | 214 | ## input line 41: 215 | 216 | ## input line 42: load callerint ebx 217 | movl 0(%esp),%ebx 218 | ## live mem32 values: 0 219 | ## live int32 values: 5 220 | ## live flags values: 0 221 | 222 | ## input line 43: 223 | 224 | ## input line 44: output result 225 | 226 | ## input line 45: leave 227 | add $16,%esp 228 | ret 229 | ## live mem32 values: 0 230 | ## live int32 values: 5 231 | ## live flags values: 0 232 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_athlon_isequal.s: -------------------------------------------------------------------------------- 1 | # poly1305aes_athlon_isequal.s version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | # translated by qhasm-x86 version 20050213 6 | 7 | ## input line 1: register int32 x 8 | 9 | ## input line 2: register int32 y 10 | 11 | ## input line 3: register int32 d 12 | 13 | ## input line 4: register int32 x1 14 | 15 | ## input line 5: register int32 x2 16 | 17 | ## input line 6: register int32 x3 18 | 19 | ## input line 7: register int32 result 20 | 21 | ## input line 8: 22 | 23 | ## input line 9: enter poly1305aes_athlon_isequal 24 | .text 25 | .p2align 5 26 | .globl _poly1305aes_athlon_isequal 27 | .globl poly1305aes_athlon_isequal 28 | _poly1305aes_athlon_isequal: 29 | poly1305aes_athlon_isequal: 30 | sub $16,%esp 31 | ## live mem32 values: 2 32 | ## live int32 values: 4 33 | ## live flags values: 0 34 | 35 | ## input line 10: input x 36 | 37 | ## input line 11: input y 38 | 39 | ## input line 12: 40 | 41 | ## input line 13: store callerint ebx 42 | movl %ebx,0(%esp) 43 | ## live mem32 values: 3 44 | ## live int32 values: 3 45 | ## live flags values: 0 46 | 47 | ## input line 14: 48 | 49 | ## input line 15: load x 50 | movl 20(%esp),%eax 51 | ## live mem32 values: 2 52 | ## live int32 values: 4 53 | ## live flags values: 0 54 | 55 | ## input line 16: load y 56 | movl 24(%esp),%ecx 57 | ## live mem32 values: 1 58 | ## live int32 values: 5 59 | ## live flags values: 0 60 | 61 | ## input line 17: 62 | 63 | ## input line 18: d = *(uint32 *) (x + 0) 64 | ## d = *(uint32 *) (x + 0) 65 | ## int32#3 = *(uint32 *) (int32#1 + 0) 66 | ## %edx = *(uint32 *) (%eax + 0) 67 | movl 0(%eax),%edx 68 | ## live mem32 values: 1 69 | ## live int32 values: 6 70 | ## live flags values: 0 71 | 72 | ## input line 19: inplace d ^= *(uint32 *) (y + 0) 73 | ## d ^= *(uint32 *) (y + 0) 74 | ## int32#3 ^= *(uint32 *) (int32#2 + 0) 75 | ## %edx ^= *(uint32 *) (%ecx + 0) 76 | xorl 0(%ecx),%edx 77 | ## live mem32 values: 1 78 | ## live int32 values: 6 79 | ## live flags values: 0 80 | 81 | ## input line 20: 82 | 83 | ## input line 21: x1 = *(uint32 *) (x + 4) 84 | ## x1 = *(uint32 *) (x + 4) 85 | ## int32#4 = *(uint32 *) (int32#1 + 4) 86 | ## %ebx = *(uint32 *) (%eax + 4) 87 | movl 4(%eax),%ebx 88 | ## live mem32 values: 1 89 | ## live int32 values: 7 90 | ## live flags values: 0 91 | 92 | ## input line 22: inplace x1 ^= *(uint32 *) (y + 4) 93 | ## x1 ^= *(uint32 *) (y + 4) 94 | ## int32#4 ^= *(uint32 *) (int32#2 + 4) 95 | ## %ebx ^= *(uint32 *) (%ecx + 4) 96 | xorl 4(%ecx),%ebx 97 | ## live mem32 values: 1 98 | ## live int32 values: 7 99 | ## live flags values: 0 100 | 101 | ## input line 23: inplace d |= x1 102 | ## d |= x1 103 | ## int32#3 |= int32#4 104 | ## %edx |= %ebx 105 | or %ebx,%edx 106 | ## live mem32 values: 1 107 | ## live int32 values: 6 108 | ## live flags values: 0 109 | 110 | ## input line 24: 111 | 112 | ## input line 25: x2 = *(uint32 *) (x + 8) 113 | ## x2 = *(uint32 *) (x + 8) 114 | ## int32#4 = *(uint32 *) (int32#1 + 8) 115 | ## %ebx = *(uint32 *) (%eax + 8) 116 | movl 8(%eax),%ebx 117 | ## live mem32 values: 1 118 | ## live int32 values: 7 119 | ## live flags values: 0 120 | 121 | ## input line 26: inplace x2 ^= *(uint32 *) (y + 8) 122 | ## x2 ^= *(uint32 *) (y + 8) 123 | ## int32#4 ^= *(uint32 *) (int32#2 + 8) 124 | ## %ebx ^= *(uint32 *) (%ecx + 8) 125 | xorl 8(%ecx),%ebx 126 | ## live mem32 values: 1 127 | ## live int32 values: 7 128 | ## live flags values: 0 129 | 130 | ## input line 27: inplace d |= x2 131 | ## d |= x2 132 | ## int32#3 |= int32#4 133 | ## %edx |= %ebx 134 | or %ebx,%edx 135 | ## live mem32 values: 1 136 | ## live int32 values: 6 137 | ## live flags values: 0 138 | 139 | ## input line 28: 140 | 141 | ## input line 29: x3 = *(uint32 *) (x + 12) 142 | ## x3 = *(uint32 *) (x + 12) 143 | ## int32#1 = *(uint32 *) (int32#1 + 12) 144 | ## %eax = *(uint32 *) (%eax + 12) 145 | movl 12(%eax),%eax 146 | ## live mem32 values: 1 147 | ## live int32 values: 6 148 | ## live flags values: 0 149 | 150 | ## input line 30: inplace x3 ^= *(uint32 *) (y + 12) 151 | ## x3 ^= *(uint32 *) (y + 12) 152 | ## int32#1 ^= *(uint32 *) (int32#2 + 12) 153 | ## %eax ^= *(uint32 *) (%ecx + 12) 154 | xorl 12(%ecx),%eax 155 | ## live mem32 values: 1 156 | ## live int32 values: 5 157 | ## live flags values: 0 158 | 159 | ## input line 31: inplace d |= x3 160 | ## d |= x3 161 | ## int32#3 |= int32#1 162 | ## %edx |= %eax 163 | or %eax,%edx 164 | ## live mem32 values: 1 165 | ## live int32 values: 4 166 | ## live flags values: 0 167 | 168 | ## input line 32: 169 | 170 | ## input line 33: d -= 1 171 | ## d -= 1 172 | ## int32#3 -= 1 173 | ## %edx -= 1 174 | sub $1,%edx 175 | ## live mem32 values: 1 176 | ## live int32 values: 4 177 | ## live flags values: 1 178 | 179 | ## input line 34: 180 | 181 | ## input line 35: d += 1 182 | ## d += 1 183 | ## int32#3 += 1 184 | ## %edx += 1 185 | add $1,%edx 186 | ## live mem32 values: 1 187 | ## live int32 values: 3 188 | ## live flags values: 1 189 | 190 | ## input line 36: result = 0 191 | ## result = 0 192 | ## int32#1 = 0 193 | ## %eax = 0 194 | mov $0,%eax 195 | ## live mem32 values: 1 196 | ## live int32 values: 4 197 | ## live flags values: 1 198 | 199 | ## input line 37: 200 | 201 | ## input line 38: kill d 202 | 203 | ## input line 39: 204 | 205 | ## input line 40: carry result += result + carry 206 | ## carry result += result + carry 207 | ## carry int32#1 += int32#1 + carry 208 | ## carry %eax += %eax + carry 209 | adc %eax,%eax 210 | ## live mem32 values: 1 211 | ## live int32 values: 4 212 | ## live flags values: 0 213 | 214 | ## input line 41: 215 | 216 | ## input line 42: load callerint ebx 217 | movl 0(%esp),%ebx 218 | ## live mem32 values: 0 219 | ## live int32 values: 5 220 | ## live flags values: 0 221 | 222 | ## input line 43: 223 | 224 | ## input line 44: output result 225 | 226 | ## input line 45: leave 227 | add $16,%esp 228 | ret 229 | ## live mem32 values: 0 230 | ## live int32 values: 5 231 | ## live flags values: 0 232 | -------------------------------------------------------------------------------- /c_src/poly1305aes/Makefile: -------------------------------------------------------------------------------- 1 | # poly1305aes Makefile version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | clean: 6 | rm *.o *.a \ 7 | poly1305aes.h poly1305.h aes.h poly1305aes.impl poly1305aes.impl.check \ 8 | poly1305aes.impl.check.h x86cpuid x86cpuid.out 9 | 10 | # Test programs: 11 | 12 | default: test-aes test-poly1305aes poly1305aes-speed 13 | 14 | speedreport: speedreport.do \ 15 | poly1305aes.h poly1305.h aes.h cpucycles.h \ 16 | poly1305aes-speed test-poly1305aes 17 | sh speedreport.do > speedreport 18 | 19 | test-aes: test-aes.o poly1305aes.a 20 | $(CC) -o test-aes test-aes.o poly1305aes.a 21 | 22 | test-aes.o: test-aes.c \ 23 | aes.h \ 24 | aes_aix.h \ 25 | aes_athlon.h \ 26 | aes_big.h \ 27 | aes_macos.h \ 28 | aes_ppro.h \ 29 | aes_sparc.h 30 | $(CC) -c test-aes.c 31 | 32 | test-poly1305aes: test-poly1305aes.o poly1305aes.a 33 | $(CC) -o test-poly1305aes test-poly1305aes.o poly1305aes.a 34 | 35 | test-poly1305aes.o: test-poly1305aes.c \ 36 | poly1305aes.h \ 37 | poly1305aes_53.h \ 38 | poly1305aes_aix.h \ 39 | poly1305aes_athlon.h \ 40 | poly1305aes_macos.h \ 41 | poly1305aes_ppro.h \ 42 | poly1305aes_sparc.h 43 | $(CC) -c test-poly1305aes.c 44 | 45 | poly1305aes-speed: poly1305aes-speed.o poly1305aes.a cpucycles.a 46 | $(CC) -o poly1305aes-speed poly1305aes-speed.o poly1305aes.a cpucycles.a 47 | 48 | poly1305aes-speed.o: poly1305aes-speed.c \ 49 | poly1305aes.h \ 50 | poly1305aes_53.h \ 51 | poly1305aes_aix.h \ 52 | poly1305aes_athlon.h \ 53 | poly1305aes_macos.h \ 54 | poly1305aes_ppro.h \ 55 | poly1305aes_sparc.h \ 56 | cpucycles.h \ 57 | cpucycles_aix.h \ 58 | cpucycles_athlon.h \ 59 | cpucycles_macos.h \ 60 | cpucycles_ppro.h \ 61 | cpucycles_sparc.h \ 62 | cpucycles_zero.h 63 | $(CC) -c poly1305aes-speed.c 64 | 65 | cpucycles.h: poly1305aes.impl \ 66 | cpucycles.h.do 67 | sh -e cpucycles.h.do > cpucycles.h.new 68 | mv cpucycles.h.new cpucycles.h 69 | 70 | cpucycles.a: poly1305aes.impl \ 71 | cpucycles.a.do \ 72 | cpucycles_aix.h \ 73 | cpucycles_aix.s \ 74 | cpucycles_athlon.h \ 75 | cpucycles_athlon.s \ 76 | cpucycles_macos.h \ 77 | cpucycles_macos.s \ 78 | cpucycles_ppro.h \ 79 | cpucycles_ppro.s \ 80 | cpucycles_sparc.h \ 81 | cpucycles_sparc.s \ 82 | cpucycles_zero.c \ 83 | cpucycles_zero.h 84 | sh -e cpucycles.a.do $(CC) > cpucycles.a.new 85 | mv cpucycles.a.new cpucycles.a 86 | 87 | 88 | # The poly1305aes library: 89 | 90 | poly1305aes: poly1305aes.a poly1305aes.h poly1305.h aes.h 91 | 92 | poly1305aes.h: poly1305aes.impl \ 93 | poly1305aes.h.do 94 | sh -e poly1305aes.h.do > poly1305aes.h.new 95 | mv poly1305aes.h.new poly1305aes.h 96 | 97 | poly1305.h: poly1305aes.impl \ 98 | poly1305.h.do 99 | sh -e poly1305.h.do > poly1305.h.new 100 | mv poly1305.h.new poly1305.h 101 | 102 | aes.h: poly1305aes.impl \ 103 | aes.h.do 104 | sh -e aes.h.do > aes.h.new 105 | mv aes.h.new aes.h 106 | 107 | poly1305aes.a: poly1305aes.impl \ 108 | poly1305aes.a.do \ 109 | aes_aix.h \ 110 | aes_aix.s \ 111 | aes_aix_constants.s \ 112 | aes_athlon.h \ 113 | aes_athlon.s \ 114 | aes_athlon_constants.s \ 115 | aes_big.c \ 116 | aes_big.h \ 117 | aes_big_constants.c \ 118 | aes_macos.h \ 119 | aes_macos.s \ 120 | aes_macos_constants.s \ 121 | aes_ppro.h \ 122 | aes_ppro.s \ 123 | aes_ppro_constants.s \ 124 | aes_sparc.h \ 125 | aes_sparc.s \ 126 | aes_sparc_constants.c \ 127 | poly1305_53.c \ 128 | poly1305_53.h \ 129 | poly1305_53_constants.c \ 130 | poly1305_aix.h \ 131 | poly1305_aix.s \ 132 | poly1305_aix_constants.c \ 133 | poly1305_athlon.h \ 134 | poly1305_athlon.s \ 135 | poly1305_athlon_constants.s \ 136 | poly1305_macos.h \ 137 | poly1305_macos.s \ 138 | poly1305_macos_constants.s \ 139 | poly1305_ppro.h \ 140 | poly1305_ppro.s \ 141 | poly1305_ppro_constants.s \ 142 | poly1305_sparc.h \ 143 | poly1305_sparc.s \ 144 | poly1305_sparc_constants.c \ 145 | poly1305aes_53.h \ 146 | poly1305aes_53_authenticate.c \ 147 | poly1305aes_53_clamp.c \ 148 | poly1305aes_53_isequal.c \ 149 | poly1305aes_53_verify.c \ 150 | poly1305aes_aix.h \ 151 | poly1305aes_aix_authenticate.c \ 152 | poly1305aes_aix_clamp.c \ 153 | poly1305aes_aix_isequal.s \ 154 | poly1305aes_aix_verify.c \ 155 | poly1305aes_athlon.h \ 156 | poly1305aes_athlon_authenticate.c \ 157 | poly1305aes_athlon_clamp.c \ 158 | poly1305aes_athlon_isequal.s \ 159 | poly1305aes_athlon_verify.c \ 160 | poly1305aes_macos.h \ 161 | poly1305aes_macos_authenticate.c \ 162 | poly1305aes_macos_clamp.c \ 163 | poly1305aes_macos_isequal.s \ 164 | poly1305aes_macos_verify.c \ 165 | poly1305aes_ppro.h \ 166 | poly1305aes_ppro_authenticate.c \ 167 | poly1305aes_ppro_clamp.c \ 168 | poly1305aes_ppro_isequal.s \ 169 | poly1305aes_ppro_verify.c \ 170 | poly1305aes_sparc.h \ 171 | poly1305aes_sparc_authenticate.c \ 172 | poly1305aes_sparc_clamp.s \ 173 | poly1305aes_sparc_fsr.s \ 174 | poly1305aes_sparc_isequal.s \ 175 | poly1305aes_sparc_verify.c 176 | sh -e poly1305aes.a.do $(CC) > poly1305aes.a.new 177 | mv poly1305aes.a.new poly1305aes.a 178 | 179 | poly1305aes.impl: \ 180 | poly1305aes.impl.do \ 181 | x86cpuid.c \ 182 | poly1305aes.impl.check.c \ 183 | aes_aix.h \ 184 | aes_aix.s \ 185 | aes_aix_constants.s \ 186 | aes_athlon.h \ 187 | aes_athlon.s \ 188 | aes_athlon_constants.s \ 189 | aes_big.c \ 190 | aes_big.h \ 191 | aes_big_constants.c \ 192 | aes_macos.h \ 193 | aes_macos.s \ 194 | aes_macos_constants.s \ 195 | aes_ppro.h \ 196 | aes_ppro.s \ 197 | aes_ppro_constants.s \ 198 | aes_sparc.h \ 199 | aes_sparc.s \ 200 | aes_sparc_constants.c \ 201 | poly1305_53.c \ 202 | poly1305_53.h \ 203 | poly1305_53_constants.c \ 204 | poly1305_aix.h \ 205 | poly1305_aix.s \ 206 | poly1305_aix_constants.c \ 207 | poly1305_athlon.h \ 208 | poly1305_athlon.s \ 209 | poly1305_athlon_constants.s \ 210 | poly1305_macos.h \ 211 | poly1305_macos.s \ 212 | poly1305_macos_constants.s \ 213 | poly1305_ppro.h \ 214 | poly1305_ppro.s \ 215 | poly1305_ppro_constants.s \ 216 | poly1305_sparc.h \ 217 | poly1305_sparc.s \ 218 | poly1305_sparc_constants.c \ 219 | poly1305aes_53.h \ 220 | poly1305aes_53_authenticate.c \ 221 | poly1305aes_53_clamp.c \ 222 | poly1305aes_53_isequal.c \ 223 | poly1305aes_53_verify.c \ 224 | poly1305aes_aix.h \ 225 | poly1305aes_aix_authenticate.c \ 226 | poly1305aes_aix_clamp.c \ 227 | poly1305aes_aix_isequal.s \ 228 | poly1305aes_aix_verify.c \ 229 | poly1305aes_athlon.h \ 230 | poly1305aes_athlon_authenticate.c \ 231 | poly1305aes_athlon_clamp.c \ 232 | poly1305aes_athlon_isequal.s \ 233 | poly1305aes_athlon_verify.c \ 234 | poly1305aes_macos.h \ 235 | poly1305aes_macos_authenticate.c \ 236 | poly1305aes_macos_clamp.c \ 237 | poly1305aes_macos_isequal.s \ 238 | poly1305aes_macos_verify.c \ 239 | poly1305aes_ppro.h \ 240 | poly1305aes_ppro_authenticate.c \ 241 | poly1305aes_ppro_clamp.c \ 242 | poly1305aes_ppro_isequal.s \ 243 | poly1305aes_ppro_verify.c \ 244 | poly1305aes_sparc.h \ 245 | poly1305aes_sparc_authenticate.c \ 246 | poly1305aes_sparc_clamp.s \ 247 | poly1305aes_sparc_fsr.s \ 248 | poly1305aes_sparc_isequal.s \ 249 | poly1305aes_sparc_verify.c 250 | sh -e poly1305aes.impl.do $(CC) > poly1305aes.impl.new 251 | mv poly1305aes.impl.new poly1305aes.impl 252 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes-speed.c: -------------------------------------------------------------------------------- 1 | /* 2 | poly1305aes-speed.c version 20050218 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include "poly1305aes.h" 11 | #include "cpucycles.h" 12 | 13 | char flushbuf[8388608]; 14 | 15 | #define FUN(x) int x(int i) { int j = i + flushbuf[0]; \ 16 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 17 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 18 | return j; } 19 | 20 | #define FUN2(x) \ 21 | FUN(x ## 0) \ 22 | FUN(x ## 1) \ 23 | int x(int i) { int j = i + x ## 0(i) + x ## 1(i); \ 24 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 25 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 26 | return j; } 27 | 28 | #define FUN4(x) \ 29 | FUN2(x ## 0) \ 30 | FUN2(x ## 1) \ 31 | int x(int i) { int j = i + x ## 0(i) + x ## 1(i); \ 32 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 33 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 34 | return j; } 35 | 36 | #define FUN8(x) \ 37 | FUN4(x ## 0) \ 38 | FUN4(x ## 1) \ 39 | int x(int i) { int j = i + x ## 0(i) + x ## 1(i); \ 40 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 41 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 42 | return j; } 43 | 44 | #define FUN16(x) \ 45 | FUN8(x ## 0) \ 46 | FUN8(x ## 1) \ 47 | int x(int i) { int j = i + x ## 0(i) + x ## 1(i); \ 48 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 49 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 50 | return j; } 51 | 52 | #define FUN32(x) \ 53 | FUN16(x ## 0) \ 54 | FUN16(x ## 1) \ 55 | int x(int i) { int j = i + x ## 0(i) + x ## 1(i); \ 56 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 57 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 58 | return j; } 59 | 60 | #define FUN64(x) \ 61 | FUN32(x ## 0) \ 62 | FUN32(x ## 1) \ 63 | int x(int i) { int j = i + x ## 0(i) + x ## 1(i); \ 64 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 65 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 66 | return j; } 67 | 68 | #define FUN128(x) \ 69 | FUN64(x ## 0) \ 70 | FUN64(x ## 1) \ 71 | int x(int i) { int j = i + x ## 0(i) + x ## 1(i); \ 72 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 73 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 74 | return j; } 75 | 76 | #define FUN256(x) \ 77 | FUN128(x ## 0) \ 78 | FUN128(x ## 1) \ 79 | int x(int i) { int j = i + x ## 0(i) + x ## 1(i); \ 80 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 81 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 82 | return j; } 83 | 84 | #define FUN512(x) \ 85 | FUN256(x ## 0) \ 86 | FUN256(x ## 1) \ 87 | int x(int i) { int j = i + x ## 0(i) + x ## 1(i); \ 88 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 89 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 90 | return j; } 91 | 92 | #define FUN1024(x) \ 93 | FUN512(x ## 0) \ 94 | FUN512(x ## 1) \ 95 | int x(int i) { int j = i + x ## 0(i) + x ## 1(i); \ 96 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 97 | i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; i += j; j ^= i; \ 98 | return j; } 99 | 100 | FUN1024(icacheflush) 101 | 102 | void cacheflush(void) 103 | { 104 | int i = 0; 105 | int c0; 106 | int c1; 107 | int c2; 108 | int c3; 109 | int loop; 110 | flushbuf[0] = icacheflush(0); 111 | for (loop = 0;loop < 3;++loop) 112 | while (i < 8388608) { 113 | c0 = flushbuf[i]; 114 | c1 = flushbuf[i + 64]; 115 | c2 = flushbuf[i + 128]; 116 | c3 = flushbuf[i + 192]; 117 | flushbuf[i + 1] = c3; 118 | flushbuf[i + 65] = c2; 119 | flushbuf[i + 129] = c1; 120 | flushbuf[i + 193] = c0; 121 | i += 256; 122 | } 123 | flushbuf[0] = icacheflush(0); 124 | } 125 | 126 | long long tstart; struct timeval tvstart; 127 | long long tfinish; struct timeval tvfinish; 128 | 129 | long long t[21]; 130 | long long buf[1048576]; 131 | 132 | main() 133 | { 134 | int len; 135 | unsigned char *kr; 136 | unsigned char *n; 137 | unsigned char *m; 138 | unsigned char *a; 139 | int keygap; 140 | int datagap; 141 | int i; 142 | int j; 143 | 144 | printf("%s %s\n",poly1305aes_implementation,cpucycles_implementation); 145 | tstart = cpucycles(); gettimeofday(&tvstart,0); 146 | 147 | for (i = 0;i < sizeof buf;++i) i[(char *) buf] = random(); 148 | 149 | #define DOIT(cachedkeys,cacheddata,aligned,fun,funsymbol) \ 150 | kr = (unsigned char *) buf; \ 151 | if (!aligned) ++kr; \ 152 | n = kr + 1024; \ 153 | a = kr + 2048; \ 154 | m = kr + 3072; \ 155 | if (!cachedkeys) \ 156 | keygap = 65536; \ 157 | else \ 158 | keygap = 32; \ 159 | if (!cacheddata) \ 160 | datagap = 262144; \ 161 | else \ 162 | datagap = 0; \ 163 | for (i = 0;i <= 20;++i) { \ 164 | for (j = 0;j < 32;++j) kr[j] = random(); \ 165 | for (j = 0;j < 16;++j) n[j] = random(); \ 166 | for (j = 0;j < 16;++j) a[j] = random(); \ 167 | for (j = 0;j < len;++j) m[j] = random(); \ 168 | poly1305aes_clamp(kr); \ 169 | kr += keygap; \ 170 | n += datagap; \ 171 | m += datagap; \ 172 | a += datagap; \ 173 | } \ 174 | cacheflush(); \ 175 | kr = (unsigned char *) buf; \ 176 | if (!aligned) ++kr; \ 177 | n = kr + 1024; \ 178 | a = kr + 2048; \ 179 | m = kr + 3072; \ 180 | keygap = cachedkeys ? 32 : 262144; \ 181 | datagap = cacheddata ? 0 : 262144; \ 182 | if (cachedkeys) { \ 183 | for (i = 0;i <= 20;++i) { \ 184 | for (j = 0;j < 32;++j) flushbuf[j] ^= kr[j]; \ 185 | kr += keygap; \ 186 | } \ 187 | for (i = 0;i <= 20;++i) kr -= keygap; \ 188 | } \ 189 | if (cacheddata) { \ 190 | for (j = 0;j < 16;++j) flushbuf[j] ^= n[j]; \ 191 | for (j = 0;j < 16;++j) flushbuf[j] ^= a[j]; \ 192 | for (j = 0;j < len;++j) flushbuf[j] ^= m[j]; \ 193 | } \ 194 | for (i = 0;i <= 20;++i) t[i] = cpucycles(); \ 195 | for (i = 0;i <= 20;++i) { \ 196 | t[i] = cpucycles(); \ 197 | fun(a,kr,n,m,len); \ 198 | kr += keygap; \ 199 | n += datagap; \ 200 | m += datagap; \ 201 | a += datagap; \ 202 | } \ 203 | printf("%4d ",len); \ 204 | printf(funsymbol); \ 205 | printf(aligned ? "4444" : "0000"); \ 206 | printf(cachedkeys ? "K" : "-"); \ 207 | printf(cacheddata ? "D" : "-"); \ 208 | for (i = 0;i < 20;++i) printf(" %5lld",t[i + 1] - t[i]); \ 209 | printf("\n"); \ 210 | fflush(stdout); 211 | 212 | #define DOIT3(cachedkeys,cacheddata,aligned,fun,funsymbol) \ 213 | DOIT(cachedkeys,cacheddata,aligned,fun,funsymbol) \ 214 | DOIT(cachedkeys,cacheddata,aligned,fun,funsymbol) \ 215 | DOIT(cachedkeys,cacheddata,aligned,fun,funsymbol) 216 | 217 | #define DOIT6(cachedkeys,cacheddata,aligned) \ 218 | DOIT3(cachedkeys,cacheddata,aligned,poly1305aes_authenticate,"A") \ 219 | DOIT3(cachedkeys,cacheddata,aligned,poly1305aes_verify,"V") 220 | 221 | #define DOIT12(cachedkeys,cacheddata) \ 222 | DOIT6(cachedkeys,cacheddata,1) \ 223 | DOIT6(cachedkeys,cacheddata,0) 224 | 225 | for (len = 0;len <= 8192;++len) { 226 | DOIT12(1,1) 227 | DOIT12(0,1) 228 | DOIT12(1,0) 229 | DOIT12(0,0) 230 | } 231 | 232 | tfinish = cpucycles(); gettimeofday(&tvfinish,0); 233 | printf("%lld cycles\n" 234 | ,tfinish - tstart); 235 | printf("%lld usecs\n" 236 | ,(tvfinish.tv_sec - tvstart.tv_sec) * 1000000LL + (tvfinish.tv_usec - tvstart.tv_usec)); 237 | printf("%f MHz\n" 238 | ,(tfinish - tstart) * 1.0 / ((tvfinish.tv_sec - tvstart.tv_sec) * 1000000LL + (tvfinish.tv_usec - tvstart.tv_usec))); 239 | 240 | return 0; 241 | } 242 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_macos_isequal.s: -------------------------------------------------------------------------------- 1 | # poly1305aes_macos_isequal.s version 20050207 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | # translated by qhasm-macos version 20050207 6 | 7 | ; input line 1: register int32 d 8 | 9 | ; input line 2: register int32 result 10 | 11 | ; input line 3: register int32 x 12 | 13 | ; input line 4: register int32 y 14 | 15 | ; input line 5: register int32 x0 16 | 17 | ; input line 6: register int32 x1 18 | 19 | ; input line 7: register int32 x2 20 | 21 | ; input line 8: register int32 x3 22 | 23 | ; input line 9: register int32 y0 24 | 25 | ; input line 10: register int32 y1 26 | 27 | ; input line 11: register int32 y2 28 | 29 | ; input line 12: register int32 y3 30 | 31 | ; input line 13: 32 | 33 | ; input line 14: enter poly1305aes_macos_isequal 34 | .text 35 | .align 3 36 | .globl _poly1305aes_macos_isequal 37 | .globl poly1305aes_macos_isequal 38 | _poly1305aes_macos_isequal: 39 | poly1305aes_macos_isequal: 40 | 41 | ; input line 15: input x 42 | 43 | ; input line 16: input y 44 | 45 | ; input line 17: 46 | 47 | ; input line 18: x0 = *(uint32 *) (x + 0) 48 | ; x0 = *(uint32 *) (x + 0) 49 | ; int32#3 = *(uint32 *) (int32#1 + 0) 50 | ; r5 = *(uint32 *) (r3 + 0) 51 | lwz r5,0(r3) 52 | ; live mem32 values: 0 53 | ; live flag values: 0 54 | ; live mem64 values: 0 55 | ; live int32 values: 22 56 | ; live double values: 18 57 | ; live flags values: 0 58 | 59 | ; input line 19: 60 | 61 | ; input line 20: y0 = *(uint32 *) (y + 0) 62 | ; y0 = *(uint32 *) (y + 0) 63 | ; int32#6 = *(uint32 *) (int32#2 + 0) 64 | ; r8 = *(uint32 *) (r4 + 0) 65 | lwz r8,0(r4) 66 | ; live mem32 values: 0 67 | ; live flag values: 0 68 | ; live mem64 values: 0 69 | ; live int32 values: 23 70 | ; live double values: 18 71 | ; live flags values: 0 72 | 73 | ; input line 21: 74 | 75 | ; input line 22: x1 = *(uint32 *) (x + 4) 76 | ; x1 = *(uint32 *) (x + 4) 77 | ; int32#4 = *(uint32 *) (int32#1 + 4) 78 | ; r6 = *(uint32 *) (r3 + 4) 79 | lwz r6,4(r3) 80 | ; live mem32 values: 0 81 | ; live flag values: 0 82 | ; live mem64 values: 0 83 | ; live int32 values: 24 84 | ; live double values: 18 85 | ; live flags values: 0 86 | 87 | ; input line 23: 88 | 89 | ; input line 24: y1 = *(uint32 *) (y + 4) 90 | ; y1 = *(uint32 *) (y + 4) 91 | ; int32#7 = *(uint32 *) (int32#2 + 4) 92 | ; r9 = *(uint32 *) (r4 + 4) 93 | lwz r9,4(r4) 94 | ; live mem32 values: 0 95 | ; live flag values: 0 96 | ; live mem64 values: 0 97 | ; live int32 values: 25 98 | ; live double values: 18 99 | ; live flags values: 0 100 | 101 | ; input line 25: 102 | 103 | ; input line 26: x2 = *(uint32 *) (x + 8) 104 | ; x2 = *(uint32 *) (x + 8) 105 | ; int32#5 = *(uint32 *) (int32#1 + 8) 106 | ; r7 = *(uint32 *) (r3 + 8) 107 | lwz r7,8(r3) 108 | ; live mem32 values: 0 109 | ; live flag values: 0 110 | ; live mem64 values: 0 111 | ; live int32 values: 26 112 | ; live double values: 18 113 | ; live flags values: 0 114 | 115 | ; input line 27: d = y0 ^ x0 116 | ; d = y0 ^ x0 117 | ; int32#3 = int32#6 ^ int32#3 118 | ; r5 = r8 ^ r5 119 | xor r5,r8,r5 120 | ; live mem32 values: 0 121 | ; live flag values: 0 122 | ; live mem64 values: 0 123 | ; live int32 values: 25 124 | ; live double values: 18 125 | ; live flags values: 0 126 | 127 | ; input line 28: 128 | 129 | ; input line 29: y2 = *(uint32 *) (y + 8) 130 | ; y2 = *(uint32 *) (y + 8) 131 | ; int32#8 = *(uint32 *) (int32#2 + 8) 132 | ; r10 = *(uint32 *) (r4 + 8) 133 | lwz r10,8(r4) 134 | ; live mem32 values: 0 135 | ; live flag values: 0 136 | ; live mem64 values: 0 137 | ; live int32 values: 26 138 | ; live double values: 18 139 | ; live flags values: 0 140 | 141 | ; input line 30: y1 ^= x1 142 | ; y1#2 = y1 ^ x1 143 | ; int32#6 = int32#7 ^ int32#4 144 | ; r8 = r9 ^ r6 145 | xor r8,r9,r6 146 | ; live mem32 values: 0 147 | ; live flag values: 0 148 | ; live mem64 values: 0 149 | ; live int32 values: 25 150 | ; live double values: 18 151 | ; live flags values: 0 152 | 153 | ; input line 31: 154 | 155 | ; input line 32: x3 = *(uint32 *) (x + 12) 156 | ; x3 = *(uint32 *) (x + 12) 157 | ; int32#4 = *(uint32 *) (int32#1 + 12) 158 | ; r6 = *(uint32 *) (r3 + 12) 159 | lwz r6,12(r3) 160 | ; live mem32 values: 0 161 | ; live flag values: 0 162 | ; live mem64 values: 0 163 | ; live int32 values: 25 164 | ; live double values: 18 165 | ; live flags values: 0 166 | 167 | ; input line 33: d |= y1 168 | ; d#2 = d | y1#2 169 | ; int32#1 = int32#3 | int32#6 170 | ; r3 = r5 | r8 171 | or r3,r5,r8 172 | ; live mem32 values: 0 173 | ; live flag values: 0 174 | ; live mem64 values: 0 175 | ; live int32 values: 24 176 | ; live double values: 18 177 | ; live flags values: 0 178 | 179 | ; input line 34: 180 | 181 | ; input line 35: y3 = *(uint32 *) (y + 12) 182 | ; y3 = *(uint32 *) (y + 12) 183 | ; int32#3 = *(uint32 *) (int32#2 + 12) 184 | ; r5 = *(uint32 *) (r4 + 12) 185 | lwz r5,12(r4) 186 | ; live mem32 values: 0 187 | ; live flag values: 0 188 | ; live mem64 values: 0 189 | ; live int32 values: 24 190 | ; live double values: 18 191 | ; live flags values: 0 192 | 193 | ; input line 36: y2 ^= x2 194 | ; y2#2 = y2 ^ x2 195 | ; int32#2 = int32#8 ^ int32#5 196 | ; r4 = r10 ^ r7 197 | xor r4,r10,r7 198 | ; live mem32 values: 0 199 | ; live flag values: 0 200 | ; live mem64 values: 0 201 | ; live int32 values: 23 202 | ; live double values: 18 203 | ; live flags values: 0 204 | 205 | ; input line 37: 206 | 207 | ; input line 38: d |= y2 208 | ; d#3 = d#2 | y2#2 209 | ; int32#1 = int32#1 | int32#2 210 | ; r3 = r3 | r4 211 | or r3,r3,r4 212 | ; live mem32 values: 0 213 | ; live flag values: 0 214 | ; live mem64 values: 0 215 | ; live int32 values: 22 216 | ; live double values: 18 217 | ; live flags values: 0 218 | 219 | ; input line 39: y3 ^= x3 220 | ; y3#2 = y3 ^ x3 221 | ; int32#2 = int32#3 ^ int32#4 222 | ; r4 = r5 ^ r6 223 | xor r4,r5,r6 224 | ; live mem32 values: 0 225 | ; live flag values: 0 226 | ; live mem64 values: 0 227 | ; live int32 values: 21 228 | ; live double values: 18 229 | ; live flags values: 0 230 | 231 | ; input line 40: 232 | 233 | ; input line 41: d |= y3 234 | ; d#4 = d#3 | y3#2 235 | ; int32#1 = int32#1 | int32#2 236 | ; r3 = r3 | r4 237 | or r3,r3,r4 238 | ; live mem32 values: 0 239 | ; live flag values: 0 240 | ; live mem64 values: 0 241 | ; live int32 values: 20 242 | ; live double values: 18 243 | ; live flags values: 0 244 | 245 | ; input line 42: 246 | 247 | ; input line 43: d -= 1 248 | ; d#5 = d#4 - 1 249 | ; int32#1 = int32#1 - 1 250 | ; r3 = r3 - 1 251 | addi r3,r3,-1 252 | ; live mem32 values: 0 253 | ; live flag values: 0 254 | ; live mem64 values: 0 255 | ; live int32 values: 20 256 | ; live double values: 18 257 | ; live flags values: 0 258 | 259 | ; input line 44: 260 | 261 | ; input line 45: carry d = d + 1 262 | ; carry d#6 = d#5 + 1 263 | ; carry int32#1 = int32#1 + 1 264 | ; carry r3 = r3 + 1 265 | addic r3,r3,1 266 | ; live mem32 values: 0 267 | ; live flag values: 1 268 | ; live mem64 values: 0 269 | ; live int32 values: 20 270 | ; live double values: 18 271 | ; live flags values: 0 272 | 273 | ; input line 46: result = 0 274 | ; result#2 = 0 275 | ; int32#1 = 0 276 | ; r3 = 0 277 | li r3,0 278 | ; live mem32 values: 0 279 | ; live flag values: 1 280 | ; live mem64 values: 0 281 | ; live int32 values: 20 282 | ; live double values: 18 283 | ; live flags values: 0 284 | 285 | ; input line 47: 286 | 287 | ; input line 48: kill d 288 | 289 | ; input line 49: 290 | 291 | ; input line 50: carry result = result + result + carry 292 | ; carry result = result#2 + result#2 + carry 293 | ; carry int32#1 = int32#1 + int32#1 + carry 294 | ; carry r3 = r3 + r3 + carry 295 | adde r3,r3,r3 296 | ; live mem32 values: 0 297 | ; live flag values: 1 298 | ; live mem64 values: 0 299 | ; live int32 values: 20 300 | ; live double values: 18 301 | ; live flags values: 0 302 | 303 | ; input line 51: 304 | 305 | ; input line 52: output result 306 | 307 | ; input line 53: leave 308 | blr 309 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_aix_isequal.s: -------------------------------------------------------------------------------- 1 | # poly1305aes_aix_isequal.s version 20050205 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | # translated by qhasm-ppc version 20050205 6 | .toc 7 | 8 | # input line 1: register int32 d 9 | 10 | # input line 2: register int32 result 11 | 12 | # input line 3: register int32 x 13 | 14 | # input line 4: register int32 y 15 | 16 | # input line 5: register int32 x0 17 | 18 | # input line 6: register int32 x1 19 | 20 | # input line 7: register int32 x2 21 | 22 | # input line 8: register int32 x3 23 | 24 | # input line 9: register int32 y0 25 | 26 | # input line 10: register int32 y1 27 | 28 | # input line 11: register int32 y2 29 | 30 | # input line 12: register int32 y3 31 | 32 | # input line 13: 33 | 34 | # input line 14: enter poly1305aes_aix_isequal 35 | .csect poly1305aes_aix_isequal[DS] 36 | .globl poly1305aes_aix_isequal 37 | poly1305aes_aix_isequal: 38 | .long .poly1305aes_aix_isequal 39 | .long TOC[tc0] 40 | .long 0 41 | .csect .text[PR] 42 | .globl .poly1305aes_aix_isequal 43 | .poly1305aes_aix_isequal: 44 | 45 | # input line 15: input x 46 | 47 | # input line 16: input y 48 | 49 | # input line 17: 50 | 51 | # input line 18: x0 = *(uint32 *) (x + 0) 52 | # x0 = *(uint32 *) (x + 0) 53 | # int32#3 = *(uint32 *) (int32#1 + 0) 54 | # 5 = *(uint32 *) (3 + 0) 55 | lwz 5,0(3) 56 | # live mem32 values: 0 57 | # live flag values: 0 58 | # live mem64 values: 0 59 | # live int32 values: 22 60 | # live double values: 18 61 | # live flags values: 0 62 | 63 | # input line 19: 64 | 65 | # input line 20: y0 = *(uint32 *) (y + 0) 66 | # y0 = *(uint32 *) (y + 0) 67 | # int32#6 = *(uint32 *) (int32#2 + 0) 68 | # 8 = *(uint32 *) (4 + 0) 69 | lwz 8,0(4) 70 | # live mem32 values: 0 71 | # live flag values: 0 72 | # live mem64 values: 0 73 | # live int32 values: 23 74 | # live double values: 18 75 | # live flags values: 0 76 | 77 | # input line 21: 78 | 79 | # input line 22: x1 = *(uint32 *) (x + 4) 80 | # x1 = *(uint32 *) (x + 4) 81 | # int32#4 = *(uint32 *) (int32#1 + 4) 82 | # 6 = *(uint32 *) (3 + 4) 83 | lwz 6,4(3) 84 | # live mem32 values: 0 85 | # live flag values: 0 86 | # live mem64 values: 0 87 | # live int32 values: 24 88 | # live double values: 18 89 | # live flags values: 0 90 | 91 | # input line 23: 92 | 93 | # input line 24: y1 = *(uint32 *) (y + 4) 94 | # y1 = *(uint32 *) (y + 4) 95 | # int32#7 = *(uint32 *) (int32#2 + 4) 96 | # 9 = *(uint32 *) (4 + 4) 97 | lwz 9,4(4) 98 | # live mem32 values: 0 99 | # live flag values: 0 100 | # live mem64 values: 0 101 | # live int32 values: 25 102 | # live double values: 18 103 | # live flags values: 0 104 | 105 | # input line 25: 106 | 107 | # input line 26: x2 = *(uint32 *) (x + 8) 108 | # x2 = *(uint32 *) (x + 8) 109 | # int32#5 = *(uint32 *) (int32#1 + 8) 110 | # 7 = *(uint32 *) (3 + 8) 111 | lwz 7,8(3) 112 | # live mem32 values: 0 113 | # live flag values: 0 114 | # live mem64 values: 0 115 | # live int32 values: 26 116 | # live double values: 18 117 | # live flags values: 0 118 | 119 | # input line 27: d = y0 ^ x0 120 | # d = y0 ^ x0 121 | # int32#3 = int32#6 ^ int32#3 122 | # 5 = 8 ^ 5 123 | xor 5,8,5 124 | # live mem32 values: 0 125 | # live flag values: 0 126 | # live mem64 values: 0 127 | # live int32 values: 25 128 | # live double values: 18 129 | # live flags values: 0 130 | 131 | # input line 28: 132 | 133 | # input line 29: y2 = *(uint32 *) (y + 8) 134 | # y2 = *(uint32 *) (y + 8) 135 | # int32#8 = *(uint32 *) (int32#2 + 8) 136 | # 10 = *(uint32 *) (4 + 8) 137 | lwz 10,8(4) 138 | # live mem32 values: 0 139 | # live flag values: 0 140 | # live mem64 values: 0 141 | # live int32 values: 26 142 | # live double values: 18 143 | # live flags values: 0 144 | 145 | # input line 30: y1 ^= x1 146 | # y1#2 = y1 ^ x1 147 | # int32#6 = int32#7 ^ int32#4 148 | # 8 = 9 ^ 6 149 | xor 8,9,6 150 | # live mem32 values: 0 151 | # live flag values: 0 152 | # live mem64 values: 0 153 | # live int32 values: 25 154 | # live double values: 18 155 | # live flags values: 0 156 | 157 | # input line 31: 158 | 159 | # input line 32: x3 = *(uint32 *) (x + 12) 160 | # x3 = *(uint32 *) (x + 12) 161 | # int32#4 = *(uint32 *) (int32#1 + 12) 162 | # 6 = *(uint32 *) (3 + 12) 163 | lwz 6,12(3) 164 | # live mem32 values: 0 165 | # live flag values: 0 166 | # live mem64 values: 0 167 | # live int32 values: 25 168 | # live double values: 18 169 | # live flags values: 0 170 | 171 | # input line 33: d |= y1 172 | # d#2 = d | y1#2 173 | # int32#1 = int32#3 | int32#6 174 | # 3 = 5 | 8 175 | or 3,5,8 176 | # live mem32 values: 0 177 | # live flag values: 0 178 | # live mem64 values: 0 179 | # live int32 values: 24 180 | # live double values: 18 181 | # live flags values: 0 182 | 183 | # input line 34: 184 | 185 | # input line 35: y3 = *(uint32 *) (y + 12) 186 | # y3 = *(uint32 *) (y + 12) 187 | # int32#3 = *(uint32 *) (int32#2 + 12) 188 | # 5 = *(uint32 *) (4 + 12) 189 | lwz 5,12(4) 190 | # live mem32 values: 0 191 | # live flag values: 0 192 | # live mem64 values: 0 193 | # live int32 values: 24 194 | # live double values: 18 195 | # live flags values: 0 196 | 197 | # input line 36: y2 ^= x2 198 | # y2#2 = y2 ^ x2 199 | # int32#2 = int32#8 ^ int32#5 200 | # 4 = 10 ^ 7 201 | xor 4,10,7 202 | # live mem32 values: 0 203 | # live flag values: 0 204 | # live mem64 values: 0 205 | # live int32 values: 23 206 | # live double values: 18 207 | # live flags values: 0 208 | 209 | # input line 37: 210 | 211 | # input line 38: d |= y2 212 | # d#3 = d#2 | y2#2 213 | # int32#1 = int32#1 | int32#2 214 | # 3 = 3 | 4 215 | or 3,3,4 216 | # live mem32 values: 0 217 | # live flag values: 0 218 | # live mem64 values: 0 219 | # live int32 values: 22 220 | # live double values: 18 221 | # live flags values: 0 222 | 223 | # input line 39: y3 ^= x3 224 | # y3#2 = y3 ^ x3 225 | # int32#2 = int32#3 ^ int32#4 226 | # 4 = 5 ^ 6 227 | xor 4,5,6 228 | # live mem32 values: 0 229 | # live flag values: 0 230 | # live mem64 values: 0 231 | # live int32 values: 21 232 | # live double values: 18 233 | # live flags values: 0 234 | 235 | # input line 40: 236 | 237 | # input line 41: d |= y3 238 | # d#4 = d#3 | y3#2 239 | # int32#1 = int32#1 | int32#2 240 | # 3 = 3 | 4 241 | or 3,3,4 242 | # live mem32 values: 0 243 | # live flag values: 0 244 | # live mem64 values: 0 245 | # live int32 values: 20 246 | # live double values: 18 247 | # live flags values: 0 248 | 249 | # input line 42: 250 | 251 | # input line 43: d -= 1 252 | # d#5 = d#4 - 1 253 | # int32#1 = int32#1 - 1 254 | # 3 = 3 - 1 255 | addi 3,3,-1 256 | # live mem32 values: 0 257 | # live flag values: 0 258 | # live mem64 values: 0 259 | # live int32 values: 20 260 | # live double values: 18 261 | # live flags values: 0 262 | 263 | # input line 44: 264 | 265 | # input line 45: carry d = d + 1 266 | # carry d#6 = d#5 + 1 267 | # carry int32#1 = int32#1 + 1 268 | # carry 3 = 3 + 1 269 | addic 3,3,1 270 | # live mem32 values: 0 271 | # live flag values: 1 272 | # live mem64 values: 0 273 | # live int32 values: 20 274 | # live double values: 18 275 | # live flags values: 0 276 | 277 | # input line 46: result = 0 278 | # result#2 = 0 279 | # int32#1 = 0 280 | # 3 = 0 281 | li 3,0 282 | # live mem32 values: 0 283 | # live flag values: 1 284 | # live mem64 values: 0 285 | # live int32 values: 20 286 | # live double values: 18 287 | # live flags values: 0 288 | 289 | # input line 47: 290 | 291 | # input line 48: kill d 292 | 293 | # input line 49: 294 | 295 | # input line 50: carry result = result + result + carry 296 | # carry result = result#2 + result#2 + carry 297 | # carry int32#1 = int32#1 + int32#1 + carry 298 | # carry 3 = 3 + 3 + carry 299 | adde 3,3,3 300 | # live mem32 values: 0 301 | # live flag values: 1 302 | # live mem64 values: 0 303 | # live int32 values: 20 304 | # live double values: 18 305 | # live flags values: 0 306 | 307 | # input line 51: 308 | 309 | # input line 52: output result 310 | 311 | # input line 53: leave 312 | blr 313 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_big.c: -------------------------------------------------------------------------------- 1 | /* 2 | aes_big.c version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | #include "aes_big.h" 8 | 9 | #define uchar unsigned char 10 | #define int32 int 11 | #define uint32 unsigned int 12 | 13 | void aes_big(unsigned char out[16], 14 | const unsigned char k[16], 15 | const unsigned char n[16] 16 | ) 17 | { 18 | register int32 loop4; 19 | register char *table0; 20 | register char *table1; 21 | register char *table2; 22 | register char *table3; 23 | register uint32 x0; 24 | register uint32 x1; 25 | register uint32 x2; 26 | register uint32 x3; 27 | register uint32 y0; 28 | register uint32 y1; 29 | register uint32 y2; 30 | register uint32 y3; 31 | register uint32 byte0; 32 | register uint32 byte1; 33 | register uint32 byte2; 34 | register uint32 byte3; 35 | register uint32 e; 36 | register uint32 p00; 37 | register uint32 p01; 38 | register uint32 p02; 39 | register uint32 p03; 40 | register uint32 z0; 41 | register uint32 z1; 42 | register uint32 z2; 43 | register uint32 z3; 44 | register uint32 p10; 45 | register uint32 p11; 46 | register uint32 p12; 47 | register uint32 p13; 48 | register uint32 p20; 49 | register uint32 p21; 50 | register uint32 p22; 51 | register uint32 p23; 52 | register uint32 p30; 53 | register uint32 p31; 54 | register uint32 p32; 55 | register uint32 p33; 56 | register uint32 q0; 57 | register uint32 q1; 58 | register uint32 q2; 59 | register uint32 q3; 60 | register uint32 k00; 61 | register uint32 k01; 62 | register uint32 k02; 63 | register uint32 k03; 64 | register uint32 k10; 65 | register uint32 k11; 66 | register uint32 k12; 67 | register uint32 k13; 68 | register uint32 k20; 69 | register uint32 k21; 70 | register uint32 k22; 71 | register uint32 k23; 72 | register uint32 k30; 73 | register uint32 k31; 74 | register uint32 k32; 75 | register uint32 k33; 76 | register uint32 n00; 77 | register uint32 n01; 78 | register uint32 n02; 79 | register uint32 n03; 80 | register uint32 n10; 81 | register uint32 n11; 82 | register uint32 n12; 83 | register uint32 n13; 84 | register uint32 n20; 85 | register uint32 n21; 86 | register uint32 n22; 87 | register uint32 n23; 88 | register uint32 n30; 89 | register uint32 n31; 90 | register uint32 n32; 91 | register uint32 n33; 92 | 93 | table0 = (char *) &aes_big_constants[10]; 94 | table1 = table0 + 8; 95 | table2 = table0 + 4; 96 | table3 = table0 + 12; 97 | 98 | byte0 = 0xff; 99 | byte1 = 0xff00; 100 | byte2 = 0xff0000; 101 | byte3 = 0xff000000; 102 | 103 | loop4 = -36; 104 | 105 | k30 = *(uchar *) (k + 15); 106 | k31 = *(uchar *) (k + 14); 107 | k32 = *(uchar *) (k + 13); 108 | k33 = *(uchar *) (k + 12); 109 | k31 <<= 8; 110 | k32 <<= 16; 111 | k33 <<= 24; 112 | x3 = k30 ^ k31; 113 | x3 ^= k32; 114 | x3 ^= k33; 115 | 116 | k00 = *(uchar *) (k + 3); 117 | k01 = *(uchar *) (k + 2); 118 | k02 = *(uchar *) (k + 1); 119 | k03 = *(uchar *) (k + 0); 120 | k01 <<= 8; 121 | k02 <<= 16; 122 | k03 <<= 24; 123 | x0 = k00 ^ k01; 124 | x0 ^= k02; 125 | x0 ^= k03; 126 | 127 | k10 = *(uchar *) (k + 7); 128 | k11 = *(uchar *) (k + 6); 129 | k12 = *(uchar *) (k + 5); 130 | k13 = *(uchar *) (k + 4); 131 | k11 <<= 8; 132 | k12 <<= 16; 133 | k13 <<= 24; 134 | x1 = k10 ^ k11; 135 | x1 ^= k12; 136 | x1 ^= k13; 137 | 138 | k20 = *(uchar *) (k + 11); 139 | k21 = *(uchar *) (k + 10); 140 | k22 = *(uchar *) (k + 9); 141 | k23 = *(uchar *) (k + 8); 142 | k21 <<= 8; 143 | k22 <<= 16; 144 | k23 <<= 24; 145 | x2 = k20 ^ k21; 146 | x2 ^= k22; 147 | x2 ^= k23; 148 | 149 | q0 = x3 >> 12; 150 | q1 = x3 >> 4; 151 | q2 = x3 << 4; 152 | q3 = x3 >> 20; 153 | q0 &= 4080; 154 | q1 &= 4080; 155 | q2 &= 4080; 156 | q3 &= 4080; 157 | q0 = *(uint32 *) (table2 + q0); 158 | q1 = *(uint32 *) (table3 + q1); 159 | q2 = *(uint32 *) (table0 + q2); 160 | q3 = *(uint32 *) (table1 + q3); 161 | q0 &= byte3; 162 | q1 &= byte2; 163 | q2 &= byte1; 164 | q3 &= byte0; 165 | e = q0 ^ aes_big_constants[0]; 166 | e ^= q1; 167 | e ^= q2; 168 | 169 | n00 = *(uchar *) (n + 3); 170 | n01 = *(uchar *) (n + 2); 171 | n02 = *(uchar *) (n + 1); 172 | n03 = *(uchar *) (n + 0); 173 | n01 <<= 8; 174 | n02 <<= 16; 175 | n03 <<= 24; 176 | y0 = x0 ^ n00; 177 | y0 ^= n01; 178 | y0 ^= n02; 179 | y0 ^= n03; 180 | 181 | n10 = *(uchar *) (n + 7); 182 | n11 = *(uchar *) (n + 6); 183 | n12 = *(uchar *) (n + 5); 184 | n13 = *(uchar *) (n + 4); 185 | n11 <<= 8; 186 | n12 <<= 16; 187 | n13 <<= 24; 188 | y1 = x1 ^ n10; 189 | y1 ^= n11; 190 | y1 ^= n12; 191 | y1 ^= n13; 192 | 193 | n20 = *(uchar *) (n + 11); 194 | n21 = *(uchar *) (n + 10); 195 | n22 = *(uchar *) (n + 9); 196 | n23 = *(uchar *) (n + 8); 197 | n21 <<= 8; 198 | n22 <<= 16; 199 | n23 <<= 24; 200 | y2 = x2 ^ n20; 201 | y2 ^= n21; 202 | y2 ^= n22; 203 | y2 ^= n23; 204 | 205 | n30 = *(uchar *) (n + 15); 206 | n31 = *(uchar *) (n + 14); 207 | n32 = *(uchar *) (n + 13); 208 | n33 = *(uchar *) (n + 12); 209 | n31 <<= 8; 210 | n32 <<= 16; 211 | n33 <<= 24; 212 | y3 = x3 ^ n30; 213 | y3 ^= n31; 214 | y3 ^= n32; 215 | y3 ^= n33; 216 | 217 | do { 218 | e ^= q3; 219 | x0 ^= e; 220 | x1 ^= x0; 221 | x2 ^= x1; 222 | x3 ^= x2; 223 | 224 | p00 = y0 >> 20; 225 | p01 = y0 >> 12; 226 | p02 = y0 >> 4; 227 | p03 = y0 << 4; 228 | p00 &= 4080; 229 | p01 &= 4080; 230 | p02 &= 4080; 231 | p03 &= 4080; 232 | p00 = *(uint32 *) (table0 + p00); 233 | p01 = *(uint32 *) (table1 + p01); 234 | p02 = *(uint32 *) (table2 + p02); 235 | p03 = *(uint32 *) (table3 + p03); 236 | z0 = x0 ^ p00; 237 | z3 = x3 ^ p01; 238 | z2 = x2 ^ p02; 239 | z1 = x1 ^ p03; 240 | 241 | p10 = y1 >> 20; 242 | p11 = y1 >> 12; 243 | p12 = y1 >> 4; 244 | p13 = y1 << 4; 245 | p10 &= 4080; 246 | p11 &= 4080; 247 | p12 &= 4080; 248 | p13 &= 4080; 249 | p10 = *(uint32 *) (table0 + p10); 250 | p11 = *(uint32 *) (table1 + p11); 251 | p12 = *(uint32 *) (table2 + p12); 252 | p13 = *(uint32 *) (table3 + p13); 253 | z1 ^= p10; 254 | z0 ^= p11; 255 | z3 ^= p12; 256 | z2 ^= p13; 257 | 258 | p20 = y2 >> 20; 259 | p21 = y2 >> 12; 260 | p22 = y2 >> 4; 261 | p23 = y2 << 4; 262 | p20 &= 4080; 263 | p21 &= 4080; 264 | p22 &= 4080; 265 | p23 &= 4080; 266 | p20 = *(uint32 *) (table0 + p20); 267 | p21 = *(uint32 *) (table1 + p21); 268 | p22 = *(uint32 *) (table2 + p22); 269 | p23 = *(uint32 *) (table3 + p23); 270 | z2 ^= p20; 271 | z1 ^= p21; 272 | z0 ^= p22; 273 | z3 ^= p23; 274 | 275 | p31 = y3 >> 12; 276 | p32 = y3 >> 4; 277 | p33 = y3 << 4; 278 | p30 = y3 >> 20; 279 | p31 &= 4080; 280 | p32 &= 4080; 281 | p33 &= 4080; 282 | p30 &= 4080; 283 | p31 = *(uint32 *) (table1 + p31); 284 | p32 = *(uint32 *) (table2 + p32); 285 | p33 = *(uint32 *) (table3 + p33); 286 | p30 = *(uint32 *) (table0 + p30); 287 | y2 = z2 ^ p31; 288 | y1 = z1 ^ p32; 289 | y0 = z0 ^ p33; 290 | y3 = z3 ^ p30; 291 | 292 | e = *(uint32 *) (table0 + loop4); 293 | 294 | q0 = x3 >> 12; 295 | q1 = x3 >> 4; 296 | q2 = x3 << 4; 297 | q3 = x3 >> 20; 298 | q0 &= 4080; 299 | q1 &= 4080; 300 | q2 &= 4080; 301 | q3 &= 4080; 302 | q0 = *(uint32 *) (table2 + q0); 303 | q1 = *(uint32 *) (table3 + q1); 304 | q2 = *(uint32 *) (table0 + q2); 305 | q3 = *(uint32 *) (table1 + q3); 306 | q0 &= byte3; 307 | q1 &= byte2; 308 | q2 &= byte1; 309 | q3 &= byte0; 310 | e ^= q0; 311 | e ^= q1; 312 | e ^= q2; 313 | 314 | loop4 += 4; 315 | } while (loop4); 316 | 317 | e = e ^ q3; 318 | x0 ^= e; 319 | x1 ^= x0; 320 | x2 ^= x1; 321 | x3 ^= x2; 322 | 323 | p00 = y0 >> 20; 324 | p01 = y0 >> 12; 325 | p02 = y0 >> 4; 326 | p03 = y0 << 4; 327 | p00 &= 4080; 328 | p01 &= 4080; 329 | p02 &= 4080; 330 | p03 &= 4080; 331 | p00 = *(uint32 *) (table2 + p00); 332 | p01 = *(uint32 *) (table3 + p01); 333 | p02 = *(uint32 *) (table0 + p02); 334 | p03 = *(uint32 *) (table1 + p03); 335 | p00 &= byte3; 336 | p01 &= byte2; 337 | p02 &= byte1; 338 | p03 &= byte0; 339 | z0 = x0 ^ p00; 340 | z3 = x3 ^ p01; 341 | z2 = x2 ^ p02; 342 | z1 = x1 ^ p03; 343 | 344 | p10 = y1 >> 20; 345 | p11 = y1 >> 12; 346 | p12 = y1 >> 4; 347 | p13 = y1 << 4; 348 | p10 &= 4080; 349 | p11 &= 4080; 350 | p12 &= 4080; 351 | p13 &= 4080; 352 | p10 = *(uint32 *) (table2 + p10); 353 | p11 = *(uint32 *) (table3 + p11); 354 | p12 = *(uint32 *) (table0 + p12); 355 | p13 = *(uint32 *) (table1 + p13); 356 | p10 &= byte3; 357 | p11 &= byte2; 358 | p12 &= byte1; 359 | p13 &= byte0; 360 | z1 ^= p10; 361 | z0 ^= p11; 362 | z3 ^= p12; 363 | z2 ^= p13; 364 | 365 | p20 = y2 >> 20; 366 | p21 = y2 >> 12; 367 | p22 = y2 >> 4; 368 | p23 = y2 << 4; 369 | p20 &= 4080; 370 | p21 &= 4080; 371 | p22 &= 4080; 372 | p23 &= 4080; 373 | p20 = *(uint32 *) (table2 + p20); 374 | p21 = *(uint32 *) (table3 + p21); 375 | p22 = *(uint32 *) (table0 + p22); 376 | p23 = *(uint32 *) (table1 + p23); 377 | p20 &= byte3; 378 | p21 &= byte2; 379 | p22 &= byte1; 380 | p23 &= byte0; 381 | z3 ^= p23; 382 | z2 ^= p20; 383 | z1 ^= p21; 384 | z0 ^= p22; 385 | 386 | p30 = y3 >> 20; 387 | p31 = y3 >> 12; 388 | p32 = y3 >> 4; 389 | p33 = y3 << 4; 390 | p30 &= 4080; 391 | p31 &= 4080; 392 | p32 &= 4080; 393 | p33 &= 4080; 394 | p30 = *(uint32 *) (table2 + p30); 395 | p31 = *(uint32 *) (table3 + p31); 396 | p32 = *(uint32 *) (table0 + p32); 397 | p33 = *(uint32 *) (table1 + p33); 398 | p30 &= byte3; 399 | p31 &= byte2; 400 | p32 &= byte1; 401 | p33 &= byte0; 402 | y3 = z3 ^ p30; 403 | y2 = z2 ^ p31; 404 | y1 = z1 ^ p32; 405 | y0 = z0 ^ p33; 406 | 407 | *(uchar *) (out + 3) = y0; 408 | y0 >>= 8; 409 | *(uchar *) (out + 2) = y0; 410 | y0 >>= 8; 411 | *(uchar *) (out + 1) = y0; 412 | y0 >>= 8; 413 | *(uchar *) (out + 0) = y0; 414 | 415 | *(uchar *) (out + 7) = y1; 416 | y1 >>= 8; 417 | *(uchar *) (out + 6) = y1; 418 | y1 >>= 8; 419 | *(uchar *) (out + 5) = y1; 420 | y1 >>= 8; 421 | *(uchar *) (out + 4) = y1; 422 | 423 | *(uchar *) (out + 11) = y2; 424 | y2 >>= 8; 425 | *(uchar *) (out + 10) = y2; 426 | y2 >>= 8; 427 | *(uchar *) (out + 9) = y2; 428 | y2 >>= 8; 429 | *(uchar *) (out + 8) = y2; 430 | 431 | *(uchar *) (out + 15) = y3; 432 | y3 >>= 8; 433 | *(uchar *) (out + 14) = y3; 434 | y3 >>= 8; 435 | *(uchar *) (out + 13) = y3; 436 | y3 >>= 8; 437 | *(uchar *) (out + 12) = y3; 438 | } 439 | -------------------------------------------------------------------------------- /c_src/poly1305aes/poly1305aes_sparc_isequal.s: -------------------------------------------------------------------------------- 1 | # poly1305aes_sparc_isequal.s version 20050131 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | # translated by qhasm-sparc version 20050131 6 | 7 | # input line 1: register int64 d 8 | 9 | # input line 2: register int64 x 10 | 11 | # input line 3: register int64 y 12 | 13 | # input line 4: register int64 x0 14 | 15 | # input line 5: register int64 x1 16 | 17 | # input line 6: register int64 x2 18 | 19 | # input line 7: register int64 x3 20 | 21 | # input line 8: register int64 x4 22 | 23 | # input line 9: register int64 x5 24 | 25 | # input line 10: register int64 x6 26 | 27 | # input line 11: register int64 x7 28 | 29 | # input line 12: register int64 x8 30 | 31 | # input line 13: register int64 x9 32 | 33 | # input line 14: register int64 x10 34 | 35 | # input line 15: register int64 x11 36 | 37 | # input line 16: register int64 x12 38 | 39 | # input line 17: register int64 x13 40 | 41 | # input line 18: register int64 x14 42 | 43 | # input line 19: register int64 x15 44 | 45 | # input line 20: register int64 y0 46 | 47 | # input line 21: register int64 y1 48 | 49 | # input line 22: register int64 y2 50 | 51 | # input line 23: register int64 y3 52 | 53 | # input line 24: register int64 y4 54 | 55 | # input line 25: register int64 y5 56 | 57 | # input line 26: register int64 y6 58 | 59 | # input line 27: register int64 y7 60 | 61 | # input line 28: register int64 y8 62 | 63 | # input line 29: register int64 y9 64 | 65 | # input line 30: register int64 y10 66 | 67 | # input line 31: register int64 y11 68 | 69 | # input line 32: register int64 y12 70 | 71 | # input line 33: register int64 y13 72 | 73 | # input line 34: register int64 y14 74 | 75 | # input line 35: register int64 y15 76 | 77 | # input line 36: 78 | 79 | # input line 37: enter poly1305aes_sparc_isequal 80 | .section ".text" 81 | .align 32 82 | .global poly1305aes_sparc_isequal 83 | poly1305aes_sparc_isequal: 84 | save %sp,-176,%sp 85 | 86 | # input line 38: input x 87 | 88 | # input line 39: input y 89 | 90 | # input line 40: 91 | 92 | # input line 41: x0 = *(uchar *) (x + 0) 93 | # x0!%l0 = *(uchar *) (x!%i0 + 0) 94 | ldub [%i0+0],%l0 95 | # live registers: 3 int64, 0 double 96 | 97 | # input line 42: y0 = *(uchar *) (y + 0) 98 | # y0!%l3 = *(uchar *) (y!%i1 + 0) 99 | ldub [%i1+0],%l3 100 | # live registers: 4 int64, 0 double 101 | 102 | # input line 43: x1 = *(uchar *) (x + 1) 103 | # x1!%l1 = *(uchar *) (x!%i0 + 1) 104 | ldub [%i0+1],%l1 105 | # live registers: 5 int64, 0 double 106 | 107 | # input line 44: y1 = *(uchar *) (y + 1) 108 | # y1!%l4 = *(uchar *) (y!%i1 + 1) 109 | ldub [%i1+1],%l4 110 | # live registers: 6 int64, 0 double 111 | 112 | # input line 45: x2 = *(uchar *) (x + 2) 113 | # x2!%l2 = *(uchar *) (x!%i0 + 2) 114 | ldub [%i0+2],%l2 115 | # live registers: 7 int64, 0 double 116 | 117 | # input line 46: y2 = *(uchar *) (y + 2) 118 | # y2!%l5 = *(uchar *) (y!%i1 + 2) 119 | ldub [%i1+2],%l5 120 | # live registers: 8 int64, 0 double 121 | 122 | # input line 47: d = y0 ^ x0 123 | # d#2!%l0 = y0!%l3 ^ x0!%l0 124 | xor %l3,%l0,%l0 125 | # live registers: 7 int64, 0 double 126 | 127 | # input line 48: x3 = *(uchar *) (x + 3) 128 | # x3!%l3 = *(uchar *) (x!%i0 + 3) 129 | ldub [%i0+3],%l3 130 | # live registers: 8 int64, 0 double 131 | 132 | # input line 49: y1 ^= x1 133 | # y1#2!%l1 = y1!%l4 ^ x1!%l1 134 | xor %l4,%l1,%l1 135 | # live registers: 7 int64, 0 double 136 | 137 | # input line 50: y3 = *(uchar *) (y + 3) 138 | # y3!%l4 = *(uchar *) (y!%i1 + 3) 139 | ldub [%i1+3],%l4 140 | # live registers: 8 int64, 0 double 141 | 142 | # input line 51: d |= y1 143 | # d#3!%l0 = d#2!%l0 | y1#2!%l1 144 | or %l0,%l1,%l0 145 | # live registers: 7 int64, 0 double 146 | 147 | # input line 52: x4 = *(uchar *) (x + 4) 148 | # x4!%l1 = *(uchar *) (x!%i0 + 4) 149 | ldub [%i0+4],%l1 150 | # live registers: 8 int64, 0 double 151 | 152 | # input line 53: y2 ^= x2 153 | # y2#2!%l2 = y2!%l5 ^ x2!%l2 154 | xor %l5,%l2,%l2 155 | # live registers: 7 int64, 0 double 156 | 157 | # input line 54: y4 = *(uchar *) (y + 4) 158 | # y4!%l5 = *(uchar *) (y!%i1 + 4) 159 | ldub [%i1+4],%l5 160 | # live registers: 8 int64, 0 double 161 | 162 | # input line 55: d |= y2 163 | # d#4!%l0 = d#3!%l0 | y2#2!%l2 164 | or %l0,%l2,%l0 165 | # live registers: 7 int64, 0 double 166 | 167 | # input line 56: x5 = *(uchar *) (x + 5) 168 | # x5!%l2 = *(uchar *) (x!%i0 + 5) 169 | ldub [%i0+5],%l2 170 | # live registers: 8 int64, 0 double 171 | 172 | # input line 57: y3 ^= x3 173 | # y3#2!%l3 = y3!%l4 ^ x3!%l3 174 | xor %l4,%l3,%l3 175 | # live registers: 7 int64, 0 double 176 | 177 | # input line 58: y5 = *(uchar *) (y + 5) 178 | # y5!%l4 = *(uchar *) (y!%i1 + 5) 179 | ldub [%i1+5],%l4 180 | # live registers: 8 int64, 0 double 181 | 182 | # input line 59: d |= y3 183 | # d#5!%l0 = d#4!%l0 | y3#2!%l3 184 | or %l0,%l3,%l0 185 | # live registers: 7 int64, 0 double 186 | 187 | # input line 60: x6 = *(uchar *) (x + 6) 188 | # x6!%l3 = *(uchar *) (x!%i0 + 6) 189 | ldub [%i0+6],%l3 190 | # live registers: 8 int64, 0 double 191 | 192 | # input line 61: y4 ^= x4 193 | # y4#2!%l1 = y4!%l5 ^ x4!%l1 194 | xor %l5,%l1,%l1 195 | # live registers: 7 int64, 0 double 196 | 197 | # input line 62: y6 = *(uchar *) (y + 6) 198 | # y6!%l5 = *(uchar *) (y!%i1 + 6) 199 | ldub [%i1+6],%l5 200 | # live registers: 8 int64, 0 double 201 | 202 | # input line 63: d |= y4 203 | # d#6!%l0 = d#5!%l0 | y4#2!%l1 204 | or %l0,%l1,%l0 205 | # live registers: 7 int64, 0 double 206 | 207 | # input line 64: x7 = *(uchar *) (x + 7) 208 | # x7!%l1 = *(uchar *) (x!%i0 + 7) 209 | ldub [%i0+7],%l1 210 | # live registers: 8 int64, 0 double 211 | 212 | # input line 65: y5 ^= x5 213 | # y5#2!%l2 = y5!%l4 ^ x5!%l2 214 | xor %l4,%l2,%l2 215 | # live registers: 7 int64, 0 double 216 | 217 | # input line 66: y7 = *(uchar *) (y + 7) 218 | # y7!%l4 = *(uchar *) (y!%i1 + 7) 219 | ldub [%i1+7],%l4 220 | # live registers: 8 int64, 0 double 221 | 222 | # input line 67: d |= y5 223 | # d#7!%l0 = d#6!%l0 | y5#2!%l2 224 | or %l0,%l2,%l0 225 | # live registers: 7 int64, 0 double 226 | 227 | # input line 68: x8 = *(uchar *) (x + 8) 228 | # x8!%l2 = *(uchar *) (x!%i0 + 8) 229 | ldub [%i0+8],%l2 230 | # live registers: 8 int64, 0 double 231 | 232 | # input line 69: y6 ^= x6 233 | # y6#2!%l3 = y6!%l5 ^ x6!%l3 234 | xor %l5,%l3,%l3 235 | # live registers: 7 int64, 0 double 236 | 237 | # input line 70: y8 = *(uchar *) (y + 8) 238 | # y8!%l5 = *(uchar *) (y!%i1 + 8) 239 | ldub [%i1+8],%l5 240 | # live registers: 8 int64, 0 double 241 | 242 | # input line 71: d |= y6 243 | # d#8!%l0 = d#7!%l0 | y6#2!%l3 244 | or %l0,%l3,%l0 245 | # live registers: 7 int64, 0 double 246 | 247 | # input line 72: x9 = *(uchar *) (x + 9) 248 | # x9!%l3 = *(uchar *) (x!%i0 + 9) 249 | ldub [%i0+9],%l3 250 | # live registers: 8 int64, 0 double 251 | 252 | # input line 73: y7 ^= x7 253 | # y7#2!%l1 = y7!%l4 ^ x7!%l1 254 | xor %l4,%l1,%l1 255 | # live registers: 7 int64, 0 double 256 | 257 | # input line 74: y9 = *(uchar *) (y + 9) 258 | # y9!%l4 = *(uchar *) (y!%i1 + 9) 259 | ldub [%i1+9],%l4 260 | # live registers: 8 int64, 0 double 261 | 262 | # input line 75: d |= y7 263 | # d#9!%l0 = d#8!%l0 | y7#2!%l1 264 | or %l0,%l1,%l0 265 | # live registers: 7 int64, 0 double 266 | 267 | # input line 76: x10 = *(uchar *) (x + 10) 268 | # x10!%l1 = *(uchar *) (x!%i0 + 10) 269 | ldub [%i0+10],%l1 270 | # live registers: 8 int64, 0 double 271 | 272 | # input line 77: y8 ^= x8 273 | # y8#2!%l2 = y8!%l5 ^ x8!%l2 274 | xor %l5,%l2,%l2 275 | # live registers: 7 int64, 0 double 276 | 277 | # input line 78: y10 = *(uchar *) (y + 10) 278 | # y10!%l5 = *(uchar *) (y!%i1 + 10) 279 | ldub [%i1+10],%l5 280 | # live registers: 8 int64, 0 double 281 | 282 | # input line 79: d |= y8 283 | # d#10!%l0 = d#9!%l0 | y8#2!%l2 284 | or %l0,%l2,%l0 285 | # live registers: 7 int64, 0 double 286 | 287 | # input line 80: x11 = *(uchar *) (x + 11) 288 | # x11!%l2 = *(uchar *) (x!%i0 + 11) 289 | ldub [%i0+11],%l2 290 | # live registers: 8 int64, 0 double 291 | 292 | # input line 81: y9 ^= x9 293 | # y9#2!%l3 = y9!%l4 ^ x9!%l3 294 | xor %l4,%l3,%l3 295 | # live registers: 7 int64, 0 double 296 | 297 | # input line 82: y11 = *(uchar *) (y + 11) 298 | # y11!%l4 = *(uchar *) (y!%i1 + 11) 299 | ldub [%i1+11],%l4 300 | # live registers: 8 int64, 0 double 301 | 302 | # input line 83: d |= y9 303 | # d#11!%l0 = d#10!%l0 | y9#2!%l3 304 | or %l0,%l3,%l0 305 | # live registers: 7 int64, 0 double 306 | 307 | # input line 84: x12 = *(uchar *) (x + 12) 308 | # x12!%l3 = *(uchar *) (x!%i0 + 12) 309 | ldub [%i0+12],%l3 310 | # live registers: 8 int64, 0 double 311 | 312 | # input line 85: y10 ^= x10 313 | # y10#2!%l1 = y10!%l5 ^ x10!%l1 314 | xor %l5,%l1,%l1 315 | # live registers: 7 int64, 0 double 316 | 317 | # input line 86: y12 = *(uchar *) (y + 12) 318 | # y12!%l5 = *(uchar *) (y!%i1 + 12) 319 | ldub [%i1+12],%l5 320 | # live registers: 8 int64, 0 double 321 | 322 | # input line 87: d |= y10 323 | # d#12!%l0 = d#11!%l0 | y10#2!%l1 324 | or %l0,%l1,%l0 325 | # live registers: 7 int64, 0 double 326 | 327 | # input line 88: x13 = *(uchar *) (x + 13) 328 | # x13!%l1 = *(uchar *) (x!%i0 + 13) 329 | ldub [%i0+13],%l1 330 | # live registers: 8 int64, 0 double 331 | 332 | # input line 89: y11 ^= x11 333 | # y11#2!%l2 = y11!%l4 ^ x11!%l2 334 | xor %l4,%l2,%l2 335 | # live registers: 7 int64, 0 double 336 | 337 | # input line 90: y13 = *(uchar *) (y + 13) 338 | # y13!%l4 = *(uchar *) (y!%i1 + 13) 339 | ldub [%i1+13],%l4 340 | # live registers: 8 int64, 0 double 341 | 342 | # input line 91: d |= y11 343 | # d#13!%l0 = d#12!%l0 | y11#2!%l2 344 | or %l0,%l2,%l0 345 | # live registers: 7 int64, 0 double 346 | 347 | # input line 92: x14 = *(uchar *) (x + 14) 348 | # x14!%l2 = *(uchar *) (x!%i0 + 14) 349 | ldub [%i0+14],%l2 350 | # live registers: 8 int64, 0 double 351 | 352 | # input line 93: y12 ^= x12 353 | # y12#2!%l3 = y12!%l5 ^ x12!%l3 354 | xor %l5,%l3,%l3 355 | # live registers: 7 int64, 0 double 356 | 357 | # input line 94: y14 = *(uchar *) (y + 14) 358 | # y14!%l5 = *(uchar *) (y!%i1 + 14) 359 | ldub [%i1+14],%l5 360 | # live registers: 8 int64, 0 double 361 | 362 | # input line 95: d |= y12 363 | # d#14!%l0 = d#13!%l0 | y12#2!%l3 364 | or %l0,%l3,%l0 365 | # live registers: 7 int64, 0 double 366 | 367 | # input line 96: x15 = *(uchar *) (x + 15) 368 | # x15!%l3 = *(uchar *) (x!%i0 + 15) 369 | ldub [%i0+15],%l3 370 | # live registers: 7 int64, 0 double 371 | 372 | # input line 97: y13 ^= x13 373 | # y13#2!%l1 = y13!%l4 ^ x13!%l1 374 | xor %l4,%l1,%l1 375 | # live registers: 6 int64, 0 double 376 | 377 | # input line 98: y15 = *(uchar *) (y + 15) 378 | # y15!%l4 = *(uchar *) (y!%i1 + 15) 379 | ldub [%i1+15],%l4 380 | # live registers: 6 int64, 0 double 381 | 382 | # input line 99: d |= y13 383 | # d#15!%l0 = d#14!%l0 | y13#2!%l1 384 | or %l0,%l1,%l0 385 | # live registers: 5 int64, 0 double 386 | 387 | # input line 100: y14 ^= x14 388 | # y14#2!%l1 = y14!%l5 ^ x14!%l2 389 | xor %l5,%l2,%l1 390 | # live registers: 4 int64, 0 double 391 | 392 | # input line 101: d |= y14 393 | # d#16!%l0 = d#15!%l0 | y14#2!%l1 394 | or %l0,%l1,%l0 395 | # live registers: 3 int64, 0 double 396 | 397 | # input line 102: y15 ^= x15 398 | # y15#2!%l1 = y15!%l4 ^ x15!%l3 399 | xor %l4,%l3,%l1 400 | # live registers: 2 int64, 0 double 401 | 402 | # input line 103: d |= y15 403 | # d#17!%l0 = d#16!%l0 | y15#2!%l1 404 | or %l0,%l1,%l0 405 | # live registers: 1 int64, 0 double 406 | 407 | # input line 104: d -= 1 408 | # d#18!%l0 = d#17!%l0 - 1 409 | sub %l0,1,%l0 410 | # live registers: 1 int64, 0 double 411 | 412 | # input line 105: (uint64) d >>= 8 413 | # d!%i0 = (uint64) d#18!%l0 >> 8 414 | srlx %l0,8,%i0 415 | # live registers: 1 int64, 0 double 416 | 417 | # input line 106: 418 | 419 | # input line 107: output d 420 | 421 | # input line 108: leave 422 | ret 423 | restore 424 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_ppro_constants.s: -------------------------------------------------------------------------------- 1 | # aes_ppro_constants.s version 20050213 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .data 6 | .section .rodata 7 | .p2align 5 8 | .globl aes_ppro_constants 9 | .globl aes_ppro_table0 10 | .globl aes_ppro_table1 11 | .globl aes_ppro_table2 12 | .globl aes_ppro_table3 13 | 14 | aes_ppro_constants: 15 | aes_ppro_table0: 16 | .byte 0xc6 17 | aes_ppro_table3: 18 | .byte 0x63 19 | aes_ppro_table2: 20 | .byte 0x63 21 | aes_ppro_table1: 22 | .byte 0xa5 23 | .long 0xa56363c6 24 | .long 0x847c7cf8 25 | .long 0x847c7cf8 26 | .long 0x997777ee 27 | .long 0x997777ee 28 | .long 0x8d7b7bf6 29 | .long 0x8d7b7bf6 30 | .long 0x0df2f2ff 31 | .long 0x0df2f2ff 32 | .long 0xbd6b6bd6 33 | .long 0xbd6b6bd6 34 | .long 0xb16f6fde 35 | .long 0xb16f6fde 36 | .long 0x54c5c591 37 | .long 0x54c5c591 38 | .long 0x50303060 39 | .long 0x50303060 40 | .long 0x03010102 41 | .long 0x03010102 42 | .long 0xa96767ce 43 | .long 0xa96767ce 44 | .long 0x7d2b2b56 45 | .long 0x7d2b2b56 46 | .long 0x19fefee7 47 | .long 0x19fefee7 48 | .long 0x62d7d7b5 49 | .long 0x62d7d7b5 50 | .long 0xe6abab4d 51 | .long 0xe6abab4d 52 | .long 0x9a7676ec 53 | .long 0x9a7676ec 54 | .long 0x45caca8f 55 | .long 0x45caca8f 56 | .long 0x9d82821f 57 | .long 0x9d82821f 58 | .long 0x40c9c989 59 | .long 0x40c9c989 60 | .long 0x877d7dfa 61 | .long 0x877d7dfa 62 | .long 0x15fafaef 63 | .long 0x15fafaef 64 | .long 0xeb5959b2 65 | .long 0xeb5959b2 66 | .long 0xc947478e 67 | .long 0xc947478e 68 | .long 0x0bf0f0fb 69 | .long 0x0bf0f0fb 70 | .long 0xecadad41 71 | .long 0xecadad41 72 | .long 0x67d4d4b3 73 | .long 0x67d4d4b3 74 | .long 0xfda2a25f 75 | .long 0xfda2a25f 76 | .long 0xeaafaf45 77 | .long 0xeaafaf45 78 | .long 0xbf9c9c23 79 | .long 0xbf9c9c23 80 | .long 0xf7a4a453 81 | .long 0xf7a4a453 82 | .long 0x967272e4 83 | .long 0x967272e4 84 | .long 0x5bc0c09b 85 | .long 0x5bc0c09b 86 | .long 0xc2b7b775 87 | .long 0xc2b7b775 88 | .long 0x1cfdfde1 89 | .long 0x1cfdfde1 90 | .long 0xae93933d 91 | .long 0xae93933d 92 | .long 0x6a26264c 93 | .long 0x6a26264c 94 | .long 0x5a36366c 95 | .long 0x5a36366c 96 | .long 0x413f3f7e 97 | .long 0x413f3f7e 98 | .long 0x02f7f7f5 99 | .long 0x02f7f7f5 100 | .long 0x4fcccc83 101 | .long 0x4fcccc83 102 | .long 0x5c343468 103 | .long 0x5c343468 104 | .long 0xf4a5a551 105 | .long 0xf4a5a551 106 | .long 0x34e5e5d1 107 | .long 0x34e5e5d1 108 | .long 0x08f1f1f9 109 | .long 0x08f1f1f9 110 | .long 0x937171e2 111 | .long 0x937171e2 112 | .long 0x73d8d8ab 113 | .long 0x73d8d8ab 114 | .long 0x53313162 115 | .long 0x53313162 116 | .long 0x3f15152a 117 | .long 0x3f15152a 118 | .long 0x0c040408 119 | .long 0x0c040408 120 | .long 0x52c7c795 121 | .long 0x52c7c795 122 | .long 0x65232346 123 | .long 0x65232346 124 | .long 0x5ec3c39d 125 | .long 0x5ec3c39d 126 | .long 0x28181830 127 | .long 0x28181830 128 | .long 0xa1969637 129 | .long 0xa1969637 130 | .long 0x0f05050a 131 | .long 0x0f05050a 132 | .long 0xb59a9a2f 133 | .long 0xb59a9a2f 134 | .long 0x0907070e 135 | .long 0x0907070e 136 | .long 0x36121224 137 | .long 0x36121224 138 | .long 0x9b80801b 139 | .long 0x9b80801b 140 | .long 0x3de2e2df 141 | .long 0x3de2e2df 142 | .long 0x26ebebcd 143 | .long 0x26ebebcd 144 | .long 0x6927274e 145 | .long 0x6927274e 146 | .long 0xcdb2b27f 147 | .long 0xcdb2b27f 148 | .long 0x9f7575ea 149 | .long 0x9f7575ea 150 | .long 0x1b090912 151 | .long 0x1b090912 152 | .long 0x9e83831d 153 | .long 0x9e83831d 154 | .long 0x742c2c58 155 | .long 0x742c2c58 156 | .long 0x2e1a1a34 157 | .long 0x2e1a1a34 158 | .long 0x2d1b1b36 159 | .long 0x2d1b1b36 160 | .long 0xb26e6edc 161 | .long 0xb26e6edc 162 | .long 0xee5a5ab4 163 | .long 0xee5a5ab4 164 | .long 0xfba0a05b 165 | .long 0xfba0a05b 166 | .long 0xf65252a4 167 | .long 0xf65252a4 168 | .long 0x4d3b3b76 169 | .long 0x4d3b3b76 170 | .long 0x61d6d6b7 171 | .long 0x61d6d6b7 172 | .long 0xceb3b37d 173 | .long 0xceb3b37d 174 | .long 0x7b292952 175 | .long 0x7b292952 176 | .long 0x3ee3e3dd 177 | .long 0x3ee3e3dd 178 | .long 0x712f2f5e 179 | .long 0x712f2f5e 180 | .long 0x97848413 181 | .long 0x97848413 182 | .long 0xf55353a6 183 | .long 0xf55353a6 184 | .long 0x68d1d1b9 185 | .long 0x68d1d1b9 186 | .long 0x00000000 187 | .long 0x00000000 188 | .long 0x2cededc1 189 | .long 0x2cededc1 190 | .long 0x60202040 191 | .long 0x60202040 192 | .long 0x1ffcfce3 193 | .long 0x1ffcfce3 194 | .long 0xc8b1b179 195 | .long 0xc8b1b179 196 | .long 0xed5b5bb6 197 | .long 0xed5b5bb6 198 | .long 0xbe6a6ad4 199 | .long 0xbe6a6ad4 200 | .long 0x46cbcb8d 201 | .long 0x46cbcb8d 202 | .long 0xd9bebe67 203 | .long 0xd9bebe67 204 | .long 0x4b393972 205 | .long 0x4b393972 206 | .long 0xde4a4a94 207 | .long 0xde4a4a94 208 | .long 0xd44c4c98 209 | .long 0xd44c4c98 210 | .long 0xe85858b0 211 | .long 0xe85858b0 212 | .long 0x4acfcf85 213 | .long 0x4acfcf85 214 | .long 0x6bd0d0bb 215 | .long 0x6bd0d0bb 216 | .long 0x2aefefc5 217 | .long 0x2aefefc5 218 | .long 0xe5aaaa4f 219 | .long 0xe5aaaa4f 220 | .long 0x16fbfbed 221 | .long 0x16fbfbed 222 | .long 0xc5434386 223 | .long 0xc5434386 224 | .long 0xd74d4d9a 225 | .long 0xd74d4d9a 226 | .long 0x55333366 227 | .long 0x55333366 228 | .long 0x94858511 229 | .long 0x94858511 230 | .long 0xcf45458a 231 | .long 0xcf45458a 232 | .long 0x10f9f9e9 233 | .long 0x10f9f9e9 234 | .long 0x06020204 235 | .long 0x06020204 236 | .long 0x817f7ffe 237 | .long 0x817f7ffe 238 | .long 0xf05050a0 239 | .long 0xf05050a0 240 | .long 0x443c3c78 241 | .long 0x443c3c78 242 | .long 0xba9f9f25 243 | .long 0xba9f9f25 244 | .long 0xe3a8a84b 245 | .long 0xe3a8a84b 246 | .long 0xf35151a2 247 | .long 0xf35151a2 248 | .long 0xfea3a35d 249 | .long 0xfea3a35d 250 | .long 0xc0404080 251 | .long 0xc0404080 252 | .long 0x8a8f8f05 253 | .long 0x8a8f8f05 254 | .long 0xad92923f 255 | .long 0xad92923f 256 | .long 0xbc9d9d21 257 | .long 0xbc9d9d21 258 | .long 0x48383870 259 | .long 0x48383870 260 | .long 0x04f5f5f1 261 | .long 0x04f5f5f1 262 | .long 0xdfbcbc63 263 | .long 0xdfbcbc63 264 | .long 0xc1b6b677 265 | .long 0xc1b6b677 266 | .long 0x75dadaaf 267 | .long 0x75dadaaf 268 | .long 0x63212142 269 | .long 0x63212142 270 | .long 0x30101020 271 | .long 0x30101020 272 | .long 0x1affffe5 273 | .long 0x1affffe5 274 | .long 0x0ef3f3fd 275 | .long 0x0ef3f3fd 276 | .long 0x6dd2d2bf 277 | .long 0x6dd2d2bf 278 | .long 0x4ccdcd81 279 | .long 0x4ccdcd81 280 | .long 0x140c0c18 281 | .long 0x140c0c18 282 | .long 0x35131326 283 | .long 0x35131326 284 | .long 0x2fececc3 285 | .long 0x2fececc3 286 | .long 0xe15f5fbe 287 | .long 0xe15f5fbe 288 | .long 0xa2979735 289 | .long 0xa2979735 290 | .long 0xcc444488 291 | .long 0xcc444488 292 | .long 0x3917172e 293 | .long 0x3917172e 294 | .long 0x57c4c493 295 | .long 0x57c4c493 296 | .long 0xf2a7a755 297 | .long 0xf2a7a755 298 | .long 0x827e7efc 299 | .long 0x827e7efc 300 | .long 0x473d3d7a 301 | .long 0x473d3d7a 302 | .long 0xac6464c8 303 | .long 0xac6464c8 304 | .long 0xe75d5dba 305 | .long 0xe75d5dba 306 | .long 0x2b191932 307 | .long 0x2b191932 308 | .long 0x957373e6 309 | .long 0x957373e6 310 | .long 0xa06060c0 311 | .long 0xa06060c0 312 | .long 0x98818119 313 | .long 0x98818119 314 | .long 0xd14f4f9e 315 | .long 0xd14f4f9e 316 | .long 0x7fdcdca3 317 | .long 0x7fdcdca3 318 | .long 0x66222244 319 | .long 0x66222244 320 | .long 0x7e2a2a54 321 | .long 0x7e2a2a54 322 | .long 0xab90903b 323 | .long 0xab90903b 324 | .long 0x8388880b 325 | .long 0x8388880b 326 | .long 0xca46468c 327 | .long 0xca46468c 328 | .long 0x29eeeec7 329 | .long 0x29eeeec7 330 | .long 0xd3b8b86b 331 | .long 0xd3b8b86b 332 | .long 0x3c141428 333 | .long 0x3c141428 334 | .long 0x79dedea7 335 | .long 0x79dedea7 336 | .long 0xe25e5ebc 337 | .long 0xe25e5ebc 338 | .long 0x1d0b0b16 339 | .long 0x1d0b0b16 340 | .long 0x76dbdbad 341 | .long 0x76dbdbad 342 | .long 0x3be0e0db 343 | .long 0x3be0e0db 344 | .long 0x56323264 345 | .long 0x56323264 346 | .long 0x4e3a3a74 347 | .long 0x4e3a3a74 348 | .long 0x1e0a0a14 349 | .long 0x1e0a0a14 350 | .long 0xdb494992 351 | .long 0xdb494992 352 | .long 0x0a06060c 353 | .long 0x0a06060c 354 | .long 0x6c242448 355 | .long 0x6c242448 356 | .long 0xe45c5cb8 357 | .long 0xe45c5cb8 358 | .long 0x5dc2c29f 359 | .long 0x5dc2c29f 360 | .long 0x6ed3d3bd 361 | .long 0x6ed3d3bd 362 | .long 0xefacac43 363 | .long 0xefacac43 364 | .long 0xa66262c4 365 | .long 0xa66262c4 366 | .long 0xa8919139 367 | .long 0xa8919139 368 | .long 0xa4959531 369 | .long 0xa4959531 370 | .long 0x37e4e4d3 371 | .long 0x37e4e4d3 372 | .long 0x8b7979f2 373 | .long 0x8b7979f2 374 | .long 0x32e7e7d5 375 | .long 0x32e7e7d5 376 | .long 0x43c8c88b 377 | .long 0x43c8c88b 378 | .long 0x5937376e 379 | .long 0x5937376e 380 | .long 0xb76d6dda 381 | .long 0xb76d6dda 382 | .long 0x8c8d8d01 383 | .long 0x8c8d8d01 384 | .long 0x64d5d5b1 385 | .long 0x64d5d5b1 386 | .long 0xd24e4e9c 387 | .long 0xd24e4e9c 388 | .long 0xe0a9a949 389 | .long 0xe0a9a949 390 | .long 0xb46c6cd8 391 | .long 0xb46c6cd8 392 | .long 0xfa5656ac 393 | .long 0xfa5656ac 394 | .long 0x07f4f4f3 395 | .long 0x07f4f4f3 396 | .long 0x25eaeacf 397 | .long 0x25eaeacf 398 | .long 0xaf6565ca 399 | .long 0xaf6565ca 400 | .long 0x8e7a7af4 401 | .long 0x8e7a7af4 402 | .long 0xe9aeae47 403 | .long 0xe9aeae47 404 | .long 0x18080810 405 | .long 0x18080810 406 | .long 0xd5baba6f 407 | .long 0xd5baba6f 408 | .long 0x887878f0 409 | .long 0x887878f0 410 | .long 0x6f25254a 411 | .long 0x6f25254a 412 | .long 0x722e2e5c 413 | .long 0x722e2e5c 414 | .long 0x241c1c38 415 | .long 0x241c1c38 416 | .long 0xf1a6a657 417 | .long 0xf1a6a657 418 | .long 0xc7b4b473 419 | .long 0xc7b4b473 420 | .long 0x51c6c697 421 | .long 0x51c6c697 422 | .long 0x23e8e8cb 423 | .long 0x23e8e8cb 424 | .long 0x7cdddda1 425 | .long 0x7cdddda1 426 | .long 0x9c7474e8 427 | .long 0x9c7474e8 428 | .long 0x211f1f3e 429 | .long 0x211f1f3e 430 | .long 0xdd4b4b96 431 | .long 0xdd4b4b96 432 | .long 0xdcbdbd61 433 | .long 0xdcbdbd61 434 | .long 0x868b8b0d 435 | .long 0x868b8b0d 436 | .long 0x858a8a0f 437 | .long 0x858a8a0f 438 | .long 0x907070e0 439 | .long 0x907070e0 440 | .long 0x423e3e7c 441 | .long 0x423e3e7c 442 | .long 0xc4b5b571 443 | .long 0xc4b5b571 444 | .long 0xaa6666cc 445 | .long 0xaa6666cc 446 | .long 0xd8484890 447 | .long 0xd8484890 448 | .long 0x05030306 449 | .long 0x05030306 450 | .long 0x01f6f6f7 451 | .long 0x01f6f6f7 452 | .long 0x120e0e1c 453 | .long 0x120e0e1c 454 | .long 0xa36161c2 455 | .long 0xa36161c2 456 | .long 0x5f35356a 457 | .long 0x5f35356a 458 | .long 0xf95757ae 459 | .long 0xf95757ae 460 | .long 0xd0b9b969 461 | .long 0xd0b9b969 462 | .long 0x91868617 463 | .long 0x91868617 464 | .long 0x58c1c199 465 | .long 0x58c1c199 466 | .long 0x271d1d3a 467 | .long 0x271d1d3a 468 | .long 0xb99e9e27 469 | .long 0xb99e9e27 470 | .long 0x38e1e1d9 471 | .long 0x38e1e1d9 472 | .long 0x13f8f8eb 473 | .long 0x13f8f8eb 474 | .long 0xb398982b 475 | .long 0xb398982b 476 | .long 0x33111122 477 | .long 0x33111122 478 | .long 0xbb6969d2 479 | .long 0xbb6969d2 480 | .long 0x70d9d9a9 481 | .long 0x70d9d9a9 482 | .long 0x898e8e07 483 | .long 0x898e8e07 484 | .long 0xa7949433 485 | .long 0xa7949433 486 | .long 0xb69b9b2d 487 | .long 0xb69b9b2d 488 | .long 0x221e1e3c 489 | .long 0x221e1e3c 490 | .long 0x92878715 491 | .long 0x92878715 492 | .long 0x20e9e9c9 493 | .long 0x20e9e9c9 494 | .long 0x49cece87 495 | .long 0x49cece87 496 | .long 0xff5555aa 497 | .long 0xff5555aa 498 | .long 0x78282850 499 | .long 0x78282850 500 | .long 0x7adfdfa5 501 | .long 0x7adfdfa5 502 | .long 0x8f8c8c03 503 | .long 0x8f8c8c03 504 | .long 0xf8a1a159 505 | .long 0xf8a1a159 506 | .long 0x80898909 507 | .long 0x80898909 508 | .long 0x170d0d1a 509 | .long 0x170d0d1a 510 | .long 0xdabfbf65 511 | .long 0xdabfbf65 512 | .long 0x31e6e6d7 513 | .long 0x31e6e6d7 514 | .long 0xc6424284 515 | .long 0xc6424284 516 | .long 0xb86868d0 517 | .long 0xb86868d0 518 | .long 0xc3414182 519 | .long 0xc3414182 520 | .long 0xb0999929 521 | .long 0xb0999929 522 | .long 0x772d2d5a 523 | .long 0x772d2d5a 524 | .long 0x110f0f1e 525 | .long 0x110f0f1e 526 | .long 0xcbb0b07b 527 | .long 0xcbb0b07b 528 | .long 0xfc5454a8 529 | .long 0xfc5454a8 530 | .long 0xd6bbbb6d 531 | .long 0xd6bbbb6d 532 | .long 0x3a16162c 533 | .long 0x3a16162c 534 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_athlon_constants.s: -------------------------------------------------------------------------------- 1 | # aes_athlon_constants.s version 20050218 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .data 6 | .section .rodata 7 | .p2align 5 8 | .globl aes_athlon_constants 9 | .globl aes_athlon_table0 10 | .globl aes_athlon_table1 11 | .globl aes_athlon_table2 12 | .globl aes_athlon_table3 13 | 14 | aes_athlon_constants: 15 | aes_athlon_table0: 16 | .byte 0xc6 17 | aes_athlon_table3: 18 | .byte 0x63 19 | aes_athlon_table2: 20 | .byte 0x63 21 | aes_athlon_table1: 22 | .byte 0xa5 23 | .long 0xa56363c6 24 | .long 0x847c7cf8 25 | .long 0x847c7cf8 26 | .long 0x997777ee 27 | .long 0x997777ee 28 | .long 0x8d7b7bf6 29 | .long 0x8d7b7bf6 30 | .long 0x0df2f2ff 31 | .long 0x0df2f2ff 32 | .long 0xbd6b6bd6 33 | .long 0xbd6b6bd6 34 | .long 0xb16f6fde 35 | .long 0xb16f6fde 36 | .long 0x54c5c591 37 | .long 0x54c5c591 38 | .long 0x50303060 39 | .long 0x50303060 40 | .long 0x03010102 41 | .long 0x03010102 42 | .long 0xa96767ce 43 | .long 0xa96767ce 44 | .long 0x7d2b2b56 45 | .long 0x7d2b2b56 46 | .long 0x19fefee7 47 | .long 0x19fefee7 48 | .long 0x62d7d7b5 49 | .long 0x62d7d7b5 50 | .long 0xe6abab4d 51 | .long 0xe6abab4d 52 | .long 0x9a7676ec 53 | .long 0x9a7676ec 54 | .long 0x45caca8f 55 | .long 0x45caca8f 56 | .long 0x9d82821f 57 | .long 0x9d82821f 58 | .long 0x40c9c989 59 | .long 0x40c9c989 60 | .long 0x877d7dfa 61 | .long 0x877d7dfa 62 | .long 0x15fafaef 63 | .long 0x15fafaef 64 | .long 0xeb5959b2 65 | .long 0xeb5959b2 66 | .long 0xc947478e 67 | .long 0xc947478e 68 | .long 0x0bf0f0fb 69 | .long 0x0bf0f0fb 70 | .long 0xecadad41 71 | .long 0xecadad41 72 | .long 0x67d4d4b3 73 | .long 0x67d4d4b3 74 | .long 0xfda2a25f 75 | .long 0xfda2a25f 76 | .long 0xeaafaf45 77 | .long 0xeaafaf45 78 | .long 0xbf9c9c23 79 | .long 0xbf9c9c23 80 | .long 0xf7a4a453 81 | .long 0xf7a4a453 82 | .long 0x967272e4 83 | .long 0x967272e4 84 | .long 0x5bc0c09b 85 | .long 0x5bc0c09b 86 | .long 0xc2b7b775 87 | .long 0xc2b7b775 88 | .long 0x1cfdfde1 89 | .long 0x1cfdfde1 90 | .long 0xae93933d 91 | .long 0xae93933d 92 | .long 0x6a26264c 93 | .long 0x6a26264c 94 | .long 0x5a36366c 95 | .long 0x5a36366c 96 | .long 0x413f3f7e 97 | .long 0x413f3f7e 98 | .long 0x02f7f7f5 99 | .long 0x02f7f7f5 100 | .long 0x4fcccc83 101 | .long 0x4fcccc83 102 | .long 0x5c343468 103 | .long 0x5c343468 104 | .long 0xf4a5a551 105 | .long 0xf4a5a551 106 | .long 0x34e5e5d1 107 | .long 0x34e5e5d1 108 | .long 0x08f1f1f9 109 | .long 0x08f1f1f9 110 | .long 0x937171e2 111 | .long 0x937171e2 112 | .long 0x73d8d8ab 113 | .long 0x73d8d8ab 114 | .long 0x53313162 115 | .long 0x53313162 116 | .long 0x3f15152a 117 | .long 0x3f15152a 118 | .long 0x0c040408 119 | .long 0x0c040408 120 | .long 0x52c7c795 121 | .long 0x52c7c795 122 | .long 0x65232346 123 | .long 0x65232346 124 | .long 0x5ec3c39d 125 | .long 0x5ec3c39d 126 | .long 0x28181830 127 | .long 0x28181830 128 | .long 0xa1969637 129 | .long 0xa1969637 130 | .long 0x0f05050a 131 | .long 0x0f05050a 132 | .long 0xb59a9a2f 133 | .long 0xb59a9a2f 134 | .long 0x0907070e 135 | .long 0x0907070e 136 | .long 0x36121224 137 | .long 0x36121224 138 | .long 0x9b80801b 139 | .long 0x9b80801b 140 | .long 0x3de2e2df 141 | .long 0x3de2e2df 142 | .long 0x26ebebcd 143 | .long 0x26ebebcd 144 | .long 0x6927274e 145 | .long 0x6927274e 146 | .long 0xcdb2b27f 147 | .long 0xcdb2b27f 148 | .long 0x9f7575ea 149 | .long 0x9f7575ea 150 | .long 0x1b090912 151 | .long 0x1b090912 152 | .long 0x9e83831d 153 | .long 0x9e83831d 154 | .long 0x742c2c58 155 | .long 0x742c2c58 156 | .long 0x2e1a1a34 157 | .long 0x2e1a1a34 158 | .long 0x2d1b1b36 159 | .long 0x2d1b1b36 160 | .long 0xb26e6edc 161 | .long 0xb26e6edc 162 | .long 0xee5a5ab4 163 | .long 0xee5a5ab4 164 | .long 0xfba0a05b 165 | .long 0xfba0a05b 166 | .long 0xf65252a4 167 | .long 0xf65252a4 168 | .long 0x4d3b3b76 169 | .long 0x4d3b3b76 170 | .long 0x61d6d6b7 171 | .long 0x61d6d6b7 172 | .long 0xceb3b37d 173 | .long 0xceb3b37d 174 | .long 0x7b292952 175 | .long 0x7b292952 176 | .long 0x3ee3e3dd 177 | .long 0x3ee3e3dd 178 | .long 0x712f2f5e 179 | .long 0x712f2f5e 180 | .long 0x97848413 181 | .long 0x97848413 182 | .long 0xf55353a6 183 | .long 0xf55353a6 184 | .long 0x68d1d1b9 185 | .long 0x68d1d1b9 186 | .long 0x00000000 187 | .long 0x00000000 188 | .long 0x2cededc1 189 | .long 0x2cededc1 190 | .long 0x60202040 191 | .long 0x60202040 192 | .long 0x1ffcfce3 193 | .long 0x1ffcfce3 194 | .long 0xc8b1b179 195 | .long 0xc8b1b179 196 | .long 0xed5b5bb6 197 | .long 0xed5b5bb6 198 | .long 0xbe6a6ad4 199 | .long 0xbe6a6ad4 200 | .long 0x46cbcb8d 201 | .long 0x46cbcb8d 202 | .long 0xd9bebe67 203 | .long 0xd9bebe67 204 | .long 0x4b393972 205 | .long 0x4b393972 206 | .long 0xde4a4a94 207 | .long 0xde4a4a94 208 | .long 0xd44c4c98 209 | .long 0xd44c4c98 210 | .long 0xe85858b0 211 | .long 0xe85858b0 212 | .long 0x4acfcf85 213 | .long 0x4acfcf85 214 | .long 0x6bd0d0bb 215 | .long 0x6bd0d0bb 216 | .long 0x2aefefc5 217 | .long 0x2aefefc5 218 | .long 0xe5aaaa4f 219 | .long 0xe5aaaa4f 220 | .long 0x16fbfbed 221 | .long 0x16fbfbed 222 | .long 0xc5434386 223 | .long 0xc5434386 224 | .long 0xd74d4d9a 225 | .long 0xd74d4d9a 226 | .long 0x55333366 227 | .long 0x55333366 228 | .long 0x94858511 229 | .long 0x94858511 230 | .long 0xcf45458a 231 | .long 0xcf45458a 232 | .long 0x10f9f9e9 233 | .long 0x10f9f9e9 234 | .long 0x06020204 235 | .long 0x06020204 236 | .long 0x817f7ffe 237 | .long 0x817f7ffe 238 | .long 0xf05050a0 239 | .long 0xf05050a0 240 | .long 0x443c3c78 241 | .long 0x443c3c78 242 | .long 0xba9f9f25 243 | .long 0xba9f9f25 244 | .long 0xe3a8a84b 245 | .long 0xe3a8a84b 246 | .long 0xf35151a2 247 | .long 0xf35151a2 248 | .long 0xfea3a35d 249 | .long 0xfea3a35d 250 | .long 0xc0404080 251 | .long 0xc0404080 252 | .long 0x8a8f8f05 253 | .long 0x8a8f8f05 254 | .long 0xad92923f 255 | .long 0xad92923f 256 | .long 0xbc9d9d21 257 | .long 0xbc9d9d21 258 | .long 0x48383870 259 | .long 0x48383870 260 | .long 0x04f5f5f1 261 | .long 0x04f5f5f1 262 | .long 0xdfbcbc63 263 | .long 0xdfbcbc63 264 | .long 0xc1b6b677 265 | .long 0xc1b6b677 266 | .long 0x75dadaaf 267 | .long 0x75dadaaf 268 | .long 0x63212142 269 | .long 0x63212142 270 | .long 0x30101020 271 | .long 0x30101020 272 | .long 0x1affffe5 273 | .long 0x1affffe5 274 | .long 0x0ef3f3fd 275 | .long 0x0ef3f3fd 276 | .long 0x6dd2d2bf 277 | .long 0x6dd2d2bf 278 | .long 0x4ccdcd81 279 | .long 0x4ccdcd81 280 | .long 0x140c0c18 281 | .long 0x140c0c18 282 | .long 0x35131326 283 | .long 0x35131326 284 | .long 0x2fececc3 285 | .long 0x2fececc3 286 | .long 0xe15f5fbe 287 | .long 0xe15f5fbe 288 | .long 0xa2979735 289 | .long 0xa2979735 290 | .long 0xcc444488 291 | .long 0xcc444488 292 | .long 0x3917172e 293 | .long 0x3917172e 294 | .long 0x57c4c493 295 | .long 0x57c4c493 296 | .long 0xf2a7a755 297 | .long 0xf2a7a755 298 | .long 0x827e7efc 299 | .long 0x827e7efc 300 | .long 0x473d3d7a 301 | .long 0x473d3d7a 302 | .long 0xac6464c8 303 | .long 0xac6464c8 304 | .long 0xe75d5dba 305 | .long 0xe75d5dba 306 | .long 0x2b191932 307 | .long 0x2b191932 308 | .long 0x957373e6 309 | .long 0x957373e6 310 | .long 0xa06060c0 311 | .long 0xa06060c0 312 | .long 0x98818119 313 | .long 0x98818119 314 | .long 0xd14f4f9e 315 | .long 0xd14f4f9e 316 | .long 0x7fdcdca3 317 | .long 0x7fdcdca3 318 | .long 0x66222244 319 | .long 0x66222244 320 | .long 0x7e2a2a54 321 | .long 0x7e2a2a54 322 | .long 0xab90903b 323 | .long 0xab90903b 324 | .long 0x8388880b 325 | .long 0x8388880b 326 | .long 0xca46468c 327 | .long 0xca46468c 328 | .long 0x29eeeec7 329 | .long 0x29eeeec7 330 | .long 0xd3b8b86b 331 | .long 0xd3b8b86b 332 | .long 0x3c141428 333 | .long 0x3c141428 334 | .long 0x79dedea7 335 | .long 0x79dedea7 336 | .long 0xe25e5ebc 337 | .long 0xe25e5ebc 338 | .long 0x1d0b0b16 339 | .long 0x1d0b0b16 340 | .long 0x76dbdbad 341 | .long 0x76dbdbad 342 | .long 0x3be0e0db 343 | .long 0x3be0e0db 344 | .long 0x56323264 345 | .long 0x56323264 346 | .long 0x4e3a3a74 347 | .long 0x4e3a3a74 348 | .long 0x1e0a0a14 349 | .long 0x1e0a0a14 350 | .long 0xdb494992 351 | .long 0xdb494992 352 | .long 0x0a06060c 353 | .long 0x0a06060c 354 | .long 0x6c242448 355 | .long 0x6c242448 356 | .long 0xe45c5cb8 357 | .long 0xe45c5cb8 358 | .long 0x5dc2c29f 359 | .long 0x5dc2c29f 360 | .long 0x6ed3d3bd 361 | .long 0x6ed3d3bd 362 | .long 0xefacac43 363 | .long 0xefacac43 364 | .long 0xa66262c4 365 | .long 0xa66262c4 366 | .long 0xa8919139 367 | .long 0xa8919139 368 | .long 0xa4959531 369 | .long 0xa4959531 370 | .long 0x37e4e4d3 371 | .long 0x37e4e4d3 372 | .long 0x8b7979f2 373 | .long 0x8b7979f2 374 | .long 0x32e7e7d5 375 | .long 0x32e7e7d5 376 | .long 0x43c8c88b 377 | .long 0x43c8c88b 378 | .long 0x5937376e 379 | .long 0x5937376e 380 | .long 0xb76d6dda 381 | .long 0xb76d6dda 382 | .long 0x8c8d8d01 383 | .long 0x8c8d8d01 384 | .long 0x64d5d5b1 385 | .long 0x64d5d5b1 386 | .long 0xd24e4e9c 387 | .long 0xd24e4e9c 388 | .long 0xe0a9a949 389 | .long 0xe0a9a949 390 | .long 0xb46c6cd8 391 | .long 0xb46c6cd8 392 | .long 0xfa5656ac 393 | .long 0xfa5656ac 394 | .long 0x07f4f4f3 395 | .long 0x07f4f4f3 396 | .long 0x25eaeacf 397 | .long 0x25eaeacf 398 | .long 0xaf6565ca 399 | .long 0xaf6565ca 400 | .long 0x8e7a7af4 401 | .long 0x8e7a7af4 402 | .long 0xe9aeae47 403 | .long 0xe9aeae47 404 | .long 0x18080810 405 | .long 0x18080810 406 | .long 0xd5baba6f 407 | .long 0xd5baba6f 408 | .long 0x887878f0 409 | .long 0x887878f0 410 | .long 0x6f25254a 411 | .long 0x6f25254a 412 | .long 0x722e2e5c 413 | .long 0x722e2e5c 414 | .long 0x241c1c38 415 | .long 0x241c1c38 416 | .long 0xf1a6a657 417 | .long 0xf1a6a657 418 | .long 0xc7b4b473 419 | .long 0xc7b4b473 420 | .long 0x51c6c697 421 | .long 0x51c6c697 422 | .long 0x23e8e8cb 423 | .long 0x23e8e8cb 424 | .long 0x7cdddda1 425 | .long 0x7cdddda1 426 | .long 0x9c7474e8 427 | .long 0x9c7474e8 428 | .long 0x211f1f3e 429 | .long 0x211f1f3e 430 | .long 0xdd4b4b96 431 | .long 0xdd4b4b96 432 | .long 0xdcbdbd61 433 | .long 0xdcbdbd61 434 | .long 0x868b8b0d 435 | .long 0x868b8b0d 436 | .long 0x858a8a0f 437 | .long 0x858a8a0f 438 | .long 0x907070e0 439 | .long 0x907070e0 440 | .long 0x423e3e7c 441 | .long 0x423e3e7c 442 | .long 0xc4b5b571 443 | .long 0xc4b5b571 444 | .long 0xaa6666cc 445 | .long 0xaa6666cc 446 | .long 0xd8484890 447 | .long 0xd8484890 448 | .long 0x05030306 449 | .long 0x05030306 450 | .long 0x01f6f6f7 451 | .long 0x01f6f6f7 452 | .long 0x120e0e1c 453 | .long 0x120e0e1c 454 | .long 0xa36161c2 455 | .long 0xa36161c2 456 | .long 0x5f35356a 457 | .long 0x5f35356a 458 | .long 0xf95757ae 459 | .long 0xf95757ae 460 | .long 0xd0b9b969 461 | .long 0xd0b9b969 462 | .long 0x91868617 463 | .long 0x91868617 464 | .long 0x58c1c199 465 | .long 0x58c1c199 466 | .long 0x271d1d3a 467 | .long 0x271d1d3a 468 | .long 0xb99e9e27 469 | .long 0xb99e9e27 470 | .long 0x38e1e1d9 471 | .long 0x38e1e1d9 472 | .long 0x13f8f8eb 473 | .long 0x13f8f8eb 474 | .long 0xb398982b 475 | .long 0xb398982b 476 | .long 0x33111122 477 | .long 0x33111122 478 | .long 0xbb6969d2 479 | .long 0xbb6969d2 480 | .long 0x70d9d9a9 481 | .long 0x70d9d9a9 482 | .long 0x898e8e07 483 | .long 0x898e8e07 484 | .long 0xa7949433 485 | .long 0xa7949433 486 | .long 0xb69b9b2d 487 | .long 0xb69b9b2d 488 | .long 0x221e1e3c 489 | .long 0x221e1e3c 490 | .long 0x92878715 491 | .long 0x92878715 492 | .long 0x20e9e9c9 493 | .long 0x20e9e9c9 494 | .long 0x49cece87 495 | .long 0x49cece87 496 | .long 0xff5555aa 497 | .long 0xff5555aa 498 | .long 0x78282850 499 | .long 0x78282850 500 | .long 0x7adfdfa5 501 | .long 0x7adfdfa5 502 | .long 0x8f8c8c03 503 | .long 0x8f8c8c03 504 | .long 0xf8a1a159 505 | .long 0xf8a1a159 506 | .long 0x80898909 507 | .long 0x80898909 508 | .long 0x170d0d1a 509 | .long 0x170d0d1a 510 | .long 0xdabfbf65 511 | .long 0xdabfbf65 512 | .long 0x31e6e6d7 513 | .long 0x31e6e6d7 514 | .long 0xc6424284 515 | .long 0xc6424284 516 | .long 0xb86868d0 517 | .long 0xb86868d0 518 | .long 0xc3414182 519 | .long 0xc3414182 520 | .long 0xb0999929 521 | .long 0xb0999929 522 | .long 0x772d2d5a 523 | .long 0x772d2d5a 524 | .long 0x110f0f1e 525 | .long 0x110f0f1e 526 | .long 0xcbb0b07b 527 | .long 0xcbb0b07b 528 | .long 0xfc5454a8 529 | .long 0xfc5454a8 530 | .long 0xd6bbbb6d 531 | .long 0xd6bbbb6d 532 | .long 0x3a16162c 533 | .long 0x3a16162c 534 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_aix_constants.s: -------------------------------------------------------------------------------- 1 | # aes_aix_constants.s version 20050205 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .globl aes_aix_constants 6 | 7 | .toc 8 | .csect aes_aix_constants[RO],5 9 | 10 | .long 0x00000000 11 | .long 0x00000000 12 | .long 0x00000000 13 | .long 0x00000000 14 | .long 0x00000000 15 | .long 0x00000000 16 | .long 0x01000000 17 | .long 0x02000000 18 | .long 0x04000000 19 | .long 0x08000000 20 | .long 0x10000000 21 | .long 0x20000000 22 | .long 0x40000000 23 | .long 0x80000000 24 | .long 0x1b000000 25 | .long 0x36000000 26 | aes_aix_constants: 27 | .long 0xc66363a5 28 | .long 0xc66363a5 29 | .long 0xf87c7c84 30 | .long 0xf87c7c84 31 | .long 0xee777799 32 | .long 0xee777799 33 | .long 0xf67b7b8d 34 | .long 0xf67b7b8d 35 | .long 0xfff2f20d 36 | .long 0xfff2f20d 37 | .long 0xd66b6bbd 38 | .long 0xd66b6bbd 39 | .long 0xde6f6fb1 40 | .long 0xde6f6fb1 41 | .long 0x91c5c554 42 | .long 0x91c5c554 43 | .long 0x60303050 44 | .long 0x60303050 45 | .long 0x02010103 46 | .long 0x02010103 47 | .long 0xce6767a9 48 | .long 0xce6767a9 49 | .long 0x562b2b7d 50 | .long 0x562b2b7d 51 | .long 0xe7fefe19 52 | .long 0xe7fefe19 53 | .long 0xb5d7d762 54 | .long 0xb5d7d762 55 | .long 0x4dababe6 56 | .long 0x4dababe6 57 | .long 0xec76769a 58 | .long 0xec76769a 59 | .long 0x8fcaca45 60 | .long 0x8fcaca45 61 | .long 0x1f82829d 62 | .long 0x1f82829d 63 | .long 0x89c9c940 64 | .long 0x89c9c940 65 | .long 0xfa7d7d87 66 | .long 0xfa7d7d87 67 | .long 0xeffafa15 68 | .long 0xeffafa15 69 | .long 0xb25959eb 70 | .long 0xb25959eb 71 | .long 0x8e4747c9 72 | .long 0x8e4747c9 73 | .long 0xfbf0f00b 74 | .long 0xfbf0f00b 75 | .long 0x41adadec 76 | .long 0x41adadec 77 | .long 0xb3d4d467 78 | .long 0xb3d4d467 79 | .long 0x5fa2a2fd 80 | .long 0x5fa2a2fd 81 | .long 0x45afafea 82 | .long 0x45afafea 83 | .long 0x239c9cbf 84 | .long 0x239c9cbf 85 | .long 0x53a4a4f7 86 | .long 0x53a4a4f7 87 | .long 0xe4727296 88 | .long 0xe4727296 89 | .long 0x9bc0c05b 90 | .long 0x9bc0c05b 91 | .long 0x75b7b7c2 92 | .long 0x75b7b7c2 93 | .long 0xe1fdfd1c 94 | .long 0xe1fdfd1c 95 | .long 0x3d9393ae 96 | .long 0x3d9393ae 97 | .long 0x4c26266a 98 | .long 0x4c26266a 99 | .long 0x6c36365a 100 | .long 0x6c36365a 101 | .long 0x7e3f3f41 102 | .long 0x7e3f3f41 103 | .long 0xf5f7f702 104 | .long 0xf5f7f702 105 | .long 0x83cccc4f 106 | .long 0x83cccc4f 107 | .long 0x6834345c 108 | .long 0x6834345c 109 | .long 0x51a5a5f4 110 | .long 0x51a5a5f4 111 | .long 0xd1e5e534 112 | .long 0xd1e5e534 113 | .long 0xf9f1f108 114 | .long 0xf9f1f108 115 | .long 0xe2717193 116 | .long 0xe2717193 117 | .long 0xabd8d873 118 | .long 0xabd8d873 119 | .long 0x62313153 120 | .long 0x62313153 121 | .long 0x2a15153f 122 | .long 0x2a15153f 123 | .long 0x0804040c 124 | .long 0x0804040c 125 | .long 0x95c7c752 126 | .long 0x95c7c752 127 | .long 0x46232365 128 | .long 0x46232365 129 | .long 0x9dc3c35e 130 | .long 0x9dc3c35e 131 | .long 0x30181828 132 | .long 0x30181828 133 | .long 0x379696a1 134 | .long 0x379696a1 135 | .long 0x0a05050f 136 | .long 0x0a05050f 137 | .long 0x2f9a9ab5 138 | .long 0x2f9a9ab5 139 | .long 0x0e070709 140 | .long 0x0e070709 141 | .long 0x24121236 142 | .long 0x24121236 143 | .long 0x1b80809b 144 | .long 0x1b80809b 145 | .long 0xdfe2e23d 146 | .long 0xdfe2e23d 147 | .long 0xcdebeb26 148 | .long 0xcdebeb26 149 | .long 0x4e272769 150 | .long 0x4e272769 151 | .long 0x7fb2b2cd 152 | .long 0x7fb2b2cd 153 | .long 0xea75759f 154 | .long 0xea75759f 155 | .long 0x1209091b 156 | .long 0x1209091b 157 | .long 0x1d83839e 158 | .long 0x1d83839e 159 | .long 0x582c2c74 160 | .long 0x582c2c74 161 | .long 0x341a1a2e 162 | .long 0x341a1a2e 163 | .long 0x361b1b2d 164 | .long 0x361b1b2d 165 | .long 0xdc6e6eb2 166 | .long 0xdc6e6eb2 167 | .long 0xb45a5aee 168 | .long 0xb45a5aee 169 | .long 0x5ba0a0fb 170 | .long 0x5ba0a0fb 171 | .long 0xa45252f6 172 | .long 0xa45252f6 173 | .long 0x763b3b4d 174 | .long 0x763b3b4d 175 | .long 0xb7d6d661 176 | .long 0xb7d6d661 177 | .long 0x7db3b3ce 178 | .long 0x7db3b3ce 179 | .long 0x5229297b 180 | .long 0x5229297b 181 | .long 0xdde3e33e 182 | .long 0xdde3e33e 183 | .long 0x5e2f2f71 184 | .long 0x5e2f2f71 185 | .long 0x13848497 186 | .long 0x13848497 187 | .long 0xa65353f5 188 | .long 0xa65353f5 189 | .long 0xb9d1d168 190 | .long 0xb9d1d168 191 | .long 0x00000000 192 | .long 0x00000000 193 | .long 0xc1eded2c 194 | .long 0xc1eded2c 195 | .long 0x40202060 196 | .long 0x40202060 197 | .long 0xe3fcfc1f 198 | .long 0xe3fcfc1f 199 | .long 0x79b1b1c8 200 | .long 0x79b1b1c8 201 | .long 0xb65b5bed 202 | .long 0xb65b5bed 203 | .long 0xd46a6abe 204 | .long 0xd46a6abe 205 | .long 0x8dcbcb46 206 | .long 0x8dcbcb46 207 | .long 0x67bebed9 208 | .long 0x67bebed9 209 | .long 0x7239394b 210 | .long 0x7239394b 211 | .long 0x944a4ade 212 | .long 0x944a4ade 213 | .long 0x984c4cd4 214 | .long 0x984c4cd4 215 | .long 0xb05858e8 216 | .long 0xb05858e8 217 | .long 0x85cfcf4a 218 | .long 0x85cfcf4a 219 | .long 0xbbd0d06b 220 | .long 0xbbd0d06b 221 | .long 0xc5efef2a 222 | .long 0xc5efef2a 223 | .long 0x4faaaae5 224 | .long 0x4faaaae5 225 | .long 0xedfbfb16 226 | .long 0xedfbfb16 227 | .long 0x864343c5 228 | .long 0x864343c5 229 | .long 0x9a4d4dd7 230 | .long 0x9a4d4dd7 231 | .long 0x66333355 232 | .long 0x66333355 233 | .long 0x11858594 234 | .long 0x11858594 235 | .long 0x8a4545cf 236 | .long 0x8a4545cf 237 | .long 0xe9f9f910 238 | .long 0xe9f9f910 239 | .long 0x04020206 240 | .long 0x04020206 241 | .long 0xfe7f7f81 242 | .long 0xfe7f7f81 243 | .long 0xa05050f0 244 | .long 0xa05050f0 245 | .long 0x783c3c44 246 | .long 0x783c3c44 247 | .long 0x259f9fba 248 | .long 0x259f9fba 249 | .long 0x4ba8a8e3 250 | .long 0x4ba8a8e3 251 | .long 0xa25151f3 252 | .long 0xa25151f3 253 | .long 0x5da3a3fe 254 | .long 0x5da3a3fe 255 | .long 0x804040c0 256 | .long 0x804040c0 257 | .long 0x058f8f8a 258 | .long 0x058f8f8a 259 | .long 0x3f9292ad 260 | .long 0x3f9292ad 261 | .long 0x219d9dbc 262 | .long 0x219d9dbc 263 | .long 0x70383848 264 | .long 0x70383848 265 | .long 0xf1f5f504 266 | .long 0xf1f5f504 267 | .long 0x63bcbcdf 268 | .long 0x63bcbcdf 269 | .long 0x77b6b6c1 270 | .long 0x77b6b6c1 271 | .long 0xafdada75 272 | .long 0xafdada75 273 | .long 0x42212163 274 | .long 0x42212163 275 | .long 0x20101030 276 | .long 0x20101030 277 | .long 0xe5ffff1a 278 | .long 0xe5ffff1a 279 | .long 0xfdf3f30e 280 | .long 0xfdf3f30e 281 | .long 0xbfd2d26d 282 | .long 0xbfd2d26d 283 | .long 0x81cdcd4c 284 | .long 0x81cdcd4c 285 | .long 0x180c0c14 286 | .long 0x180c0c14 287 | .long 0x26131335 288 | .long 0x26131335 289 | .long 0xc3ecec2f 290 | .long 0xc3ecec2f 291 | .long 0xbe5f5fe1 292 | .long 0xbe5f5fe1 293 | .long 0x359797a2 294 | .long 0x359797a2 295 | .long 0x884444cc 296 | .long 0x884444cc 297 | .long 0x2e171739 298 | .long 0x2e171739 299 | .long 0x93c4c457 300 | .long 0x93c4c457 301 | .long 0x55a7a7f2 302 | .long 0x55a7a7f2 303 | .long 0xfc7e7e82 304 | .long 0xfc7e7e82 305 | .long 0x7a3d3d47 306 | .long 0x7a3d3d47 307 | .long 0xc86464ac 308 | .long 0xc86464ac 309 | .long 0xba5d5de7 310 | .long 0xba5d5de7 311 | .long 0x3219192b 312 | .long 0x3219192b 313 | .long 0xe6737395 314 | .long 0xe6737395 315 | .long 0xc06060a0 316 | .long 0xc06060a0 317 | .long 0x19818198 318 | .long 0x19818198 319 | .long 0x9e4f4fd1 320 | .long 0x9e4f4fd1 321 | .long 0xa3dcdc7f 322 | .long 0xa3dcdc7f 323 | .long 0x44222266 324 | .long 0x44222266 325 | .long 0x542a2a7e 326 | .long 0x542a2a7e 327 | .long 0x3b9090ab 328 | .long 0x3b9090ab 329 | .long 0x0b888883 330 | .long 0x0b888883 331 | .long 0x8c4646ca 332 | .long 0x8c4646ca 333 | .long 0xc7eeee29 334 | .long 0xc7eeee29 335 | .long 0x6bb8b8d3 336 | .long 0x6bb8b8d3 337 | .long 0x2814143c 338 | .long 0x2814143c 339 | .long 0xa7dede79 340 | .long 0xa7dede79 341 | .long 0xbc5e5ee2 342 | .long 0xbc5e5ee2 343 | .long 0x160b0b1d 344 | .long 0x160b0b1d 345 | .long 0xaddbdb76 346 | .long 0xaddbdb76 347 | .long 0xdbe0e03b 348 | .long 0xdbe0e03b 349 | .long 0x64323256 350 | .long 0x64323256 351 | .long 0x743a3a4e 352 | .long 0x743a3a4e 353 | .long 0x140a0a1e 354 | .long 0x140a0a1e 355 | .long 0x924949db 356 | .long 0x924949db 357 | .long 0x0c06060a 358 | .long 0x0c06060a 359 | .long 0x4824246c 360 | .long 0x4824246c 361 | .long 0xb85c5ce4 362 | .long 0xb85c5ce4 363 | .long 0x9fc2c25d 364 | .long 0x9fc2c25d 365 | .long 0xbdd3d36e 366 | .long 0xbdd3d36e 367 | .long 0x43acacef 368 | .long 0x43acacef 369 | .long 0xc46262a6 370 | .long 0xc46262a6 371 | .long 0x399191a8 372 | .long 0x399191a8 373 | .long 0x319595a4 374 | .long 0x319595a4 375 | .long 0xd3e4e437 376 | .long 0xd3e4e437 377 | .long 0xf279798b 378 | .long 0xf279798b 379 | .long 0xd5e7e732 380 | .long 0xd5e7e732 381 | .long 0x8bc8c843 382 | .long 0x8bc8c843 383 | .long 0x6e373759 384 | .long 0x6e373759 385 | .long 0xda6d6db7 386 | .long 0xda6d6db7 387 | .long 0x018d8d8c 388 | .long 0x018d8d8c 389 | .long 0xb1d5d564 390 | .long 0xb1d5d564 391 | .long 0x9c4e4ed2 392 | .long 0x9c4e4ed2 393 | .long 0x49a9a9e0 394 | .long 0x49a9a9e0 395 | .long 0xd86c6cb4 396 | .long 0xd86c6cb4 397 | .long 0xac5656fa 398 | .long 0xac5656fa 399 | .long 0xf3f4f407 400 | .long 0xf3f4f407 401 | .long 0xcfeaea25 402 | .long 0xcfeaea25 403 | .long 0xca6565af 404 | .long 0xca6565af 405 | .long 0xf47a7a8e 406 | .long 0xf47a7a8e 407 | .long 0x47aeaee9 408 | .long 0x47aeaee9 409 | .long 0x10080818 410 | .long 0x10080818 411 | .long 0x6fbabad5 412 | .long 0x6fbabad5 413 | .long 0xf0787888 414 | .long 0xf0787888 415 | .long 0x4a25256f 416 | .long 0x4a25256f 417 | .long 0x5c2e2e72 418 | .long 0x5c2e2e72 419 | .long 0x381c1c24 420 | .long 0x381c1c24 421 | .long 0x57a6a6f1 422 | .long 0x57a6a6f1 423 | .long 0x73b4b4c7 424 | .long 0x73b4b4c7 425 | .long 0x97c6c651 426 | .long 0x97c6c651 427 | .long 0xcbe8e823 428 | .long 0xcbe8e823 429 | .long 0xa1dddd7c 430 | .long 0xa1dddd7c 431 | .long 0xe874749c 432 | .long 0xe874749c 433 | .long 0x3e1f1f21 434 | .long 0x3e1f1f21 435 | .long 0x964b4bdd 436 | .long 0x964b4bdd 437 | .long 0x61bdbddc 438 | .long 0x61bdbddc 439 | .long 0x0d8b8b86 440 | .long 0x0d8b8b86 441 | .long 0x0f8a8a85 442 | .long 0x0f8a8a85 443 | .long 0xe0707090 444 | .long 0xe0707090 445 | .long 0x7c3e3e42 446 | .long 0x7c3e3e42 447 | .long 0x71b5b5c4 448 | .long 0x71b5b5c4 449 | .long 0xcc6666aa 450 | .long 0xcc6666aa 451 | .long 0x904848d8 452 | .long 0x904848d8 453 | .long 0x06030305 454 | .long 0x06030305 455 | .long 0xf7f6f601 456 | .long 0xf7f6f601 457 | .long 0x1c0e0e12 458 | .long 0x1c0e0e12 459 | .long 0xc26161a3 460 | .long 0xc26161a3 461 | .long 0x6a35355f 462 | .long 0x6a35355f 463 | .long 0xae5757f9 464 | .long 0xae5757f9 465 | .long 0x69b9b9d0 466 | .long 0x69b9b9d0 467 | .long 0x17868691 468 | .long 0x17868691 469 | .long 0x99c1c158 470 | .long 0x99c1c158 471 | .long 0x3a1d1d27 472 | .long 0x3a1d1d27 473 | .long 0x279e9eb9 474 | .long 0x279e9eb9 475 | .long 0xd9e1e138 476 | .long 0xd9e1e138 477 | .long 0xebf8f813 478 | .long 0xebf8f813 479 | .long 0x2b9898b3 480 | .long 0x2b9898b3 481 | .long 0x22111133 482 | .long 0x22111133 483 | .long 0xd26969bb 484 | .long 0xd26969bb 485 | .long 0xa9d9d970 486 | .long 0xa9d9d970 487 | .long 0x078e8e89 488 | .long 0x078e8e89 489 | .long 0x339494a7 490 | .long 0x339494a7 491 | .long 0x2d9b9bb6 492 | .long 0x2d9b9bb6 493 | .long 0x3c1e1e22 494 | .long 0x3c1e1e22 495 | .long 0x15878792 496 | .long 0x15878792 497 | .long 0xc9e9e920 498 | .long 0xc9e9e920 499 | .long 0x87cece49 500 | .long 0x87cece49 501 | .long 0xaa5555ff 502 | .long 0xaa5555ff 503 | .long 0x50282878 504 | .long 0x50282878 505 | .long 0xa5dfdf7a 506 | .long 0xa5dfdf7a 507 | .long 0x038c8c8f 508 | .long 0x038c8c8f 509 | .long 0x59a1a1f8 510 | .long 0x59a1a1f8 511 | .long 0x09898980 512 | .long 0x09898980 513 | .long 0x1a0d0d17 514 | .long 0x1a0d0d17 515 | .long 0x65bfbfda 516 | .long 0x65bfbfda 517 | .long 0xd7e6e631 518 | .long 0xd7e6e631 519 | .long 0x844242c6 520 | .long 0x844242c6 521 | .long 0xd06868b8 522 | .long 0xd06868b8 523 | .long 0x824141c3 524 | .long 0x824141c3 525 | .long 0x299999b0 526 | .long 0x299999b0 527 | .long 0x5a2d2d77 528 | .long 0x5a2d2d77 529 | .long 0x1e0f0f11 530 | .long 0x1e0f0f11 531 | .long 0x7bb0b0cb 532 | .long 0x7bb0b0cb 533 | .long 0xa85454fc 534 | .long 0xa85454fc 535 | .long 0x6dbbbbd6 536 | .long 0x6dbbbbd6 537 | .long 0x2c16163a 538 | .long 0x2c16163a 539 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_macos_constants.s: -------------------------------------------------------------------------------- 1 | # aes_macos_constants.s version 20050207 2 | # D. J. Bernstein 3 | # Public domain. 4 | 5 | .const 6 | .align 5 7 | .globl _aes_macos_constants 8 | .globl aes_macos_constants 9 | 10 | .long 0x00000000 11 | .long 0x00000000 12 | .long 0x00000000 13 | .long 0x00000000 14 | .long 0x00000000 15 | .long 0x00000000 16 | .long 0x01000000 17 | .long 0x02000000 18 | .long 0x04000000 19 | .long 0x08000000 20 | .long 0x10000000 21 | .long 0x20000000 22 | .long 0x40000000 23 | .long 0x80000000 24 | .long 0x1b000000 25 | .long 0x36000000 26 | _aes_macos_constants: 27 | aes_macos_constants: 28 | .long 0xc66363a5 29 | .long 0xc66363a5 30 | .long 0xf87c7c84 31 | .long 0xf87c7c84 32 | .long 0xee777799 33 | .long 0xee777799 34 | .long 0xf67b7b8d 35 | .long 0xf67b7b8d 36 | .long 0xfff2f20d 37 | .long 0xfff2f20d 38 | .long 0xd66b6bbd 39 | .long 0xd66b6bbd 40 | .long 0xde6f6fb1 41 | .long 0xde6f6fb1 42 | .long 0x91c5c554 43 | .long 0x91c5c554 44 | .long 0x60303050 45 | .long 0x60303050 46 | .long 0x02010103 47 | .long 0x02010103 48 | .long 0xce6767a9 49 | .long 0xce6767a9 50 | .long 0x562b2b7d 51 | .long 0x562b2b7d 52 | .long 0xe7fefe19 53 | .long 0xe7fefe19 54 | .long 0xb5d7d762 55 | .long 0xb5d7d762 56 | .long 0x4dababe6 57 | .long 0x4dababe6 58 | .long 0xec76769a 59 | .long 0xec76769a 60 | .long 0x8fcaca45 61 | .long 0x8fcaca45 62 | .long 0x1f82829d 63 | .long 0x1f82829d 64 | .long 0x89c9c940 65 | .long 0x89c9c940 66 | .long 0xfa7d7d87 67 | .long 0xfa7d7d87 68 | .long 0xeffafa15 69 | .long 0xeffafa15 70 | .long 0xb25959eb 71 | .long 0xb25959eb 72 | .long 0x8e4747c9 73 | .long 0x8e4747c9 74 | .long 0xfbf0f00b 75 | .long 0xfbf0f00b 76 | .long 0x41adadec 77 | .long 0x41adadec 78 | .long 0xb3d4d467 79 | .long 0xb3d4d467 80 | .long 0x5fa2a2fd 81 | .long 0x5fa2a2fd 82 | .long 0x45afafea 83 | .long 0x45afafea 84 | .long 0x239c9cbf 85 | .long 0x239c9cbf 86 | .long 0x53a4a4f7 87 | .long 0x53a4a4f7 88 | .long 0xe4727296 89 | .long 0xe4727296 90 | .long 0x9bc0c05b 91 | .long 0x9bc0c05b 92 | .long 0x75b7b7c2 93 | .long 0x75b7b7c2 94 | .long 0xe1fdfd1c 95 | .long 0xe1fdfd1c 96 | .long 0x3d9393ae 97 | .long 0x3d9393ae 98 | .long 0x4c26266a 99 | .long 0x4c26266a 100 | .long 0x6c36365a 101 | .long 0x6c36365a 102 | .long 0x7e3f3f41 103 | .long 0x7e3f3f41 104 | .long 0xf5f7f702 105 | .long 0xf5f7f702 106 | .long 0x83cccc4f 107 | .long 0x83cccc4f 108 | .long 0x6834345c 109 | .long 0x6834345c 110 | .long 0x51a5a5f4 111 | .long 0x51a5a5f4 112 | .long 0xd1e5e534 113 | .long 0xd1e5e534 114 | .long 0xf9f1f108 115 | .long 0xf9f1f108 116 | .long 0xe2717193 117 | .long 0xe2717193 118 | .long 0xabd8d873 119 | .long 0xabd8d873 120 | .long 0x62313153 121 | .long 0x62313153 122 | .long 0x2a15153f 123 | .long 0x2a15153f 124 | .long 0x0804040c 125 | .long 0x0804040c 126 | .long 0x95c7c752 127 | .long 0x95c7c752 128 | .long 0x46232365 129 | .long 0x46232365 130 | .long 0x9dc3c35e 131 | .long 0x9dc3c35e 132 | .long 0x30181828 133 | .long 0x30181828 134 | .long 0x379696a1 135 | .long 0x379696a1 136 | .long 0x0a05050f 137 | .long 0x0a05050f 138 | .long 0x2f9a9ab5 139 | .long 0x2f9a9ab5 140 | .long 0x0e070709 141 | .long 0x0e070709 142 | .long 0x24121236 143 | .long 0x24121236 144 | .long 0x1b80809b 145 | .long 0x1b80809b 146 | .long 0xdfe2e23d 147 | .long 0xdfe2e23d 148 | .long 0xcdebeb26 149 | .long 0xcdebeb26 150 | .long 0x4e272769 151 | .long 0x4e272769 152 | .long 0x7fb2b2cd 153 | .long 0x7fb2b2cd 154 | .long 0xea75759f 155 | .long 0xea75759f 156 | .long 0x1209091b 157 | .long 0x1209091b 158 | .long 0x1d83839e 159 | .long 0x1d83839e 160 | .long 0x582c2c74 161 | .long 0x582c2c74 162 | .long 0x341a1a2e 163 | .long 0x341a1a2e 164 | .long 0x361b1b2d 165 | .long 0x361b1b2d 166 | .long 0xdc6e6eb2 167 | .long 0xdc6e6eb2 168 | .long 0xb45a5aee 169 | .long 0xb45a5aee 170 | .long 0x5ba0a0fb 171 | .long 0x5ba0a0fb 172 | .long 0xa45252f6 173 | .long 0xa45252f6 174 | .long 0x763b3b4d 175 | .long 0x763b3b4d 176 | .long 0xb7d6d661 177 | .long 0xb7d6d661 178 | .long 0x7db3b3ce 179 | .long 0x7db3b3ce 180 | .long 0x5229297b 181 | .long 0x5229297b 182 | .long 0xdde3e33e 183 | .long 0xdde3e33e 184 | .long 0x5e2f2f71 185 | .long 0x5e2f2f71 186 | .long 0x13848497 187 | .long 0x13848497 188 | .long 0xa65353f5 189 | .long 0xa65353f5 190 | .long 0xb9d1d168 191 | .long 0xb9d1d168 192 | .long 0x00000000 193 | .long 0x00000000 194 | .long 0xc1eded2c 195 | .long 0xc1eded2c 196 | .long 0x40202060 197 | .long 0x40202060 198 | .long 0xe3fcfc1f 199 | .long 0xe3fcfc1f 200 | .long 0x79b1b1c8 201 | .long 0x79b1b1c8 202 | .long 0xb65b5bed 203 | .long 0xb65b5bed 204 | .long 0xd46a6abe 205 | .long 0xd46a6abe 206 | .long 0x8dcbcb46 207 | .long 0x8dcbcb46 208 | .long 0x67bebed9 209 | .long 0x67bebed9 210 | .long 0x7239394b 211 | .long 0x7239394b 212 | .long 0x944a4ade 213 | .long 0x944a4ade 214 | .long 0x984c4cd4 215 | .long 0x984c4cd4 216 | .long 0xb05858e8 217 | .long 0xb05858e8 218 | .long 0x85cfcf4a 219 | .long 0x85cfcf4a 220 | .long 0xbbd0d06b 221 | .long 0xbbd0d06b 222 | .long 0xc5efef2a 223 | .long 0xc5efef2a 224 | .long 0x4faaaae5 225 | .long 0x4faaaae5 226 | .long 0xedfbfb16 227 | .long 0xedfbfb16 228 | .long 0x864343c5 229 | .long 0x864343c5 230 | .long 0x9a4d4dd7 231 | .long 0x9a4d4dd7 232 | .long 0x66333355 233 | .long 0x66333355 234 | .long 0x11858594 235 | .long 0x11858594 236 | .long 0x8a4545cf 237 | .long 0x8a4545cf 238 | .long 0xe9f9f910 239 | .long 0xe9f9f910 240 | .long 0x04020206 241 | .long 0x04020206 242 | .long 0xfe7f7f81 243 | .long 0xfe7f7f81 244 | .long 0xa05050f0 245 | .long 0xa05050f0 246 | .long 0x783c3c44 247 | .long 0x783c3c44 248 | .long 0x259f9fba 249 | .long 0x259f9fba 250 | .long 0x4ba8a8e3 251 | .long 0x4ba8a8e3 252 | .long 0xa25151f3 253 | .long 0xa25151f3 254 | .long 0x5da3a3fe 255 | .long 0x5da3a3fe 256 | .long 0x804040c0 257 | .long 0x804040c0 258 | .long 0x058f8f8a 259 | .long 0x058f8f8a 260 | .long 0x3f9292ad 261 | .long 0x3f9292ad 262 | .long 0x219d9dbc 263 | .long 0x219d9dbc 264 | .long 0x70383848 265 | .long 0x70383848 266 | .long 0xf1f5f504 267 | .long 0xf1f5f504 268 | .long 0x63bcbcdf 269 | .long 0x63bcbcdf 270 | .long 0x77b6b6c1 271 | .long 0x77b6b6c1 272 | .long 0xafdada75 273 | .long 0xafdada75 274 | .long 0x42212163 275 | .long 0x42212163 276 | .long 0x20101030 277 | .long 0x20101030 278 | .long 0xe5ffff1a 279 | .long 0xe5ffff1a 280 | .long 0xfdf3f30e 281 | .long 0xfdf3f30e 282 | .long 0xbfd2d26d 283 | .long 0xbfd2d26d 284 | .long 0x81cdcd4c 285 | .long 0x81cdcd4c 286 | .long 0x180c0c14 287 | .long 0x180c0c14 288 | .long 0x26131335 289 | .long 0x26131335 290 | .long 0xc3ecec2f 291 | .long 0xc3ecec2f 292 | .long 0xbe5f5fe1 293 | .long 0xbe5f5fe1 294 | .long 0x359797a2 295 | .long 0x359797a2 296 | .long 0x884444cc 297 | .long 0x884444cc 298 | .long 0x2e171739 299 | .long 0x2e171739 300 | .long 0x93c4c457 301 | .long 0x93c4c457 302 | .long 0x55a7a7f2 303 | .long 0x55a7a7f2 304 | .long 0xfc7e7e82 305 | .long 0xfc7e7e82 306 | .long 0x7a3d3d47 307 | .long 0x7a3d3d47 308 | .long 0xc86464ac 309 | .long 0xc86464ac 310 | .long 0xba5d5de7 311 | .long 0xba5d5de7 312 | .long 0x3219192b 313 | .long 0x3219192b 314 | .long 0xe6737395 315 | .long 0xe6737395 316 | .long 0xc06060a0 317 | .long 0xc06060a0 318 | .long 0x19818198 319 | .long 0x19818198 320 | .long 0x9e4f4fd1 321 | .long 0x9e4f4fd1 322 | .long 0xa3dcdc7f 323 | .long 0xa3dcdc7f 324 | .long 0x44222266 325 | .long 0x44222266 326 | .long 0x542a2a7e 327 | .long 0x542a2a7e 328 | .long 0x3b9090ab 329 | .long 0x3b9090ab 330 | .long 0x0b888883 331 | .long 0x0b888883 332 | .long 0x8c4646ca 333 | .long 0x8c4646ca 334 | .long 0xc7eeee29 335 | .long 0xc7eeee29 336 | .long 0x6bb8b8d3 337 | .long 0x6bb8b8d3 338 | .long 0x2814143c 339 | .long 0x2814143c 340 | .long 0xa7dede79 341 | .long 0xa7dede79 342 | .long 0xbc5e5ee2 343 | .long 0xbc5e5ee2 344 | .long 0x160b0b1d 345 | .long 0x160b0b1d 346 | .long 0xaddbdb76 347 | .long 0xaddbdb76 348 | .long 0xdbe0e03b 349 | .long 0xdbe0e03b 350 | .long 0x64323256 351 | .long 0x64323256 352 | .long 0x743a3a4e 353 | .long 0x743a3a4e 354 | .long 0x140a0a1e 355 | .long 0x140a0a1e 356 | .long 0x924949db 357 | .long 0x924949db 358 | .long 0x0c06060a 359 | .long 0x0c06060a 360 | .long 0x4824246c 361 | .long 0x4824246c 362 | .long 0xb85c5ce4 363 | .long 0xb85c5ce4 364 | .long 0x9fc2c25d 365 | .long 0x9fc2c25d 366 | .long 0xbdd3d36e 367 | .long 0xbdd3d36e 368 | .long 0x43acacef 369 | .long 0x43acacef 370 | .long 0xc46262a6 371 | .long 0xc46262a6 372 | .long 0x399191a8 373 | .long 0x399191a8 374 | .long 0x319595a4 375 | .long 0x319595a4 376 | .long 0xd3e4e437 377 | .long 0xd3e4e437 378 | .long 0xf279798b 379 | .long 0xf279798b 380 | .long 0xd5e7e732 381 | .long 0xd5e7e732 382 | .long 0x8bc8c843 383 | .long 0x8bc8c843 384 | .long 0x6e373759 385 | .long 0x6e373759 386 | .long 0xda6d6db7 387 | .long 0xda6d6db7 388 | .long 0x018d8d8c 389 | .long 0x018d8d8c 390 | .long 0xb1d5d564 391 | .long 0xb1d5d564 392 | .long 0x9c4e4ed2 393 | .long 0x9c4e4ed2 394 | .long 0x49a9a9e0 395 | .long 0x49a9a9e0 396 | .long 0xd86c6cb4 397 | .long 0xd86c6cb4 398 | .long 0xac5656fa 399 | .long 0xac5656fa 400 | .long 0xf3f4f407 401 | .long 0xf3f4f407 402 | .long 0xcfeaea25 403 | .long 0xcfeaea25 404 | .long 0xca6565af 405 | .long 0xca6565af 406 | .long 0xf47a7a8e 407 | .long 0xf47a7a8e 408 | .long 0x47aeaee9 409 | .long 0x47aeaee9 410 | .long 0x10080818 411 | .long 0x10080818 412 | .long 0x6fbabad5 413 | .long 0x6fbabad5 414 | .long 0xf0787888 415 | .long 0xf0787888 416 | .long 0x4a25256f 417 | .long 0x4a25256f 418 | .long 0x5c2e2e72 419 | .long 0x5c2e2e72 420 | .long 0x381c1c24 421 | .long 0x381c1c24 422 | .long 0x57a6a6f1 423 | .long 0x57a6a6f1 424 | .long 0x73b4b4c7 425 | .long 0x73b4b4c7 426 | .long 0x97c6c651 427 | .long 0x97c6c651 428 | .long 0xcbe8e823 429 | .long 0xcbe8e823 430 | .long 0xa1dddd7c 431 | .long 0xa1dddd7c 432 | .long 0xe874749c 433 | .long 0xe874749c 434 | .long 0x3e1f1f21 435 | .long 0x3e1f1f21 436 | .long 0x964b4bdd 437 | .long 0x964b4bdd 438 | .long 0x61bdbddc 439 | .long 0x61bdbddc 440 | .long 0x0d8b8b86 441 | .long 0x0d8b8b86 442 | .long 0x0f8a8a85 443 | .long 0x0f8a8a85 444 | .long 0xe0707090 445 | .long 0xe0707090 446 | .long 0x7c3e3e42 447 | .long 0x7c3e3e42 448 | .long 0x71b5b5c4 449 | .long 0x71b5b5c4 450 | .long 0xcc6666aa 451 | .long 0xcc6666aa 452 | .long 0x904848d8 453 | .long 0x904848d8 454 | .long 0x06030305 455 | .long 0x06030305 456 | .long 0xf7f6f601 457 | .long 0xf7f6f601 458 | .long 0x1c0e0e12 459 | .long 0x1c0e0e12 460 | .long 0xc26161a3 461 | .long 0xc26161a3 462 | .long 0x6a35355f 463 | .long 0x6a35355f 464 | .long 0xae5757f9 465 | .long 0xae5757f9 466 | .long 0x69b9b9d0 467 | .long 0x69b9b9d0 468 | .long 0x17868691 469 | .long 0x17868691 470 | .long 0x99c1c158 471 | .long 0x99c1c158 472 | .long 0x3a1d1d27 473 | .long 0x3a1d1d27 474 | .long 0x279e9eb9 475 | .long 0x279e9eb9 476 | .long 0xd9e1e138 477 | .long 0xd9e1e138 478 | .long 0xebf8f813 479 | .long 0xebf8f813 480 | .long 0x2b9898b3 481 | .long 0x2b9898b3 482 | .long 0x22111133 483 | .long 0x22111133 484 | .long 0xd26969bb 485 | .long 0xd26969bb 486 | .long 0xa9d9d970 487 | .long 0xa9d9d970 488 | .long 0x078e8e89 489 | .long 0x078e8e89 490 | .long 0x339494a7 491 | .long 0x339494a7 492 | .long 0x2d9b9bb6 493 | .long 0x2d9b9bb6 494 | .long 0x3c1e1e22 495 | .long 0x3c1e1e22 496 | .long 0x15878792 497 | .long 0x15878792 498 | .long 0xc9e9e920 499 | .long 0xc9e9e920 500 | .long 0x87cece49 501 | .long 0x87cece49 502 | .long 0xaa5555ff 503 | .long 0xaa5555ff 504 | .long 0x50282878 505 | .long 0x50282878 506 | .long 0xa5dfdf7a 507 | .long 0xa5dfdf7a 508 | .long 0x038c8c8f 509 | .long 0x038c8c8f 510 | .long 0x59a1a1f8 511 | .long 0x59a1a1f8 512 | .long 0x09898980 513 | .long 0x09898980 514 | .long 0x1a0d0d17 515 | .long 0x1a0d0d17 516 | .long 0x65bfbfda 517 | .long 0x65bfbfda 518 | .long 0xd7e6e631 519 | .long 0xd7e6e631 520 | .long 0x844242c6 521 | .long 0x844242c6 522 | .long 0xd06868b8 523 | .long 0xd06868b8 524 | .long 0x824141c3 525 | .long 0x824141c3 526 | .long 0x299999b0 527 | .long 0x299999b0 528 | .long 0x5a2d2d77 529 | .long 0x5a2d2d77 530 | .long 0x1e0f0f11 531 | .long 0x1e0f0f11 532 | .long 0x7bb0b0cb 533 | .long 0x7bb0b0cb 534 | .long 0xa85454fc 535 | .long 0xa85454fc 536 | .long 0x6dbbbbd6 537 | .long 0x6dbbbbd6 538 | .long 0x2c16163a 539 | .long 0x2c16163a 540 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_sparc_constants.c: -------------------------------------------------------------------------------- 1 | /* 2 | aes_sparc_constants.c version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | */ 6 | 7 | const unsigned int aes_sparc_constants[1034] = { 8 | 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 9 | 0xa56363c6,0x847c7cf8,0x997777ee,0x8d7b7bf6, 10 | 0x0df2f2ff,0xbd6b6bd6,0xb16f6fde,0x54c5c591, 11 | 0x50303060,0x03010102,0xa96767ce,0x7d2b2b56, 12 | 0x19fefee7,0x62d7d7b5,0xe6abab4d,0x9a7676ec, 13 | 0x45caca8f,0x9d82821f,0x40c9c989,0x877d7dfa, 14 | 0x15fafaef,0xeb5959b2,0xc947478e,0x0bf0f0fb, 15 | 0xecadad41,0x67d4d4b3,0xfda2a25f,0xeaafaf45, 16 | 0xbf9c9c23,0xf7a4a453,0x967272e4,0x5bc0c09b, 17 | 0xc2b7b775,0x1cfdfde1,0xae93933d,0x6a26264c, 18 | 0x5a36366c,0x413f3f7e,0x02f7f7f5,0x4fcccc83, 19 | 0x5c343468,0xf4a5a551,0x34e5e5d1,0x08f1f1f9, 20 | 0x937171e2,0x73d8d8ab,0x53313162,0x3f15152a, 21 | 0x0c040408,0x52c7c795,0x65232346,0x5ec3c39d, 22 | 0x28181830,0xa1969637,0x0f05050a,0xb59a9a2f, 23 | 0x0907070e,0x36121224,0x9b80801b,0x3de2e2df, 24 | 0x26ebebcd,0x6927274e,0xcdb2b27f,0x9f7575ea, 25 | 0x1b090912,0x9e83831d,0x742c2c58,0x2e1a1a34, 26 | 0x2d1b1b36,0xb26e6edc,0xee5a5ab4,0xfba0a05b, 27 | 0xf65252a4,0x4d3b3b76,0x61d6d6b7,0xceb3b37d, 28 | 0x7b292952,0x3ee3e3dd,0x712f2f5e,0x97848413, 29 | 0xf55353a6,0x68d1d1b9,0x00000000,0x2cededc1, 30 | 0x60202040,0x1ffcfce3,0xc8b1b179,0xed5b5bb6, 31 | 0xbe6a6ad4,0x46cbcb8d,0xd9bebe67,0x4b393972, 32 | 0xde4a4a94,0xd44c4c98,0xe85858b0,0x4acfcf85, 33 | 0x6bd0d0bb,0x2aefefc5,0xe5aaaa4f,0x16fbfbed, 34 | 0xc5434386,0xd74d4d9a,0x55333366,0x94858511, 35 | 0xcf45458a,0x10f9f9e9,0x06020204,0x817f7ffe, 36 | 0xf05050a0,0x443c3c78,0xba9f9f25,0xe3a8a84b, 37 | 0xf35151a2,0xfea3a35d,0xc0404080,0x8a8f8f05, 38 | 0xad92923f,0xbc9d9d21,0x48383870,0x04f5f5f1, 39 | 0xdfbcbc63,0xc1b6b677,0x75dadaaf,0x63212142, 40 | 0x30101020,0x1affffe5,0x0ef3f3fd,0x6dd2d2bf, 41 | 0x4ccdcd81,0x140c0c18,0x35131326,0x2fececc3, 42 | 0xe15f5fbe,0xa2979735,0xcc444488,0x3917172e, 43 | 0x57c4c493,0xf2a7a755,0x827e7efc,0x473d3d7a, 44 | 0xac6464c8,0xe75d5dba,0x2b191932,0x957373e6, 45 | 0xa06060c0,0x98818119,0xd14f4f9e,0x7fdcdca3, 46 | 0x66222244,0x7e2a2a54,0xab90903b,0x8388880b, 47 | 0xca46468c,0x29eeeec7,0xd3b8b86b,0x3c141428, 48 | 0x79dedea7,0xe25e5ebc,0x1d0b0b16,0x76dbdbad, 49 | 0x3be0e0db,0x56323264,0x4e3a3a74,0x1e0a0a14, 50 | 0xdb494992,0x0a06060c,0x6c242448,0xe45c5cb8, 51 | 0x5dc2c29f,0x6ed3d3bd,0xefacac43,0xa66262c4, 52 | 0xa8919139,0xa4959531,0x37e4e4d3,0x8b7979f2, 53 | 0x32e7e7d5,0x43c8c88b,0x5937376e,0xb76d6dda, 54 | 0x8c8d8d01,0x64d5d5b1,0xd24e4e9c,0xe0a9a949, 55 | 0xb46c6cd8,0xfa5656ac,0x07f4f4f3,0x25eaeacf, 56 | 0xaf6565ca,0x8e7a7af4,0xe9aeae47,0x18080810, 57 | 0xd5baba6f,0x887878f0,0x6f25254a,0x722e2e5c, 58 | 0x241c1c38,0xf1a6a657,0xc7b4b473,0x51c6c697, 59 | 0x23e8e8cb,0x7cdddda1,0x9c7474e8,0x211f1f3e, 60 | 0xdd4b4b96,0xdcbdbd61,0x868b8b0d,0x858a8a0f, 61 | 0x907070e0,0x423e3e7c,0xc4b5b571,0xaa6666cc, 62 | 0xd8484890,0x05030306,0x01f6f6f7,0x120e0e1c, 63 | 0xa36161c2,0x5f35356a,0xf95757ae,0xd0b9b969, 64 | 0x91868617,0x58c1c199,0x271d1d3a,0xb99e9e27, 65 | 0x38e1e1d9,0x13f8f8eb,0xb398982b,0x33111122, 66 | 0xbb6969d2,0x70d9d9a9,0x898e8e07,0xa7949433, 67 | 0xb69b9b2d,0x221e1e3c,0x92878715,0x20e9e9c9, 68 | 0x49cece87,0xff5555aa,0x78282850,0x7adfdfa5, 69 | 0x8f8c8c03,0xf8a1a159,0x80898909,0x170d0d1a, 70 | 0xdabfbf65,0x31e6e6d7,0xc6424284,0xb86868d0, 71 | 0xc3414182,0xb0999929,0x772d2d5a,0x110f0f1e, 72 | 0xcbb0b07b,0xfc5454a8,0xd6bbbb6d,0x3a16162c, 73 | 0x6363c6a5,0x7c7cf884,0x7777ee99,0x7b7bf68d, 74 | 0xf2f2ff0d,0x6b6bd6bd,0x6f6fdeb1,0xc5c59154, 75 | 0x30306050,0x01010203,0x6767cea9,0x2b2b567d, 76 | 0xfefee719,0xd7d7b562,0xabab4de6,0x7676ec9a, 77 | 0xcaca8f45,0x82821f9d,0xc9c98940,0x7d7dfa87, 78 | 0xfafaef15,0x5959b2eb,0x47478ec9,0xf0f0fb0b, 79 | 0xadad41ec,0xd4d4b367,0xa2a25ffd,0xafaf45ea, 80 | 0x9c9c23bf,0xa4a453f7,0x7272e496,0xc0c09b5b, 81 | 0xb7b775c2,0xfdfde11c,0x93933dae,0x26264c6a, 82 | 0x36366c5a,0x3f3f7e41,0xf7f7f502,0xcccc834f, 83 | 0x3434685c,0xa5a551f4,0xe5e5d134,0xf1f1f908, 84 | 0x7171e293,0xd8d8ab73,0x31316253,0x15152a3f, 85 | 0x0404080c,0xc7c79552,0x23234665,0xc3c39d5e, 86 | 0x18183028,0x969637a1,0x05050a0f,0x9a9a2fb5, 87 | 0x07070e09,0x12122436,0x80801b9b,0xe2e2df3d, 88 | 0xebebcd26,0x27274e69,0xb2b27fcd,0x7575ea9f, 89 | 0x0909121b,0x83831d9e,0x2c2c5874,0x1a1a342e, 90 | 0x1b1b362d,0x6e6edcb2,0x5a5ab4ee,0xa0a05bfb, 91 | 0x5252a4f6,0x3b3b764d,0xd6d6b761,0xb3b37dce, 92 | 0x2929527b,0xe3e3dd3e,0x2f2f5e71,0x84841397, 93 | 0x5353a6f5,0xd1d1b968,0x00000000,0xededc12c, 94 | 0x20204060,0xfcfce31f,0xb1b179c8,0x5b5bb6ed, 95 | 0x6a6ad4be,0xcbcb8d46,0xbebe67d9,0x3939724b, 96 | 0x4a4a94de,0x4c4c98d4,0x5858b0e8,0xcfcf854a, 97 | 0xd0d0bb6b,0xefefc52a,0xaaaa4fe5,0xfbfbed16, 98 | 0x434386c5,0x4d4d9ad7,0x33336655,0x85851194, 99 | 0x45458acf,0xf9f9e910,0x02020406,0x7f7ffe81, 100 | 0x5050a0f0,0x3c3c7844,0x9f9f25ba,0xa8a84be3, 101 | 0x5151a2f3,0xa3a35dfe,0x404080c0,0x8f8f058a, 102 | 0x92923fad,0x9d9d21bc,0x38387048,0xf5f5f104, 103 | 0xbcbc63df,0xb6b677c1,0xdadaaf75,0x21214263, 104 | 0x10102030,0xffffe51a,0xf3f3fd0e,0xd2d2bf6d, 105 | 0xcdcd814c,0x0c0c1814,0x13132635,0xececc32f, 106 | 0x5f5fbee1,0x979735a2,0x444488cc,0x17172e39, 107 | 0xc4c49357,0xa7a755f2,0x7e7efc82,0x3d3d7a47, 108 | 0x6464c8ac,0x5d5dbae7,0x1919322b,0x7373e695, 109 | 0x6060c0a0,0x81811998,0x4f4f9ed1,0xdcdca37f, 110 | 0x22224466,0x2a2a547e,0x90903bab,0x88880b83, 111 | 0x46468cca,0xeeeec729,0xb8b86bd3,0x1414283c, 112 | 0xdedea779,0x5e5ebce2,0x0b0b161d,0xdbdbad76, 113 | 0xe0e0db3b,0x32326456,0x3a3a744e,0x0a0a141e, 114 | 0x494992db,0x06060c0a,0x2424486c,0x5c5cb8e4, 115 | 0xc2c29f5d,0xd3d3bd6e,0xacac43ef,0x6262c4a6, 116 | 0x919139a8,0x959531a4,0xe4e4d337,0x7979f28b, 117 | 0xe7e7d532,0xc8c88b43,0x37376e59,0x6d6ddab7, 118 | 0x8d8d018c,0xd5d5b164,0x4e4e9cd2,0xa9a949e0, 119 | 0x6c6cd8b4,0x5656acfa,0xf4f4f307,0xeaeacf25, 120 | 0x6565caaf,0x7a7af48e,0xaeae47e9,0x08081018, 121 | 0xbaba6fd5,0x7878f088,0x25254a6f,0x2e2e5c72, 122 | 0x1c1c3824,0xa6a657f1,0xb4b473c7,0xc6c69751, 123 | 0xe8e8cb23,0xdddda17c,0x7474e89c,0x1f1f3e21, 124 | 0x4b4b96dd,0xbdbd61dc,0x8b8b0d86,0x8a8a0f85, 125 | 0x7070e090,0x3e3e7c42,0xb5b571c4,0x6666ccaa, 126 | 0x484890d8,0x03030605,0xf6f6f701,0x0e0e1c12, 127 | 0x6161c2a3,0x35356a5f,0x5757aef9,0xb9b969d0, 128 | 0x86861791,0xc1c19958,0x1d1d3a27,0x9e9e27b9, 129 | 0xe1e1d938,0xf8f8eb13,0x98982bb3,0x11112233, 130 | 0x6969d2bb,0xd9d9a970,0x8e8e0789,0x949433a7, 131 | 0x9b9b2db6,0x1e1e3c22,0x87871592,0xe9e9c920, 132 | 0xcece8749,0x5555aaff,0x28285078,0xdfdfa57a, 133 | 0x8c8c038f,0xa1a159f8,0x89890980,0x0d0d1a17, 134 | 0xbfbf65da,0xe6e6d731,0x424284c6,0x6868d0b8, 135 | 0x414182c3,0x999929b0,0x2d2d5a77,0x0f0f1e11, 136 | 0xb0b07bcb,0x5454a8fc,0xbbbb6dd6,0x16162c3a, 137 | 0x63c6a563,0x7cf8847c,0x77ee9977,0x7bf68d7b, 138 | 0xf2ff0df2,0x6bd6bd6b,0x6fdeb16f,0xc59154c5, 139 | 0x30605030,0x01020301,0x67cea967,0x2b567d2b, 140 | 0xfee719fe,0xd7b562d7,0xab4de6ab,0x76ec9a76, 141 | 0xca8f45ca,0x821f9d82,0xc98940c9,0x7dfa877d, 142 | 0xfaef15fa,0x59b2eb59,0x478ec947,0xf0fb0bf0, 143 | 0xad41ecad,0xd4b367d4,0xa25ffda2,0xaf45eaaf, 144 | 0x9c23bf9c,0xa453f7a4,0x72e49672,0xc09b5bc0, 145 | 0xb775c2b7,0xfde11cfd,0x933dae93,0x264c6a26, 146 | 0x366c5a36,0x3f7e413f,0xf7f502f7,0xcc834fcc, 147 | 0x34685c34,0xa551f4a5,0xe5d134e5,0xf1f908f1, 148 | 0x71e29371,0xd8ab73d8,0x31625331,0x152a3f15, 149 | 0x04080c04,0xc79552c7,0x23466523,0xc39d5ec3, 150 | 0x18302818,0x9637a196,0x050a0f05,0x9a2fb59a, 151 | 0x070e0907,0x12243612,0x801b9b80,0xe2df3de2, 152 | 0xebcd26eb,0x274e6927,0xb27fcdb2,0x75ea9f75, 153 | 0x09121b09,0x831d9e83,0x2c58742c,0x1a342e1a, 154 | 0x1b362d1b,0x6edcb26e,0x5ab4ee5a,0xa05bfba0, 155 | 0x52a4f652,0x3b764d3b,0xd6b761d6,0xb37dceb3, 156 | 0x29527b29,0xe3dd3ee3,0x2f5e712f,0x84139784, 157 | 0x53a6f553,0xd1b968d1,0x00000000,0xedc12ced, 158 | 0x20406020,0xfce31ffc,0xb179c8b1,0x5bb6ed5b, 159 | 0x6ad4be6a,0xcb8d46cb,0xbe67d9be,0x39724b39, 160 | 0x4a94de4a,0x4c98d44c,0x58b0e858,0xcf854acf, 161 | 0xd0bb6bd0,0xefc52aef,0xaa4fe5aa,0xfbed16fb, 162 | 0x4386c543,0x4d9ad74d,0x33665533,0x85119485, 163 | 0x458acf45,0xf9e910f9,0x02040602,0x7ffe817f, 164 | 0x50a0f050,0x3c78443c,0x9f25ba9f,0xa84be3a8, 165 | 0x51a2f351,0xa35dfea3,0x4080c040,0x8f058a8f, 166 | 0x923fad92,0x9d21bc9d,0x38704838,0xf5f104f5, 167 | 0xbc63dfbc,0xb677c1b6,0xdaaf75da,0x21426321, 168 | 0x10203010,0xffe51aff,0xf3fd0ef3,0xd2bf6dd2, 169 | 0xcd814ccd,0x0c18140c,0x13263513,0xecc32fec, 170 | 0x5fbee15f,0x9735a297,0x4488cc44,0x172e3917, 171 | 0xc49357c4,0xa755f2a7,0x7efc827e,0x3d7a473d, 172 | 0x64c8ac64,0x5dbae75d,0x19322b19,0x73e69573, 173 | 0x60c0a060,0x81199881,0x4f9ed14f,0xdca37fdc, 174 | 0x22446622,0x2a547e2a,0x903bab90,0x880b8388, 175 | 0x468cca46,0xeec729ee,0xb86bd3b8,0x14283c14, 176 | 0xdea779de,0x5ebce25e,0x0b161d0b,0xdbad76db, 177 | 0xe0db3be0,0x32645632,0x3a744e3a,0x0a141e0a, 178 | 0x4992db49,0x060c0a06,0x24486c24,0x5cb8e45c, 179 | 0xc29f5dc2,0xd3bd6ed3,0xac43efac,0x62c4a662, 180 | 0x9139a891,0x9531a495,0xe4d337e4,0x79f28b79, 181 | 0xe7d532e7,0xc88b43c8,0x376e5937,0x6ddab76d, 182 | 0x8d018c8d,0xd5b164d5,0x4e9cd24e,0xa949e0a9, 183 | 0x6cd8b46c,0x56acfa56,0xf4f307f4,0xeacf25ea, 184 | 0x65caaf65,0x7af48e7a,0xae47e9ae,0x08101808, 185 | 0xba6fd5ba,0x78f08878,0x254a6f25,0x2e5c722e, 186 | 0x1c38241c,0xa657f1a6,0xb473c7b4,0xc69751c6, 187 | 0xe8cb23e8,0xdda17cdd,0x74e89c74,0x1f3e211f, 188 | 0x4b96dd4b,0xbd61dcbd,0x8b0d868b,0x8a0f858a, 189 | 0x70e09070,0x3e7c423e,0xb571c4b5,0x66ccaa66, 190 | 0x4890d848,0x03060503,0xf6f701f6,0x0e1c120e, 191 | 0x61c2a361,0x356a5f35,0x57aef957,0xb969d0b9, 192 | 0x86179186,0xc19958c1,0x1d3a271d,0x9e27b99e, 193 | 0xe1d938e1,0xf8eb13f8,0x982bb398,0x11223311, 194 | 0x69d2bb69,0xd9a970d9,0x8e07898e,0x9433a794, 195 | 0x9b2db69b,0x1e3c221e,0x87159287,0xe9c920e9, 196 | 0xce8749ce,0x55aaff55,0x28507828,0xdfa57adf, 197 | 0x8c038f8c,0xa159f8a1,0x89098089,0x0d1a170d, 198 | 0xbf65dabf,0xe6d731e6,0x4284c642,0x68d0b868, 199 | 0x4182c341,0x9929b099,0x2d5a772d,0x0f1e110f, 200 | 0xb07bcbb0,0x54a8fc54,0xbb6dd6bb,0x162c3a16, 201 | 0xc6a56363,0xf8847c7c,0xee997777,0xf68d7b7b, 202 | 0xff0df2f2,0xd6bd6b6b,0xdeb16f6f,0x9154c5c5, 203 | 0x60503030,0x02030101,0xcea96767,0x567d2b2b, 204 | 0xe719fefe,0xb562d7d7,0x4de6abab,0xec9a7676, 205 | 0x8f45caca,0x1f9d8282,0x8940c9c9,0xfa877d7d, 206 | 0xef15fafa,0xb2eb5959,0x8ec94747,0xfb0bf0f0, 207 | 0x41ecadad,0xb367d4d4,0x5ffda2a2,0x45eaafaf, 208 | 0x23bf9c9c,0x53f7a4a4,0xe4967272,0x9b5bc0c0, 209 | 0x75c2b7b7,0xe11cfdfd,0x3dae9393,0x4c6a2626, 210 | 0x6c5a3636,0x7e413f3f,0xf502f7f7,0x834fcccc, 211 | 0x685c3434,0x51f4a5a5,0xd134e5e5,0xf908f1f1, 212 | 0xe2937171,0xab73d8d8,0x62533131,0x2a3f1515, 213 | 0x080c0404,0x9552c7c7,0x46652323,0x9d5ec3c3, 214 | 0x30281818,0x37a19696,0x0a0f0505,0x2fb59a9a, 215 | 0x0e090707,0x24361212,0x1b9b8080,0xdf3de2e2, 216 | 0xcd26ebeb,0x4e692727,0x7fcdb2b2,0xea9f7575, 217 | 0x121b0909,0x1d9e8383,0x58742c2c,0x342e1a1a, 218 | 0x362d1b1b,0xdcb26e6e,0xb4ee5a5a,0x5bfba0a0, 219 | 0xa4f65252,0x764d3b3b,0xb761d6d6,0x7dceb3b3, 220 | 0x527b2929,0xdd3ee3e3,0x5e712f2f,0x13978484, 221 | 0xa6f55353,0xb968d1d1,0x00000000,0xc12ceded, 222 | 0x40602020,0xe31ffcfc,0x79c8b1b1,0xb6ed5b5b, 223 | 0xd4be6a6a,0x8d46cbcb,0x67d9bebe,0x724b3939, 224 | 0x94de4a4a,0x98d44c4c,0xb0e85858,0x854acfcf, 225 | 0xbb6bd0d0,0xc52aefef,0x4fe5aaaa,0xed16fbfb, 226 | 0x86c54343,0x9ad74d4d,0x66553333,0x11948585, 227 | 0x8acf4545,0xe910f9f9,0x04060202,0xfe817f7f, 228 | 0xa0f05050,0x78443c3c,0x25ba9f9f,0x4be3a8a8, 229 | 0xa2f35151,0x5dfea3a3,0x80c04040,0x058a8f8f, 230 | 0x3fad9292,0x21bc9d9d,0x70483838,0xf104f5f5, 231 | 0x63dfbcbc,0x77c1b6b6,0xaf75dada,0x42632121, 232 | 0x20301010,0xe51affff,0xfd0ef3f3,0xbf6dd2d2, 233 | 0x814ccdcd,0x18140c0c,0x26351313,0xc32fecec, 234 | 0xbee15f5f,0x35a29797,0x88cc4444,0x2e391717, 235 | 0x9357c4c4,0x55f2a7a7,0xfc827e7e,0x7a473d3d, 236 | 0xc8ac6464,0xbae75d5d,0x322b1919,0xe6957373, 237 | 0xc0a06060,0x19988181,0x9ed14f4f,0xa37fdcdc, 238 | 0x44662222,0x547e2a2a,0x3bab9090,0x0b838888, 239 | 0x8cca4646,0xc729eeee,0x6bd3b8b8,0x283c1414, 240 | 0xa779dede,0xbce25e5e,0x161d0b0b,0xad76dbdb, 241 | 0xdb3be0e0,0x64563232,0x744e3a3a,0x141e0a0a, 242 | 0x92db4949,0x0c0a0606,0x486c2424,0xb8e45c5c, 243 | 0x9f5dc2c2,0xbd6ed3d3,0x43efacac,0xc4a66262, 244 | 0x39a89191,0x31a49595,0xd337e4e4,0xf28b7979, 245 | 0xd532e7e7,0x8b43c8c8,0x6e593737,0xdab76d6d, 246 | 0x018c8d8d,0xb164d5d5,0x9cd24e4e,0x49e0a9a9, 247 | 0xd8b46c6c,0xacfa5656,0xf307f4f4,0xcf25eaea, 248 | 0xcaaf6565,0xf48e7a7a,0x47e9aeae,0x10180808, 249 | 0x6fd5baba,0xf0887878,0x4a6f2525,0x5c722e2e, 250 | 0x38241c1c,0x57f1a6a6,0x73c7b4b4,0x9751c6c6, 251 | 0xcb23e8e8,0xa17cdddd,0xe89c7474,0x3e211f1f, 252 | 0x96dd4b4b,0x61dcbdbd,0x0d868b8b,0x0f858a8a, 253 | 0xe0907070,0x7c423e3e,0x71c4b5b5,0xccaa6666, 254 | 0x90d84848,0x06050303,0xf701f6f6,0x1c120e0e, 255 | 0xc2a36161,0x6a5f3535,0xaef95757,0x69d0b9b9, 256 | 0x17918686,0x9958c1c1,0x3a271d1d,0x27b99e9e, 257 | 0xd938e1e1,0xeb13f8f8,0x2bb39898,0x22331111, 258 | 0xd2bb6969,0xa970d9d9,0x07898e8e,0x33a79494, 259 | 0x2db69b9b,0x3c221e1e,0x15928787,0xc920e9e9, 260 | 0x8749cece,0xaaff5555,0x50782828,0xa57adfdf, 261 | 0x038f8c8c,0x59f8a1a1,0x09808989,0x1a170d0d, 262 | 0x65dabfbf,0xd731e6e6,0x84c64242,0xd0b86868, 263 | 0x82c34141,0x29b09999,0x5a772d2d,0x1e110f0f, 264 | 0x7bcbb0b0,0xa8fc5454,0x6dd6bbbb,0x2c3a1616, 265 | }; 266 | -------------------------------------------------------------------------------- /c_src/poly1305aes/aes_big_constants.c: -------------------------------------------------------------------------------- 1 | /* 2 | aes_big_constants.c version 20050203 3 | D. J. Bernstein 4 | Public domain. 5 | 6 | An 8-byte-aligned 2048-byte table containing, e.g., 7 | c6 63 63 a5 c6 63 63 00 8 | f8 7c 7c 84 f8 7c 7c 00 9 | would be fine for the PowerPC (or Pentium), 10 | which supports unaligned loads within 8 bytes with no slowdown; 11 | of course, have to schedule carefully for constant timing. 12 | But portable code can't use unaligned loads. 13 | */ 14 | 15 | #include "aes_big.h" 16 | 17 | const unsigned int aes_big_constants[1034] = { 18 | 0x01000000, 19 | 0x02000000, 20 | 0x04000000, 21 | 0x08000000, 22 | 0x10000000, 23 | 0x20000000, 24 | 0x40000000, 25 | 0x80000000, 26 | 0x1b000000, 27 | 0x36000000, 28 | 0xc66363a5, 0x63a5c663, 0xa5c66363, 0x6363a5c6, 29 | 0xf87c7c84, 0x7c84f87c, 0x84f87c7c, 0x7c7c84f8, 30 | 0xee777799, 0x7799ee77, 0x99ee7777, 0x777799ee, 31 | 0xf67b7b8d, 0x7b8df67b, 0x8df67b7b, 0x7b7b8df6, 32 | 0xfff2f20d, 0xf20dfff2, 0x0dfff2f2, 0xf2f20dff, 33 | 0xd66b6bbd, 0x6bbdd66b, 0xbdd66b6b, 0x6b6bbdd6, 34 | 0xde6f6fb1, 0x6fb1de6f, 0xb1de6f6f, 0x6f6fb1de, 35 | 0x91c5c554, 0xc55491c5, 0x5491c5c5, 0xc5c55491, 36 | 0x60303050, 0x30506030, 0x50603030, 0x30305060, 37 | 0x02010103, 0x01030201, 0x03020101, 0x01010302, 38 | 0xce6767a9, 0x67a9ce67, 0xa9ce6767, 0x6767a9ce, 39 | 0x562b2b7d, 0x2b7d562b, 0x7d562b2b, 0x2b2b7d56, 40 | 0xe7fefe19, 0xfe19e7fe, 0x19e7fefe, 0xfefe19e7, 41 | 0xb5d7d762, 0xd762b5d7, 0x62b5d7d7, 0xd7d762b5, 42 | 0x4dababe6, 0xabe64dab, 0xe64dabab, 0xababe64d, 43 | 0xec76769a, 0x769aec76, 0x9aec7676, 0x76769aec, 44 | 0x8fcaca45, 0xca458fca, 0x458fcaca, 0xcaca458f, 45 | 0x1f82829d, 0x829d1f82, 0x9d1f8282, 0x82829d1f, 46 | 0x89c9c940, 0xc94089c9, 0x4089c9c9, 0xc9c94089, 47 | 0xfa7d7d87, 0x7d87fa7d, 0x87fa7d7d, 0x7d7d87fa, 48 | 0xeffafa15, 0xfa15effa, 0x15effafa, 0xfafa15ef, 49 | 0xb25959eb, 0x59ebb259, 0xebb25959, 0x5959ebb2, 50 | 0x8e4747c9, 0x47c98e47, 0xc98e4747, 0x4747c98e, 51 | 0xfbf0f00b, 0xf00bfbf0, 0x0bfbf0f0, 0xf0f00bfb, 52 | 0x41adadec, 0xadec41ad, 0xec41adad, 0xadadec41, 53 | 0xb3d4d467, 0xd467b3d4, 0x67b3d4d4, 0xd4d467b3, 54 | 0x5fa2a2fd, 0xa2fd5fa2, 0xfd5fa2a2, 0xa2a2fd5f, 55 | 0x45afafea, 0xafea45af, 0xea45afaf, 0xafafea45, 56 | 0x239c9cbf, 0x9cbf239c, 0xbf239c9c, 0x9c9cbf23, 57 | 0x53a4a4f7, 0xa4f753a4, 0xf753a4a4, 0xa4a4f753, 58 | 0xe4727296, 0x7296e472, 0x96e47272, 0x727296e4, 59 | 0x9bc0c05b, 0xc05b9bc0, 0x5b9bc0c0, 0xc0c05b9b, 60 | 0x75b7b7c2, 0xb7c275b7, 0xc275b7b7, 0xb7b7c275, 61 | 0xe1fdfd1c, 0xfd1ce1fd, 0x1ce1fdfd, 0xfdfd1ce1, 62 | 0x3d9393ae, 0x93ae3d93, 0xae3d9393, 0x9393ae3d, 63 | 0x4c26266a, 0x266a4c26, 0x6a4c2626, 0x26266a4c, 64 | 0x6c36365a, 0x365a6c36, 0x5a6c3636, 0x36365a6c, 65 | 0x7e3f3f41, 0x3f417e3f, 0x417e3f3f, 0x3f3f417e, 66 | 0xf5f7f702, 0xf702f5f7, 0x02f5f7f7, 0xf7f702f5, 67 | 0x83cccc4f, 0xcc4f83cc, 0x4f83cccc, 0xcccc4f83, 68 | 0x6834345c, 0x345c6834, 0x5c683434, 0x34345c68, 69 | 0x51a5a5f4, 0xa5f451a5, 0xf451a5a5, 0xa5a5f451, 70 | 0xd1e5e534, 0xe534d1e5, 0x34d1e5e5, 0xe5e534d1, 71 | 0xf9f1f108, 0xf108f9f1, 0x08f9f1f1, 0xf1f108f9, 72 | 0xe2717193, 0x7193e271, 0x93e27171, 0x717193e2, 73 | 0xabd8d873, 0xd873abd8, 0x73abd8d8, 0xd8d873ab, 74 | 0x62313153, 0x31536231, 0x53623131, 0x31315362, 75 | 0x2a15153f, 0x153f2a15, 0x3f2a1515, 0x15153f2a, 76 | 0x0804040c, 0x040c0804, 0x0c080404, 0x04040c08, 77 | 0x95c7c752, 0xc75295c7, 0x5295c7c7, 0xc7c75295, 78 | 0x46232365, 0x23654623, 0x65462323, 0x23236546, 79 | 0x9dc3c35e, 0xc35e9dc3, 0x5e9dc3c3, 0xc3c35e9d, 80 | 0x30181828, 0x18283018, 0x28301818, 0x18182830, 81 | 0x379696a1, 0x96a13796, 0xa1379696, 0x9696a137, 82 | 0x0a05050f, 0x050f0a05, 0x0f0a0505, 0x05050f0a, 83 | 0x2f9a9ab5, 0x9ab52f9a, 0xb52f9a9a, 0x9a9ab52f, 84 | 0x0e070709, 0x07090e07, 0x090e0707, 0x0707090e, 85 | 0x24121236, 0x12362412, 0x36241212, 0x12123624, 86 | 0x1b80809b, 0x809b1b80, 0x9b1b8080, 0x80809b1b, 87 | 0xdfe2e23d, 0xe23ddfe2, 0x3ddfe2e2, 0xe2e23ddf, 88 | 0xcdebeb26, 0xeb26cdeb, 0x26cdebeb, 0xebeb26cd, 89 | 0x4e272769, 0x27694e27, 0x694e2727, 0x2727694e, 90 | 0x7fb2b2cd, 0xb2cd7fb2, 0xcd7fb2b2, 0xb2b2cd7f, 91 | 0xea75759f, 0x759fea75, 0x9fea7575, 0x75759fea, 92 | 0x1209091b, 0x091b1209, 0x1b120909, 0x09091b12, 93 | 0x1d83839e, 0x839e1d83, 0x9e1d8383, 0x83839e1d, 94 | 0x582c2c74, 0x2c74582c, 0x74582c2c, 0x2c2c7458, 95 | 0x341a1a2e, 0x1a2e341a, 0x2e341a1a, 0x1a1a2e34, 96 | 0x361b1b2d, 0x1b2d361b, 0x2d361b1b, 0x1b1b2d36, 97 | 0xdc6e6eb2, 0x6eb2dc6e, 0xb2dc6e6e, 0x6e6eb2dc, 98 | 0xb45a5aee, 0x5aeeb45a, 0xeeb45a5a, 0x5a5aeeb4, 99 | 0x5ba0a0fb, 0xa0fb5ba0, 0xfb5ba0a0, 0xa0a0fb5b, 100 | 0xa45252f6, 0x52f6a452, 0xf6a45252, 0x5252f6a4, 101 | 0x763b3b4d, 0x3b4d763b, 0x4d763b3b, 0x3b3b4d76, 102 | 0xb7d6d661, 0xd661b7d6, 0x61b7d6d6, 0xd6d661b7, 103 | 0x7db3b3ce, 0xb3ce7db3, 0xce7db3b3, 0xb3b3ce7d, 104 | 0x5229297b, 0x297b5229, 0x7b522929, 0x29297b52, 105 | 0xdde3e33e, 0xe33edde3, 0x3edde3e3, 0xe3e33edd, 106 | 0x5e2f2f71, 0x2f715e2f, 0x715e2f2f, 0x2f2f715e, 107 | 0x13848497, 0x84971384, 0x97138484, 0x84849713, 108 | 0xa65353f5, 0x53f5a653, 0xf5a65353, 0x5353f5a6, 109 | 0xb9d1d168, 0xd168b9d1, 0x68b9d1d1, 0xd1d168b9, 110 | 0x00000000, 0x00000000, 0x00000000, 0x00000000, 111 | 0xc1eded2c, 0xed2cc1ed, 0x2cc1eded, 0xeded2cc1, 112 | 0x40202060, 0x20604020, 0x60402020, 0x20206040, 113 | 0xe3fcfc1f, 0xfc1fe3fc, 0x1fe3fcfc, 0xfcfc1fe3, 114 | 0x79b1b1c8, 0xb1c879b1, 0xc879b1b1, 0xb1b1c879, 115 | 0xb65b5bed, 0x5bedb65b, 0xedb65b5b, 0x5b5bedb6, 116 | 0xd46a6abe, 0x6abed46a, 0xbed46a6a, 0x6a6abed4, 117 | 0x8dcbcb46, 0xcb468dcb, 0x468dcbcb, 0xcbcb468d, 118 | 0x67bebed9, 0xbed967be, 0xd967bebe, 0xbebed967, 119 | 0x7239394b, 0x394b7239, 0x4b723939, 0x39394b72, 120 | 0x944a4ade, 0x4ade944a, 0xde944a4a, 0x4a4ade94, 121 | 0x984c4cd4, 0x4cd4984c, 0xd4984c4c, 0x4c4cd498, 122 | 0xb05858e8, 0x58e8b058, 0xe8b05858, 0x5858e8b0, 123 | 0x85cfcf4a, 0xcf4a85cf, 0x4a85cfcf, 0xcfcf4a85, 124 | 0xbbd0d06b, 0xd06bbbd0, 0x6bbbd0d0, 0xd0d06bbb, 125 | 0xc5efef2a, 0xef2ac5ef, 0x2ac5efef, 0xefef2ac5, 126 | 0x4faaaae5, 0xaae54faa, 0xe54faaaa, 0xaaaae54f, 127 | 0xedfbfb16, 0xfb16edfb, 0x16edfbfb, 0xfbfb16ed, 128 | 0x864343c5, 0x43c58643, 0xc5864343, 0x4343c586, 129 | 0x9a4d4dd7, 0x4dd79a4d, 0xd79a4d4d, 0x4d4dd79a, 130 | 0x66333355, 0x33556633, 0x55663333, 0x33335566, 131 | 0x11858594, 0x85941185, 0x94118585, 0x85859411, 132 | 0x8a4545cf, 0x45cf8a45, 0xcf8a4545, 0x4545cf8a, 133 | 0xe9f9f910, 0xf910e9f9, 0x10e9f9f9, 0xf9f910e9, 134 | 0x04020206, 0x02060402, 0x06040202, 0x02020604, 135 | 0xfe7f7f81, 0x7f81fe7f, 0x81fe7f7f, 0x7f7f81fe, 136 | 0xa05050f0, 0x50f0a050, 0xf0a05050, 0x5050f0a0, 137 | 0x783c3c44, 0x3c44783c, 0x44783c3c, 0x3c3c4478, 138 | 0x259f9fba, 0x9fba259f, 0xba259f9f, 0x9f9fba25, 139 | 0x4ba8a8e3, 0xa8e34ba8, 0xe34ba8a8, 0xa8a8e34b, 140 | 0xa25151f3, 0x51f3a251, 0xf3a25151, 0x5151f3a2, 141 | 0x5da3a3fe, 0xa3fe5da3, 0xfe5da3a3, 0xa3a3fe5d, 142 | 0x804040c0, 0x40c08040, 0xc0804040, 0x4040c080, 143 | 0x058f8f8a, 0x8f8a058f, 0x8a058f8f, 0x8f8f8a05, 144 | 0x3f9292ad, 0x92ad3f92, 0xad3f9292, 0x9292ad3f, 145 | 0x219d9dbc, 0x9dbc219d, 0xbc219d9d, 0x9d9dbc21, 146 | 0x70383848, 0x38487038, 0x48703838, 0x38384870, 147 | 0xf1f5f504, 0xf504f1f5, 0x04f1f5f5, 0xf5f504f1, 148 | 0x63bcbcdf, 0xbcdf63bc, 0xdf63bcbc, 0xbcbcdf63, 149 | 0x77b6b6c1, 0xb6c177b6, 0xc177b6b6, 0xb6b6c177, 150 | 0xafdada75, 0xda75afda, 0x75afdada, 0xdada75af, 151 | 0x42212163, 0x21634221, 0x63422121, 0x21216342, 152 | 0x20101030, 0x10302010, 0x30201010, 0x10103020, 153 | 0xe5ffff1a, 0xff1ae5ff, 0x1ae5ffff, 0xffff1ae5, 154 | 0xfdf3f30e, 0xf30efdf3, 0x0efdf3f3, 0xf3f30efd, 155 | 0xbfd2d26d, 0xd26dbfd2, 0x6dbfd2d2, 0xd2d26dbf, 156 | 0x81cdcd4c, 0xcd4c81cd, 0x4c81cdcd, 0xcdcd4c81, 157 | 0x180c0c14, 0x0c14180c, 0x14180c0c, 0x0c0c1418, 158 | 0x26131335, 0x13352613, 0x35261313, 0x13133526, 159 | 0xc3ecec2f, 0xec2fc3ec, 0x2fc3ecec, 0xecec2fc3, 160 | 0xbe5f5fe1, 0x5fe1be5f, 0xe1be5f5f, 0x5f5fe1be, 161 | 0x359797a2, 0x97a23597, 0xa2359797, 0x9797a235, 162 | 0x884444cc, 0x44cc8844, 0xcc884444, 0x4444cc88, 163 | 0x2e171739, 0x17392e17, 0x392e1717, 0x1717392e, 164 | 0x93c4c457, 0xc45793c4, 0x5793c4c4, 0xc4c45793, 165 | 0x55a7a7f2, 0xa7f255a7, 0xf255a7a7, 0xa7a7f255, 166 | 0xfc7e7e82, 0x7e82fc7e, 0x82fc7e7e, 0x7e7e82fc, 167 | 0x7a3d3d47, 0x3d477a3d, 0x477a3d3d, 0x3d3d477a, 168 | 0xc86464ac, 0x64acc864, 0xacc86464, 0x6464acc8, 169 | 0xba5d5de7, 0x5de7ba5d, 0xe7ba5d5d, 0x5d5de7ba, 170 | 0x3219192b, 0x192b3219, 0x2b321919, 0x19192b32, 171 | 0xe6737395, 0x7395e673, 0x95e67373, 0x737395e6, 172 | 0xc06060a0, 0x60a0c060, 0xa0c06060, 0x6060a0c0, 173 | 0x19818198, 0x81981981, 0x98198181, 0x81819819, 174 | 0x9e4f4fd1, 0x4fd19e4f, 0xd19e4f4f, 0x4f4fd19e, 175 | 0xa3dcdc7f, 0xdc7fa3dc, 0x7fa3dcdc, 0xdcdc7fa3, 176 | 0x44222266, 0x22664422, 0x66442222, 0x22226644, 177 | 0x542a2a7e, 0x2a7e542a, 0x7e542a2a, 0x2a2a7e54, 178 | 0x3b9090ab, 0x90ab3b90, 0xab3b9090, 0x9090ab3b, 179 | 0x0b888883, 0x88830b88, 0x830b8888, 0x8888830b, 180 | 0x8c4646ca, 0x46ca8c46, 0xca8c4646, 0x4646ca8c, 181 | 0xc7eeee29, 0xee29c7ee, 0x29c7eeee, 0xeeee29c7, 182 | 0x6bb8b8d3, 0xb8d36bb8, 0xd36bb8b8, 0xb8b8d36b, 183 | 0x2814143c, 0x143c2814, 0x3c281414, 0x14143c28, 184 | 0xa7dede79, 0xde79a7de, 0x79a7dede, 0xdede79a7, 185 | 0xbc5e5ee2, 0x5ee2bc5e, 0xe2bc5e5e, 0x5e5ee2bc, 186 | 0x160b0b1d, 0x0b1d160b, 0x1d160b0b, 0x0b0b1d16, 187 | 0xaddbdb76, 0xdb76addb, 0x76addbdb, 0xdbdb76ad, 188 | 0xdbe0e03b, 0xe03bdbe0, 0x3bdbe0e0, 0xe0e03bdb, 189 | 0x64323256, 0x32566432, 0x56643232, 0x32325664, 190 | 0x743a3a4e, 0x3a4e743a, 0x4e743a3a, 0x3a3a4e74, 191 | 0x140a0a1e, 0x0a1e140a, 0x1e140a0a, 0x0a0a1e14, 192 | 0x924949db, 0x49db9249, 0xdb924949, 0x4949db92, 193 | 0x0c06060a, 0x060a0c06, 0x0a0c0606, 0x06060a0c, 194 | 0x4824246c, 0x246c4824, 0x6c482424, 0x24246c48, 195 | 0xb85c5ce4, 0x5ce4b85c, 0xe4b85c5c, 0x5c5ce4b8, 196 | 0x9fc2c25d, 0xc25d9fc2, 0x5d9fc2c2, 0xc2c25d9f, 197 | 0xbdd3d36e, 0xd36ebdd3, 0x6ebdd3d3, 0xd3d36ebd, 198 | 0x43acacef, 0xacef43ac, 0xef43acac, 0xacacef43, 199 | 0xc46262a6, 0x62a6c462, 0xa6c46262, 0x6262a6c4, 200 | 0x399191a8, 0x91a83991, 0xa8399191, 0x9191a839, 201 | 0x319595a4, 0x95a43195, 0xa4319595, 0x9595a431, 202 | 0xd3e4e437, 0xe437d3e4, 0x37d3e4e4, 0xe4e437d3, 203 | 0xf279798b, 0x798bf279, 0x8bf27979, 0x79798bf2, 204 | 0xd5e7e732, 0xe732d5e7, 0x32d5e7e7, 0xe7e732d5, 205 | 0x8bc8c843, 0xc8438bc8, 0x438bc8c8, 0xc8c8438b, 206 | 0x6e373759, 0x37596e37, 0x596e3737, 0x3737596e, 207 | 0xda6d6db7, 0x6db7da6d, 0xb7da6d6d, 0x6d6db7da, 208 | 0x018d8d8c, 0x8d8c018d, 0x8c018d8d, 0x8d8d8c01, 209 | 0xb1d5d564, 0xd564b1d5, 0x64b1d5d5, 0xd5d564b1, 210 | 0x9c4e4ed2, 0x4ed29c4e, 0xd29c4e4e, 0x4e4ed29c, 211 | 0x49a9a9e0, 0xa9e049a9, 0xe049a9a9, 0xa9a9e049, 212 | 0xd86c6cb4, 0x6cb4d86c, 0xb4d86c6c, 0x6c6cb4d8, 213 | 0xac5656fa, 0x56faac56, 0xfaac5656, 0x5656faac, 214 | 0xf3f4f407, 0xf407f3f4, 0x07f3f4f4, 0xf4f407f3, 215 | 0xcfeaea25, 0xea25cfea, 0x25cfeaea, 0xeaea25cf, 216 | 0xca6565af, 0x65afca65, 0xafca6565, 0x6565afca, 217 | 0xf47a7a8e, 0x7a8ef47a, 0x8ef47a7a, 0x7a7a8ef4, 218 | 0x47aeaee9, 0xaee947ae, 0xe947aeae, 0xaeaee947, 219 | 0x10080818, 0x08181008, 0x18100808, 0x08081810, 220 | 0x6fbabad5, 0xbad56fba, 0xd56fbaba, 0xbabad56f, 221 | 0xf0787888, 0x7888f078, 0x88f07878, 0x787888f0, 222 | 0x4a25256f, 0x256f4a25, 0x6f4a2525, 0x25256f4a, 223 | 0x5c2e2e72, 0x2e725c2e, 0x725c2e2e, 0x2e2e725c, 224 | 0x381c1c24, 0x1c24381c, 0x24381c1c, 0x1c1c2438, 225 | 0x57a6a6f1, 0xa6f157a6, 0xf157a6a6, 0xa6a6f157, 226 | 0x73b4b4c7, 0xb4c773b4, 0xc773b4b4, 0xb4b4c773, 227 | 0x97c6c651, 0xc65197c6, 0x5197c6c6, 0xc6c65197, 228 | 0xcbe8e823, 0xe823cbe8, 0x23cbe8e8, 0xe8e823cb, 229 | 0xa1dddd7c, 0xdd7ca1dd, 0x7ca1dddd, 0xdddd7ca1, 230 | 0xe874749c, 0x749ce874, 0x9ce87474, 0x74749ce8, 231 | 0x3e1f1f21, 0x1f213e1f, 0x213e1f1f, 0x1f1f213e, 232 | 0x964b4bdd, 0x4bdd964b, 0xdd964b4b, 0x4b4bdd96, 233 | 0x61bdbddc, 0xbddc61bd, 0xdc61bdbd, 0xbdbddc61, 234 | 0x0d8b8b86, 0x8b860d8b, 0x860d8b8b, 0x8b8b860d, 235 | 0x0f8a8a85, 0x8a850f8a, 0x850f8a8a, 0x8a8a850f, 236 | 0xe0707090, 0x7090e070, 0x90e07070, 0x707090e0, 237 | 0x7c3e3e42, 0x3e427c3e, 0x427c3e3e, 0x3e3e427c, 238 | 0x71b5b5c4, 0xb5c471b5, 0xc471b5b5, 0xb5b5c471, 239 | 0xcc6666aa, 0x66aacc66, 0xaacc6666, 0x6666aacc, 240 | 0x904848d8, 0x48d89048, 0xd8904848, 0x4848d890, 241 | 0x06030305, 0x03050603, 0x05060303, 0x03030506, 242 | 0xf7f6f601, 0xf601f7f6, 0x01f7f6f6, 0xf6f601f7, 243 | 0x1c0e0e12, 0x0e121c0e, 0x121c0e0e, 0x0e0e121c, 244 | 0xc26161a3, 0x61a3c261, 0xa3c26161, 0x6161a3c2, 245 | 0x6a35355f, 0x355f6a35, 0x5f6a3535, 0x35355f6a, 246 | 0xae5757f9, 0x57f9ae57, 0xf9ae5757, 0x5757f9ae, 247 | 0x69b9b9d0, 0xb9d069b9, 0xd069b9b9, 0xb9b9d069, 248 | 0x17868691, 0x86911786, 0x91178686, 0x86869117, 249 | 0x99c1c158, 0xc15899c1, 0x5899c1c1, 0xc1c15899, 250 | 0x3a1d1d27, 0x1d273a1d, 0x273a1d1d, 0x1d1d273a, 251 | 0x279e9eb9, 0x9eb9279e, 0xb9279e9e, 0x9e9eb927, 252 | 0xd9e1e138, 0xe138d9e1, 0x38d9e1e1, 0xe1e138d9, 253 | 0xebf8f813, 0xf813ebf8, 0x13ebf8f8, 0xf8f813eb, 254 | 0x2b9898b3, 0x98b32b98, 0xb32b9898, 0x9898b32b, 255 | 0x22111133, 0x11332211, 0x33221111, 0x11113322, 256 | 0xd26969bb, 0x69bbd269, 0xbbd26969, 0x6969bbd2, 257 | 0xa9d9d970, 0xd970a9d9, 0x70a9d9d9, 0xd9d970a9, 258 | 0x078e8e89, 0x8e89078e, 0x89078e8e, 0x8e8e8907, 259 | 0x339494a7, 0x94a73394, 0xa7339494, 0x9494a733, 260 | 0x2d9b9bb6, 0x9bb62d9b, 0xb62d9b9b, 0x9b9bb62d, 261 | 0x3c1e1e22, 0x1e223c1e, 0x223c1e1e, 0x1e1e223c, 262 | 0x15878792, 0x87921587, 0x92158787, 0x87879215, 263 | 0xc9e9e920, 0xe920c9e9, 0x20c9e9e9, 0xe9e920c9, 264 | 0x87cece49, 0xce4987ce, 0x4987cece, 0xcece4987, 265 | 0xaa5555ff, 0x55ffaa55, 0xffaa5555, 0x5555ffaa, 266 | 0x50282878, 0x28785028, 0x78502828, 0x28287850, 267 | 0xa5dfdf7a, 0xdf7aa5df, 0x7aa5dfdf, 0xdfdf7aa5, 268 | 0x038c8c8f, 0x8c8f038c, 0x8f038c8c, 0x8c8c8f03, 269 | 0x59a1a1f8, 0xa1f859a1, 0xf859a1a1, 0xa1a1f859, 270 | 0x09898980, 0x89800989, 0x80098989, 0x89898009, 271 | 0x1a0d0d17, 0x0d171a0d, 0x171a0d0d, 0x0d0d171a, 272 | 0x65bfbfda, 0xbfda65bf, 0xda65bfbf, 0xbfbfda65, 273 | 0xd7e6e631, 0xe631d7e6, 0x31d7e6e6, 0xe6e631d7, 274 | 0x844242c6, 0x42c68442, 0xc6844242, 0x4242c684, 275 | 0xd06868b8, 0x68b8d068, 0xb8d06868, 0x6868b8d0, 276 | 0x824141c3, 0x41c38241, 0xc3824141, 0x4141c382, 277 | 0x299999b0, 0x99b02999, 0xb0299999, 0x9999b029, 278 | 0x5a2d2d77, 0x2d775a2d, 0x775a2d2d, 0x2d2d775a, 279 | 0x1e0f0f11, 0x0f111e0f, 0x111e0f0f, 0x0f0f111e, 280 | 0x7bb0b0cb, 0xb0cb7bb0, 0xcb7bb0b0, 0xb0b0cb7b, 281 | 0xa85454fc, 0x54fca854, 0xfca85454, 0x5454fca8, 282 | 0x6dbbbbd6, 0xbbd66dbb, 0xd66dbbbb, 0xbbbbd66d, 283 | 0x2c16163a, 0x163a2c16, 0x3a2c1616, 0x16163a2c, 284 | }; 285 | --------------------------------------------------------------------------------