]> git.codecow.com Git - Monocypher.git/commitdiff
Separated basic/advanced functions in different folders
authorLoup Vaillant <loup@loup-vaillant.fr>
Tue, 28 Jul 2020 00:08:28 +0000 (02:08 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Tue, 28 Jul 2020 00:12:17 +0000 (02:12 +0200)
Addresses MON-01-005
Fixes #182

50 files changed:
.gitignore
doc/man/man3/advanced/crypto_chacha20.3monocypher [moved from doc/man/man3/crypto_chacha20.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_chacha20_H.3monocypher [moved from doc/man/man3/crypto_chacha20_H.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_chacha20_ctr.3monocypher [moved from doc/man/man3/crypto_chacha20_ctr.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_check_final.3monocypher [moved from doc/man/man3/crypto_check_final.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_check_init.3monocypher [moved from doc/man/man3/crypto_check_init.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_check_init_custom_hash.3monocypher [moved from doc/man/man3/crypto_check_init_custom_hash.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_check_update.3monocypher [moved from doc/man/man3/crypto_check_update.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_curve_to_hidden.3monocypher [moved from doc/man/man3/crypto_curve_to_hidden.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_from_eddsa_private.3monocypher [moved from doc/man/man3/crypto_from_eddsa_private.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_from_eddsa_public.3monocypher [moved from doc/man/man3/crypto_from_eddsa_public.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_hchacha20.3monocypher [moved from doc/man/man3/crypto_hchacha20.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_hidden_key_pair.3monocypher [moved from doc/man/man3/crypto_hidden_key_pair.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_hidden_to_curve.3monocypher [moved from doc/man/man3/crypto_hidden_to_curve.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_ietf_chacha20.3monocypher [moved from doc/man/man3/crypto_ietf_chacha20.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_ietf_chacha20_ctr.3monocypher [moved from doc/man/man3/crypto_ietf_chacha20_ctr.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_poly1305.3monocypher [moved from doc/man/man3/crypto_poly1305.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_poly1305_final.3monocypher [moved from doc/man/man3/crypto_poly1305_final.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_poly1305_init.3monocypher [moved from doc/man/man3/crypto_poly1305_init.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_poly1305_update.3monocypher [moved from doc/man/man3/crypto_poly1305_update.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_sign_final.3monocypher [moved from doc/man/man3/crypto_sign_final.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_sign_init_first_pass.3monocypher [moved from doc/man/man3/crypto_sign_init_first_pass.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_sign_init_first_pass_custom_hash.3monocypher [moved from doc/man/man3/crypto_sign_init_first_pass_custom_hash.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_sign_init_second_pass.3monocypher [moved from doc/man/man3/crypto_sign_init_second_pass.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_sign_public_key_custom_hash.3monocypher [moved from doc/man/man3/crypto_sign_public_key_custom_hash.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_sign_update.3monocypher [moved from doc/man/man3/crypto_sign_update.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_x25519.3monocypher [moved from doc/man/man3/crypto_x25519.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_x25519_dirty_fast.3monocypher [moved from doc/man/man3/crypto_x25519_dirty_fast.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_x25519_dirty_small.3monocypher [moved from doc/man/man3/crypto_x25519_dirty_small.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_x25519_inverse.3monocypher [moved from doc/man/man3/crypto_x25519_inverse.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_x25519_public_key.3monocypher [moved from doc/man/man3/crypto_x25519_public_key.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_xchacha20.3monocypher [moved from doc/man/man3/crypto_xchacha20.3monocypher with 100% similarity]
doc/man/man3/advanced/crypto_xchacha20_ctr.3monocypher [moved from doc/man/man3/crypto_xchacha20_ctr.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_chacha20_encrypt.3monocypher [moved from doc/man/man3/crypto_chacha20_encrypt.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_chacha20_init.3monocypher [moved from doc/man/man3/crypto_chacha20_init.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_chacha20_set_ctr.3monocypher [moved from doc/man/man3/crypto_chacha20_set_ctr.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_chacha20_stream.3monocypher [moved from doc/man/man3/crypto_chacha20_stream.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_chacha20_x_init.3monocypher [moved from doc/man/man3/crypto_chacha20_x_init.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_lock_auth_ad.3monocypher [moved from doc/man/man3/crypto_lock_auth_ad.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_lock_auth_message.3monocypher [moved from doc/man/man3/crypto_lock_auth_message.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_lock_final.3monocypher [moved from doc/man/man3/crypto_lock_final.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_lock_init.3monocypher [moved from doc/man/man3/crypto_lock_init.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_lock_update.3monocypher [moved from doc/man/man3/crypto_lock_update.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_unlock_auth_ad.3monocypher [moved from doc/man/man3/crypto_unlock_auth_ad.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_unlock_auth_message.3monocypher [moved from doc/man/man3/crypto_unlock_auth_message.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_unlock_final.3monocypher [moved from doc/man/man3/crypto_unlock_final.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_unlock_init.3monocypher [moved from doc/man/man3/crypto_unlock_init.3monocypher with 100% similarity]
doc/man/man3/deprecated/crypto_unlock_update.3monocypher [moved from doc/man/man3/crypto_unlock_update.3monocypher with 100% similarity]
doc/man2html.sh
doc/style.css [moved from doc/html/style.css with 100% similarity]

index 7bdc427d9bccc291d550a77418108ba0b39e2ded..00f8746bfa43ac924e48a5cdbbd75fa9552184ad 100644 (file)
@@ -23,5 +23,5 @@ tests/formal-analysis
 **/__pycache__/**
 *.tar.gz
 monocypher-*/
-doc/html/*.html
+doc/html/
 tests/vectors.h
index 7c03cddf3b36c1fdfadf16c851324ed577ff73e9..cf0aa2139709943603796923bb631237672be887 100755 (executable)
 
 DIR=$(dirname "$0")
 
-# clean before build
-rm -rf "$DIR/html/*.html"
+# clean before
+rm -rf "$DIR/html"
 
 convert() {
     MANS=$1
+    HTML=$2
     for name in $(ls -1 "$MANS/" | sed 's/.3monocypher//')
     do
         test -f "$MANS/$name.3monocypher" || continue
         mandoc                            \
         -Oman=%N.html,style=style.css \
         -Thtml "$MANS/$name.3monocypher" \
-        > "$DIR/html/$name.html"
+        > "$DIR/html/$HTML/$name.html"
     done
+    cp style.css "$DIR/html/$HTML/"
 }
 
-convert "$DIR/man/man3"
-convert "$DIR/man/man3/optional"
+mkdir -p "$DIR/html"
+mkdir -p "$DIR/html/advanced"
+mkdir -p "$DIR/html/optional"
+mkdir -p "$DIR/html/deprecated"
+convert "$DIR/man/man3"            "."
+convert "$DIR/man/man3/advanced"   "advanced"
+convert "$DIR/man/man3/optional"   "optional"
+convert "$DIR/man/man3/deprecated" "deprecated"
 
+substitute() {
+    HTML=$1
+    for file in $(ls -1 "$HTML/" | grep ".html$")
+    do
+        sed \
+            -e 's|href="intro.html"|                         href="../intro.html"|                         '\
+            -e 's|href="crypto_argon2i_general.html"|        href="../crypto_argon2i_general.html"|        '\
+            -e 's|href="crypto_argon2i.html"|                href="../crypto_argon2i.html"|                '\
+            -e 's|href="crypto_blake2b_final.html"|          href="../crypto_blake2b_final.html"|          '\
+            -e 's|href="crypto_blake2b_general.html"|        href="../crypto_blake2b_general.html"|        '\
+            -e 's|href="crypto_blake2b_general_init.html"|   href="../crypto_blake2b_general_init.html"|   '\
+            -e 's|href="crypto_blake2b.html"|                href="../crypto_blake2b.html"|                '\
+            -e 's|href="crypto_blake2b_init.html"|           href="../crypto_blake2b_init.html"|           '\
+            -e 's|href="crypto_blake2b_update.html"|         href="../crypto_blake2b_update.html"|         '\
+            -e 's|href="crypto_check.html"|                  href="../crypto_check.html"|                  '\
+            -e 's|href="crypto_key_exchange.html"|           href="../crypto_key_exchange.html"|           '\
+            -e 's|href="crypto_key_exchange_public_key.html"|href="../crypto_key_exchange_public_key.html"|'\
+            -e 's|href="crypto_lock_aead.html"|              href="../crypto_lock_aead.html"|              '\
+            -e 's|href="crypto_lock.html"|                   href="../crypto_lock.html"|                   '\
+            -e 's|href="crypto_sign.html"|                   href="../crypto_sign.html"|                   '\
+            -e 's|href="crypto_sign_public_key.html"|        href="../crypto_sign_public_key.html"|        '\
+            -e 's|href="crypto_unlock_aead.html"|            href="../crypto_unlock_aead.html"|            '\
+            -e 's|href="crypto_unlock.html"|                 href="../crypto_unlock.html"|                 '\
+            -e 's|href="crypto_verify16.html"|               href="../crypto_verify16.html"|               '\
+            -e 's|href="crypto_verify32.html"|               href="../crypto_verify32.html"|               '\
+            -e 's|href="crypto_verify64.html"|               href="../crypto_verify64.html"|               '\
+            -e 's|href="crypto_wipe.html"|                   href="../crypto_wipe.html"|                   '\
+            -e 's|href="crypto_chacha20_ctr.html"|                      href="../advanced/crypto_chacha20_ctr.html"|                    '\
+            -e 's|href="crypto_chacha20_H.html"|                        href="../advanced/crypto_chacha20_H.html"|                      '\
+            -e 's|href="crypto_chacha20.html"|                          href="../advanced/crypto_chacha20.html"|                        '\
+            -e 's|href="crypto_check_final.html"|                       href="../advanced/crypto_check_final.html"|                     '\
+            -e 's|href="crypto_check_init_custom_hash.html"|            href="../advanced/crypto_check_init_custom_hash.html"|          '\
+            -e 's|href="crypto_check_init.html"|                        href="../advanced/crypto_check_init.html"|                      '\
+            -e 's|href="crypto_check_update.html"|                      href="../advanced/crypto_check_update.html"|                    '\
+            -e 's|href="crypto_curve_to_hidden.html"|                   href="../advanced/crypto_curve_to_hidden.html"|                 '\
+            -e 's|href="crypto_from_eddsa_private.html"|                href="../advanced/crypto_from_eddsa_private.html"|              '\
+            -e 's|href="crypto_from_eddsa_public.html"|                 href="../advanced/crypto_from_eddsa_public.html"|               '\
+            -e 's|href="crypto_hchacha20.html"|                         href="../advanced/crypto_hchacha20.html"|                       '\
+            -e 's|href="crypto_hidden_key_pair.html"|                   href="../advanced/crypto_hidden_key_pair.html"|                 '\
+            -e 's|href="crypto_hidden_to_curve.html"|                   href="../advanced/crypto_hidden_to_curve.html"|                 '\
+            -e 's|href="crypto_ietf_chacha20_ctr.html"|                 href="../advanced/crypto_ietf_chacha20_ctr.html"|               '\
+            -e 's|href="crypto_ietf_chacha20.html"|                     href="../advanced/crypto_ietf_chacha20.html"|                   '\
+            -e 's|href="crypto_poly1305_final.html"|                    href="../advanced/crypto_poly1305_final.html"|                  '\
+            -e 's|href="crypto_poly1305.html"|                          href="../advanced/crypto_poly1305.html"|                        '\
+            -e 's|href="crypto_poly1305_init.html"|                     href="../advanced/crypto_poly1305_init.html"|                   '\
+            -e 's|href="crypto_poly1305_update.html"|                   href="../advanced/crypto_poly1305_update.html"|                 '\
+            -e 's|href="crypto_sign_final.html"|                        href="../advanced/crypto_sign_final.html"|                      '\
+            -e 's|href="crypto_sign_init_first_pass_custom_hash.html"|  href="../advanced/crypto_sign_init_first_pass_custom_hash.html"|'\
+            -e 's|href="crypto_sign_init_first_pass.html"|              href="../advanced/crypto_sign_init_first_pass.html"|            '\
+            -e 's|href="crypto_sign_init_second_pass.html"|             href="../advanced/crypto_sign_init_second_pass.html"|           '\
+            -e 's|href="crypto_sign_public_key_custom_hash.html"|       href="../advanced/crypto_sign_public_key_custom_hash.html"|     '\
+            -e 's|href="crypto_sign_update.html"|                       href="../advanced/crypto_sign_update.html"|                     '\
+            -e 's|href="crypto_x25519_dirty_fast.html"|                 href="../advanced/crypto_x25519_dirty_fast.html"|               '\
+            -e 's|href="crypto_x25519_dirty_small.html"|                href="../advanced/crypto_x25519_dirty_small.html"|              '\
+            -e 's|href="crypto_x25519.html"|                            href="../advanced/crypto_x25519.html"|                          '\
+            -e 's|href="crypto_x25519_inverse.html"|                    href="../advanced/crypto_x25519_inverse.html"|                  '\
+            -e 's|href="crypto_x25519_public_key.html"|                 href="../advanced/crypto_x25519_public_key.html"|               '\
+            -e 's|href="crypto_xchacha20_ctr.html"|                     href="../advanced/crypto_xchacha20_ctr.html"|                   '\
+            -e 's|href="crypto_xchacha20.html"|                         href="../advanced/crypto_xchacha20.html"|                       '\
+            -i "$HTML/$file"
+    done
+}
+
+substitute "$DIR/html"
+substitute "$DIR/html/advanced"
+substitute "$DIR/html/optional"
+substitute "$DIR/html/deprecated"
+
+for file in $(ls -1 "$DIR/html" | grep ".html$")
+do
+    sed 's|href="../|href="|' -i "$DIR/html/$file"
+done
similarity index 100%
rename from doc/html/style.css
rename to doc/style.css