Documentation ¶
Index ¶
- Constants
- Variables
- func AES256CGMOpen(key, nonce, cipherText []byte) (plainText []byte, err error)
- func AES256CGMSeal(key, nonce, plainText []byte) (cipherText []byte, err error)
- func ConcatAll(parts ...[]byte) (res []byte)
- func Dencapsulate(pub []byte, pvt []byte, ct []byte, keyType KeyType) (ss []byte, err error)
- func EncB64(b []byte) string
- func Encapsulate(pub []byte, keyType KeyType) (ct []byte, ss []byte, err error)
- func FrodoGetKem(keyType KeyType) (kem frodo.FrodoKEM, err error)
- func GenKey(keyType KeyType) (pvt []byte, pub []byte, err error)
- func KeyId(pub []byte) string
- func PrivateKeyAsString(pub []byte) string
- func PrivateKeyFromString(key string) (pvt []byte)
- func PublicKeyAsString(pub []byte) string
- func PublicKeyFromString(key string) (pub []byte)
- func QuickSha256(b []byte) []byte
- func RandBytes(size int) []byte
- func SikeBytesFromPrivateKey(pvt *sidh.PrivateKey) []byte
- func SikeBytesFromPublicKey(pvt *sidh.PublicKey) []byte
- func SikeGetKem(keyType KeyType) (*sidh.KEM, error)
- func SikePrivateKeyFromBytes(b []byte) *sidh.PrivateKey
- func SikePublicKeyFromBytes(b []byte) *sidh.PublicKey
- func SimpleSuperTripleDecrypt(cipherText []byte, password string) (plainText []byte, err error)
- func SimpleSuperTripleEncrypt(plainText []byte, password string) (cipherText []byte, err error)
- type KemSizes
- type KeyType
- type SCryptParameters
- type SimpleTripleEncryptionHeader
Constants ¶
View Source
const SimpleTripleEncryptionHeaderLen int = 4*4 + 96 + 36
Variables ¶
View Source
var CipherTextSizeByKeyType = map[KeyType]KemSizes{ KeyTypeSidhFp434: {374, 330, 346, 16}, KeyTypeSidhFp503: {434, 378, 402, 24}, KeyTypeSidhFp751: {644, 564, 596, 32}, KeyTypeFrodo640AES: {19888, 9616, 9720, 16}, KeyTypeFrodo640SHAKE: {19888, 9616, 9720, 16}, KeyTypeFrodo976AES: {31296, 15632, 15744, 24}, KeyTypeFrodo976SHAKE: {31296, 15632, 15744, 24}, KeyTypeFrodo1344AES: {43088, 21520, 21632, 32}, KeyTypeFrodo1344SHAKE: {43088, 21520, 21632, 32}, KeyTypeKyber512: {1632, 736, 800, 16}, KeyTypeKyber768: {2400, 1088, 1152, 24}, KeyTypeKyber1024: {3168, 1568, 1504, 32}, }
View Source
var CurrentSCryptParameters = SCryptParameters{
N: 65536 * 2,
R: 8,
P: 1,
}
View Source
var KeyTypeAsString = map[KeyType]string{ KeyTypeSidhFp434: "SIKE_FP434", KeyTypeSidhFp503: "SIKE_FP503", KeyTypeSidhFp751: "SIKE_FP751", KeyTypeFrodo640AES: "FRODO_640_AES", KeyTypeFrodo640SHAKE: "FRODO_640_SHAKE", KeyTypeFrodo976AES: "FRODO_976_AES", KeyTypeFrodo976SHAKE: "FRODO_976_SHAKE", KeyTypeFrodo1344AES: "FRODO_1344_AES", KeyTypeFrodo1344SHAKE: "FRODO_1344_SHAKE", KeyTypeKyber512: "KYBER_512", KeyTypeKyber768: "KYBER_768", KeyTypeKyber1024: "KYBER_1024", }
Functions ¶
func AES256CGMOpen ¶
func AES256CGMSeal ¶
func Dencapsulate ¶
func PrivateKeyAsString ¶
func PrivateKeyFromString ¶
func PublicKeyAsString ¶
func PublicKeyFromString ¶
func QuickSha256 ¶
func SikeBytesFromPrivateKey ¶
func SikeBytesFromPrivateKey(pvt *sidh.PrivateKey) []byte
func SikeBytesFromPublicKey ¶
func SikePrivateKeyFromBytes ¶
func SikePrivateKeyFromBytes(b []byte) *sidh.PrivateKey
func SikePublicKeyFromBytes ¶
Types ¶
type KeyType ¶
type KeyType uint8
const ( KeyTypeUnknown KeyType = 255 KeyTypeInvalid KeyType = iota KeyTypeSidhFp434 KeyType = iota KeyTypeSidhFp503 KeyType = iota KeyTypeSidhFp751 KeyType = iota KeyTypeFrodo640AES KeyType = iota KeyTypeFrodo640SHAKE KeyType = iota KeyTypeFrodo976AES KeyType = iota KeyTypeFrodo976SHAKE KeyType = iota KeyTypeFrodo1344AES KeyType = iota KeyTypeFrodo1344SHAKE KeyType = iota KeyTypeKyber512 KeyType = iota KeyTypeKyber768 KeyType = iota KeyTypeKyber1024 KeyType = iota )
type SCryptParameters ¶
type SimpleTripleEncryptionHeader ¶
type SimpleTripleEncryptionHeader struct { Magic uint32 Salt [32 * 3]byte Nonces [12 * 3]byte SCryptParams SCryptParameters }
Click to show internal directories.
Click to hide internal directories.