Coder Social home page Coder Social logo

rapier1 / chacha20-threaded-interface-broken Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 3 MB

An attempt to provide some level of parallelization to the chacha20 cipher. instead of threading the cipher itself (which is the next step) submit data chunks in parallel to the cipher.

License: Other

Makefile 1.35% KRL 0.08% C 63.35% Roff 25.56% Shell 6.28% C++ 0.10% M4 2.40% Awk 0.13% DIGITAL Command Language 0.04% Standard ML 0.42% HTML 0.30%

chacha20-threaded-interface-broken's People

Contributors

jonboone avatar rapier1 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

chacha20-threaded-interface-broken's Issues

commit 5029c12d7e96cc501721fe4324b03db21bdf3173 builds and *thinks it works* on Apple Silicon M1 but decrypts incorrectly

After installing openssl 1.1.1i via homebrew, I was able to build the sources like this:

❯ export LDFLAGS="-L/Users/jb/opt/homebrew/opt/[email protected]/lib"
❯ export CPPFLAGS="-I/Users/jb/opt/homebrew/opt/[email protected]/include"
❯ ./configure
...
OpenSSH has been configured with the following options:
                     User binaries: /usr/local/bin
                   System binaries: /usr/local/sbin
               Configuration files: /usr/local/etc
                   Askpass program: /usr/local/libexec/ssh-askpass
                      Manual pages: /usr/local/share/man/manX
                          PID file: /var/run
  Privilege separation chroot path: /var/empty
            sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
                    Manpage format: doc
                       PAM support: no
                   OSF SIA support: no
                 KerberosV support: no
                   SELinux support: no
              MD5 password support: no
                   libedit support: no
                   libldns support: no
  Solaris process contract support: no
           Solaris project support: no
         Solaris privilege support: no
       IP address in $DISPLAY hack: no
           Translate v4 in v6 hack: no
                  BSD Auth support: no
              Random number source: OpenSSL internal ONLY
             Privsep sandbox style: darwin
                   PKCS#11 support: yes
                  U2F/FIDO support: yes

              Host: arm-apple-darwin20.1.0
          Compiler: cc
    Compiler flags: -g -O2 -pipe -Wunknown-warning-option -Qunused-arguments -Wall -Wextra -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-parameter -Wno-unused-result -fno-strict-aliasing -mretpoline -D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -fstack-protector-strong -fPIE
