move crypto parts from stdi2p to crypto package

This commit is contained in:
Jeff Becker
2016-01-28 15:11:54 -05:00
parent b52e4adc04
commit 3deb15e012
12 changed files with 278 additions and 173 deletions

16
lib/crypto/encrypt.go Normal file
View File

@@ -0,0 +1,16 @@
package crypto
type Encrypter interface {
// encrypt a block of data
// return encrypted block or nil and error if an error happened
Encrypt(data []byte) (enc []byte, err error)
}
type PublicEncryptionKey interface {
// create a new encrypter to encrypt data to this public key
NewEncrypter() (Encrypter, error)
// length of this public key in bytes
Len() int
}