liboqs/.travis/global-namespace-check.sh
Vlad Gheorghiu 65a8db3ea8 Issue 187 and 207 (#214)
* Add minimal kex and sig example file showing the api usage

* Fix regular expression

* update

* Update global namespace regex

* Further updates to gloabalnamespace script

* added minimal_sig/kex_oqs as test cases

* commit

* commit

* commit

updated tabs to spaces

* commit

make prettyprint

* commit

replaced macros with functions

* commit

changed print_hex_string to disp_hex_string to comply to the coding
standards

* updated regex

* Remove spurious regex updates

* commit

* Added back _ntt_double and _rec in regex

Otherwise gcc fails on travis

* commit
2018-01-24 20:56:48 -05:00

18 lines
713 B
Bash
Executable File

#!/bin/bash
REGEX=' T [_]?(OQS|ntru|picnic|Keccak|.*SIKEp503|.*SIDHp503|.*SIKEp751|.*SIDHp751|.*shake128|.*shake256|rand_bytes|cpu_supports|uint64_from_char_array|uint64_to_char_array|print_hex|ntt_double|rec|aligned_alloc|aligned_free)'
if [[ $(nm -g liboqs.a | grep ' T ' | grep -E -v -i "$REGEX") ]];
then
tput setaf 1;
echo "Code contains the following non-namespaced global symbols; see https://github.com/open-quantum-safe/liboqs/wiki/Coding-conventions for function naming conventions.";
tput sgr 0
nm -g liboqs.a | grep ' T ' | grep -E -v -i "$REGEX"
exit 1;
else
tput setaf 2;
echo "Code adheres to the project standards (global namespace).";
tput sgr 0
exit 0;
fi;