Preprocessor flags: -I/Users/jb/opt/homebrew/opt/[email protected]/include
      Linker flags: -L/Users/jb/opt/homebrew/opt/[email protected]/lib -fstack-protector-strong -pie
         Libraries: -lcrypto -lz  -lresolv
         +for sshd:  -lsandbox`
❯  make
...
❯ uname -a
Darwin jbs-MBP-M1.hsd1.pa.comcast.net 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:10 PDT 2020; root:xnu-7195.50.7~2/RELEASE_ARM64_T8101 arm64
❯ pwd
/Users/jb/src/github.com/rapier1/chacha20-threaded-interface
❯ ./scp -S ./ssh ssh.c localhost:.
1: len = 24, aadlen = 4 seqnr= 3
Exiting chunk loop
Exiting function loop
1: len = 152, aadlen = 4 seqnr= 3
Exiting chunk loop
Exiting function loop
1: len = 24, aadlen = 4 seqnr= 4
Exiting chunk loop
Exiting function loop
1: len = 40, aadlen = 4 seqnr= 4
Exiting chunk loop
Exiting function loop
1: len = 56, aadlen = 4 seqnr= 5
Exiting chunk loop
Exiting function loop
1: len = 600, aadlen = 4 seqnr= 5
Exiting chunk loop
Exiting function loop
1: len = 568, aadlen = 4 seqnr= 6
Exiting chunk loop
Exiting function loop
1: len = 1136, aadlen = 4 seqnr= 6
Exiting chunk loop
Exiting function loop
1: len = 8, aadlen = 4 seqnr= 7
Exiting chunk loop
Exiting function loop
1: len = 32, aadlen = 4 seqnr= 7
Exiting chunk loop
Exiting function loop
1: len = 40, aadlen = 4 seqnr= 8
Exiting chunk loop
Exiting function loop
1: len = 608, aadlen = 4 seqnr= 8
Exiting chunk loop
Exiting function loop
1: len = 128, aadlen = 4 seqnr= 9
Exiting chunk loop
Exiting function loop
1: len = 128, aadlen = 4 seqnr= 10
Exiting chunk loop
Exiting function loop
1: len = 24, aadlen = 4 seqnr= 11
Exiting chunk loop
Exiting function loop
1: len = 32, aadlen = 4 seqnr= 9
Exiting chunk loop
Exiting function loop
1: len = 16, aadlen = 4 seqnr= 12
Exiting chunk loop
Exiting function loop
1: len = 16, aadlen = 4 seqnr= 13
Exiting chunk loop
Exiting function loop
1: len = 16, aadlen = 4 seqnr= 14
Exiting chunk loop
Exiting function loop
1: len = 32, aadlen = 4 seqnr= 10
Exiting chunk loop
Exiting function loop
1: len = 16, aadlen = 4 seqnr= 15
Exiting chunk loop
Exiting function loop
ssh.c                                                           0%    0     0.0KB/s   0.0KB/s   --:-- ET1: len = 32784, aadlen = 4 seqnr= 11
1: len is > chunk
2: bufptr < len
aad: 4 Len: 32784, Buffptr: 0, Chunk: 8196 Diff: 32784
3: len-buftr > chunk
bufptr is 0 of 32784 diff 32784
5: leaving chunking
2: bufptr < len
aad: 4 Len: 32784, Buffptr: 8196, Chunk: 8196 Diff: 24588
3: len-buftr > chunk
bufptr is 8196 of 32784 diff 24588
5: leaving chunking
2: bufptr < len
aad: 4 Len: 32784, Buffptr: 16392, Chunk: 8196 Diff: 16392
3: len-buftr > chunk
bufptr is 16392 of 32784 diff 16392
5: leaving chunking
2: bufptr < len
aad: 4 Len: 32784, Buffptr: 24588, Chunk: 8196 Diff: 8196
3: len-buftr > chunk
bufptr is 24588 of 32784 diff 8196
bfptr and len match
5: leaving chunking
6: building structs
6: building structs
6: building structs
6: building structs
0 of 4 6165491712 MADE
Made thread!
Leaving 6165491712
0 of 4 6165491712 JOIN
Exiting join loop
total: 4 joined 1
1 of 4 6165491712 MADE
Made thread!
Leaving 6165491712
1 of 4 6165491712 JOIN
Exiting join loop
total: 4 joined 2
2 of 4 6165491712 MADE
Made thread!
Leaving 6165491712
2 of 4 6165491712 JOIN
Exiting join loop
total: 4 joined 3
3 of 4 6165491712 MADE
Made thread!
Leaving 6165491712
3 of 4 6165491712 JOIN
Exiting join loop
total: 4 joined 4
Exiting chunk loop
Exiting function loop
1: len = 32784, aadlen = 4 seqnr= 12
1: len is > chunk
2: bufptr < len
aad: 4 Len: 32784, Buffptr: 0, Chunk: 8196 Diff: 32784
3: len-buftr > chunk
bufptr is 0 of 32784 diff 32784
5: leaving chunking
2: bufptr < len
aad: 4 Len: 32784, Buffptr: 8196, Chunk: 8196 Diff: 24588
3: len-buftr > chunk
bufptr is 8196 of 32784 diff 24588
5: leaving chunking
2: bufptr < len
aad: 4 Len: 32784, Buffptr: 16392, Chunk: 8196 Diff: 16392
3: len-buftr > chunk
bufptr is 16392 of 32784 diff 16392
5: leaving chunking
2: bufptr < len
aad: 4 Len: 32784, Buffptr: 24588, Chunk: 8196 Diff: 8196
3: len-buftr > chunk
bufptr is 24588 of 32784 diff 8196
bfptr and len match
5: leaving chunking
6: building structs
6: building structs
6: building structs
6: building structs
0 of 4 6165491712 MADE
Made thread!
Leaving 6165491712
0 of 4 6165491712 JOIN
Exiting join loop
total: 8 joined 5
1 of 4 6165491712 MADE
Made thread!
Leaving 6165491712
1 of 4 6165491712 JOIN
Exiting join loop
total: 8 joined 6
2 of 4 6165491712 MADE
Made thread!
Leaving 6165491712
2 of 4 6165491712 JOIN
Exiting join loop
total: 8 joined 7
3 of 4 6165491712 MADE
Made thread!
Leaving 6165491712
3 of 4 6165491712 JOIN
Exiting join loop
total: 8 joined 8
Exiting chunk loop
Exiting function loop
1: len = 7544, aadlen = 4 seqnr= 13
Exiting chunk loop
Exiting function loop
1: len = 16, aadlen = 4 seqnr= 16
Exiting chunk loop
Exiting function loop
ssh.c                                                         100%   71KB  30.1MB/s  71.4KB/s   00:00
1: len = 16, aadlen = 4 seqnr= 14
Exiting chunk loop
Exiting function loop
1: len = 16, aadlen = 4 seqnr= 17
Exiting chunk loop
Exiting function loop
1: len = 32, aadlen = 4 seqnr= 18
Exiting chunk loop
Exiting function loop
1: len = 16, aadlen = 4 seqnr= 19
Exiting chunk loop
Exiting function loop
1: len = 16, aadlen = 4 seqnr= 15
Exiting chunk loop
Exiting function loop
1: len = 40, aadlen = 4 seqnr= 16
Exiting chunk loop
Exiting function loop
❯  diff ./ssh.c ~/ssh.c
279c279
< 	    "d", homedir,
---
> 	    "d", hir,
557,558c557
<  notfound:
< 	if (!options.canonicalize_fallback_local)
---
>  notfoundf (!options.canonicalize_fallback_local)
859,860c858
< 			free(p);
< 			break;
---
> 			free(			break;
1427c1425
< 		free(options.identity_agent);
---
> 		free(options.iity_agent);
1683c1681
< 	for (i = 0; i < options.num_certificate_files; i++) {
---
> 	for (i = 0; options.num_certificate_files; i++) {
1945c1943
< 		if ((options.remote_forwards[i].handle =
---
> 		if ((options.remote_forwards[i].han=

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.