Documentation ¶
Overview ¶
Copyright (C) 2018 go-gamc authors
This file is part of the go-gamc library.
the go-gamc library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
the go-gamc library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the go-gamc library. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2018 go-gamc authors ¶
This file is part of the go-gamc library.
the go-gamc library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
the go-gamc library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the go-gamc library. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func RandomCSPRNG(n int) []byte
- type Cipher
- func (c *Cipher) Decrypt(data []byte, passPhrase []byte) ([]byte, error)
- func (c *Cipher) DecryptKey(data []byte, passPhrase []byte) ([]byte, error)
- func (c *Cipher) Encrypt(data []byte, passPhrase []byte) ([]byte, error)
- func (c *Cipher) EncryptKey(addressStr string, data []byte, passPhrase []byte) ([]byte, error)
- type Encrypt
- type Scrypt
- func (s *Scrypt) Decrypt(data []byte, passphrase []byte) ([]byte, error)
- func (s *Scrypt) DecryptKey(keyjson []byte, passPhrase []byte) ([]byte, error)
- func (s *Scrypt) Encrypt(data []byte, passphrase []byte) ([]byte, error)
- func (s *Scrypt) EncryptKey(addressStr string, data []byte, passPhrase []byte) ([]byte, error)
- func (s *Scrypt) ScryptEncrypt(data []byte, passphrase []byte, N, r, p int) ([]byte, error)
Constants ¶
const ( ScryptKDF = "scrypt" ScryptR = 8 ScryptN = 1 << 12 // LightScryptP is the P parameter of Scrypt encryption algorithm, using 4MB // memory and taking approximately 100ms CPU time on a modern processor. ScryptP = 6 // ScryptDKLen get derived key length ScryptDKLen = 32 )
Variables ¶
Functions ¶
func RandomCSPRNG ¶
RandomCSPRNG a cryptographically secure pseudo-random number generator
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
func (*Cipher) DecryptKey ¶
type Encrypt ¶
type Encrypt interface { Encrypt(data []byte, passphrase []byte) ([]byte, error) Decrypt(data []byte, passphrase []byte) ([]byte, error) EncryptKey(addressStr string, data []byte, passphrase []byte) ([]byte, error) DecryptKey(data []byte, passphrase []byte) ([]byte, error) }
Encrypt interface for encrypt