added test vector 2, fix derivation function