bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [V3 PATCH] Implement SM3 hash algorithm in gnulib


From: Bruno Haible
Subject: Re: [V3 PATCH] Implement SM3 hash algorithm in gnulib
Date: Sat, 28 Oct 2017 22:25:12 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-97-generic; KDE/5.18.0; x86_64; ; )

Hi Jia,

> Here is the V3 changelog:
> 
> - Correct @LIB_CRYPTO@ build issue in m4/sm3.m4.

Thanks for the update. The module 'crypto/sm3' passes the test, so I pushed
that part of the patch in your name.

The module 'crypto/gc-sm3' does not pass the test:

$ ./gnulib-tool --create-testdir --dir=testdir1 --single-configure crypto/gc-sm3
$ cd testdir1
$ ./configure CPPFLAGS=-Wall
$ make
...
make[4]: Entering directory 
'/media/develdata/devel/GNULIB/gnulib-git/testdir1/gltests'
gcc -DHAVE_CONFIG_H -I. -I..  -DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 
-I. -I. -I.. -I./.. -I../gllib -I./../gllib -Wall  -g -O2 -MT test-gc-sm3.o -MD 
-MP -MF .deps/test-gc-sm3.Tpo -c -o test-gc-sm3.o test-gc-sm3.c
test-gc-sm3.c:22:20: fatal error: gcrypt.h: No such file or directory
compilation terminated.
Makefile:1009: recipe for target 'test-gc-sm3.o' failed

The problem is most likely in the 'Files' or 'Dependencies' section of one
of the two modules. You find the reference doc for the modules descriptions
here:
https://www.gnu.org/software/gnulib/manual/html_node/Module-description.html


Also, I added a comment with the useful info that you gave in the commit 
message:

2017-10-28  Bruno Haible  <address@hidden>

        crypto/sm3: Add overview documentation to the .h file.
        * lib/sm3.h: Add comments.

Rationale: Future maintainers should be able to understand and maintain this
code without looking at the commit history or ChangeLog.


> - Merge patch 4 and 5 together.

There's a misunderstanding here: I did not mean to declare all functions 
'const',
but only the 3 you mentioned: gc_init, gc_done, gc_hash_digest_length.

And looking at the definition of the 'const' semantics [1], I was wrong on 2 of
these: If gc-gnulib.c is in use,
  * 'gc_init' cannot be declared 'const' because
       gc_init(); gc_done(); gc_init();
    is not equivalent to
       gc_init(); gc_done();
  * 'gc_done' cannot be declared 'const' because
       gc_init(); gc_done(); gc_init(); gc_done();
    is not equivalent to
       gc_init(); gc_done(); gc_init();
Only 'gc_hash_digest_length' may be declared 'const'.

Bruno

[1] https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Common-Function-Attributes.html





reply via email to

[Prev in Thread] Current Thread [Next in Thread]