Caleb James DeLisle bae1708439 Crypto: Switch from calling directly to libsodium to calling into Rust code first. Fixes IDE errors, and libsodium will be replaced Eventually™ 1 mēnesi atpakaļ
..
api.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
base.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
base2.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
crypto_int16.h caf9963793 Switch to a Rust libsodium build 4 gadi atpakaļ
crypto_int32.h caf9963793 Switch to a Rust libsodium build 4 gadi atpakaļ
crypto_int64.h caf9963793 Switch to a Rust libsodium build 4 gadi atpakaļ
crypto_int8.h caf9963793 Switch to a Rust libsodium build 4 gadi atpakaļ
crypto_sign.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
crypto_sign_ed25519.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
crypto_types.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
crypto_uint16.h caf9963793 Switch to a Rust libsodium build 4 gadi atpakaļ
crypto_uint32.h caf9963793 Switch to a Rust libsodium build 4 gadi atpakaļ
crypto_uint64.h caf9963793 Switch to a Rust libsodium build 4 gadi atpakaļ
crypto_uint8.h caf9963793 Switch to a Rust libsodium build 4 gadi atpakaļ
d.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
d2.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_0.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_1.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_add.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_cmov.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_copy.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_frombytes.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_invert.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_isnegative.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_isnonzero.c caf9963793 Switch to a Rust libsodium build 4 gadi atpakaļ
fe_mul.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_neg.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_pow22523.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_sq.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_sq2.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_sub.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
fe_tobytes.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_add.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_add.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_double_scalarmult.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_frombytes.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_madd.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_madd.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_msub.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_msub.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_p1p1_to_p2.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_p1p1_to_p3.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_p2_0.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_p2_dbl.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_p2_dbl.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_p3_0.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_p3_dbl.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_p3_to_cached.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_p3_to_p2.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_p3_tobytes.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_precomp_0.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_scalarmult_base.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_sub.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_sub.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
ge_tobytes.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
open.c bae1708439 Crypto: Switch from calling directly to libsodium to calling into Rust code first. Fixes IDE errors, and libsodium will be replaced Eventually™ 1 mēnesi atpakaļ
pow22523.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
pow225521.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
readme.md d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
sc.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
sc_muladd.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
sc_reduce.c d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ
sqrtm1.h d6bb3220d0 Vendor the custom signing code from nacl so that it is possible to use libsodium for everything else 4 gadi atpakaļ

readme.md

Why is there a half a crypto library copy-pasted into cjdns?

hysterical raisins

In the beginning cjdns didn't use signing at all, only encryption. Then when the route server model was adopted, we needed to sign messages, particularly we needed to know that a message was signed with a key corrisponding to a particular cjdns IPv6 address.

Fortunately there exists a way to convert the same keys between the twisted edwards curve (ed25519) used for signing and the this conversion is widely supported and believed to be safe.

Unfortunately we needed to go the other way, from curve25519 keys to ed25519, but since we have the private key at this stage, we can simply copy the function which creates an ed25519 pubkey and everything is good. Except that it isn't.

Ed25519 API is designed in such a way that it expects to be able to hash the private key before usage, but if we're converting that key from a curve25519 key and expecting the public key to come out correct, we need to reimplement the sign function to not hash the key before usage, so that's what we did.

My apologies to all of the security researchers out there who are now gritting their teeth at the prospect of reviewing "home-made crypto", the ugly is confined to Sign.c and I've made efforts to explain what it's doing and why I believe it to be equivilent to nacl/libsodium's crypto_sign().