Stereoselective synthesis of β-amino nitriles and 1,3-diamines