Giter Club home page Giter Club logo

Comments (9)

gperciva avatar gperciva commented on August 20, 2024 1

Hi @Smattr, we're moving in this direction, such as commits like 70ada72 (which might simplify your downstream patch as well). Still a few details to work out, though.

from scrypt.

cperciva avatar cperciva commented on August 20, 2024 1

Two reasons:

  1. Password hashing is exactly the same thing as key derivation, so the name isn't really wrong. ;-)

  2. There's a whole bunch of libscrypt libraries and scrypt() functions out there, so we figured it would be helpful to avoid using the same name.

from scrypt.

cperciva avatar cperciva commented on August 20, 2024

Yeah, maybe. I was avoiding this because (a) there isn't really any cross-platform way to do "libraries", and (b) the scrypt code is small enough that I figured people could just import it into their codebase.

from scrypt.

gperciva avatar gperciva commented on August 20, 2024

Doesn't autotools take care of (a)?

from scrypt.

cperciva avatar cperciva commented on August 20, 2024

Theoretically, yes. I've heard complaints about it not working very well but I don't know if those were due to autotools being inherently broken or merely difficult to use.

from scrypt.

gperciva avatar gperciva commented on August 20, 2024

From offline communication: libscrypt should not include scryptenc_*; it should only include crypto_scrypt().

from scrypt.

Smattr avatar Smattr commented on August 20, 2024

This would be great! I had assumed the omission of a librarised scrypt was deliberate and patched the build system to add this (inline below for posterity), but if I could stop doing this and lean on an official upstream libscrypt I (and presumably others) certainly would.

Scrypt's build system does not expose a reusable version of crypto_scrypt(). To
work around this, the following patch adds a library that achieves this.

diff --git Makefile.am Makefile.am
index f037aa6..616c01d 100644
--- Makefile.am
+++ Makefile.am
@@ -69,6 +69,22 @@ noinst_LIBRARIES+=	libscrypt_sse2.a
 libscrypt_sse2_a_SOURCES=	lib/crypto/crypto_scrypt_smix_sse2.c
 libscrypt_sse2_a_CFLAGS=`. ./cpusupport-config.h; echo $${CFLAGS_X86_SSE2}`
 
+noinst_LIBRARIES+= libcrypto_scrypt.a
+libcrypto_scrypt_a_SOURCES= \
+			libcperciva/alg/sha256.c			\
+			libcperciva/alg/sha256.h			\
+			libcperciva/cpusupport/cpusupport_x86_sse2.c	\
+			libcperciva/util/insecure_memzero.c		\
+			libcperciva/util/insecure_memzero.h		\
+			libcperciva/util/warnp.c			\
+			libcperciva/util/warnp.h			\
+			lib/crypto/crypto_scrypt.c			\
+			lib/crypto/crypto_scrypt.h			\
+			lib/crypto/crypto_scrypt_smix.c			\
+			lib/crypto/crypto_scrypt_smix.h			\
+			lib/crypto/crypto_scrypt_smix_sse2.c			\
+			lib/crypto/crypto_scrypt_smix_sse2.h
+
 EXTRA_DIST = \
 	COPYRIGHT						\
 	FORMAT							\

from scrypt.

gperciva avatar gperciva commented on August 20, 2024

libscrypt-kdf is now in scrypt master.

from scrypt.

Smattr avatar Smattr commented on August 20, 2024

Nice work. Naive question but why is it suffixed with "kdf"? Surely I can use (misuse?) scrypt for purposes other than as a key derivation function?

from scrypt.

Related Issues (20)

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.