@@ -52,8 +52,8 @@ pub struct CmdEncrypt {
5252 /// Remove source file
5353 #[ arg( long, short = 'R' ) ]
5454 pub remove_file : bool ,
55- /// Create file
56- #[ arg( long) ]
55+ /// Create file (create a empty encrypted file)
56+ #[ arg( long, short = 'a' ) ]
5757 pub create : bool ,
5858 /// Disable compress meta
5959 #[ arg( long) ]
@@ -265,16 +265,16 @@ fn encrypt_envelops(cryptor: Cryptor, key: &[u8], envelops: &[&TinyEncryptConfig
265265 let mut encrypted_envelops = vec ! [ ] ;
266266 for envelop in envelops {
267267 match envelop. r#type {
268- TinyEncryptEnvelopType :: Pgp => {
268+ TinyEncryptEnvelopType :: PgpRsa => {
269269 encrypted_envelops. push ( encrypt_envelop_pgp ( key, envelop) ?) ;
270270 }
271271 TinyEncryptEnvelopType :: PgpX25519 | TinyEncryptEnvelopType :: StaticX25519 => {
272272 encrypted_envelops. push ( encrypt_envelop_ecdh_x25519 ( cryptor, key, envelop) ?) ;
273273 }
274- TinyEncryptEnvelopType :: Ecdh | TinyEncryptEnvelopType :: KeyP256 => {
274+ TinyEncryptEnvelopType :: PivP256 | TinyEncryptEnvelopType :: KeyP256 => {
275275 encrypted_envelops. push ( encrypt_envelop_ecdh ( cryptor, key, envelop) ?) ;
276276 }
277- TinyEncryptEnvelopType :: EcdhP384 => {
277+ TinyEncryptEnvelopType :: PivP384 => {
278278 encrypted_envelops. push ( encrypt_envelop_ecdh_p384 ( cryptor, key, envelop) ?) ;
279279 }
280280 _ => return simple_error ! ( "Not supported type: {:?}" , envelop. r#type) ,
@@ -285,7 +285,7 @@ fn encrypt_envelops(cryptor: Cryptor, key: &[u8], envelops: &[&TinyEncryptConfig
285285
286286fn encrypt_envelop_ecdh ( cryptor : Cryptor , key : & [ u8 ] , envelop : & TinyEncryptConfigEnvelop ) -> XResult < TinyEncryptEnvelop > {
287287 let public_key_point_hex = & envelop. public_part ;
288- let ( shared_secret, ephemeral_spki) = util_p256:: compute_shared_secret ( public_key_point_hex) ?;
288+ let ( shared_secret, ephemeral_spki) = util_p256:: compute_p256_shared_secret ( public_key_point_hex) ?;
289289 let enc_type = match cryptor {
290290 Cryptor :: Aes256Gcm => ENC_AES256_GCM_P256 ,
291291 Cryptor :: ChaCha20Poly1305 => ENC_CHACHA20_POLY1305_P256 ,
0 commit comments