sjcl

package
v0.0.0-...-cb20ee0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadSJCLData = errors.New("Invalid data in SJCL JSON message")

Functions

func GetNonce

func GetNonce(encData SJCL_DataStruct) (nonce []byte, nlen int)

============================================================================================================================================

Types

type SJCL_DataStruct

type SJCL_DataStruct struct {
	InitilizationVector base64data.Base64Data `json:"iv"`     // initilization vector or nonce for CCM mode
	Version             int                   `json:"v"`      // should be constant 1 - version - only version suppoted
	Iter                int                   `json:"iter"`   // PBKDF2 iteration count
	KeySize             int                   `json:"ks"`     // keysize in bits - devide by 8 to get GO key size for pbkdf2
	TagSize             int                   `json:"ts"`     // CCM tag size in bits
	Mode                string                `json:"mode"`   // - should be constant "ccm" - only format supported
	AdditionalData      base64data.Base64Data `json:"adata"`  // additional authenticated data
	Cipher              string                `json:"cipher"` // - should be constant "aes" - only fomrat supported
	Salt                base64data.Base64Data `json:"salt"`   // PBKDF2 salt
	CipherText          base64data.Base64Data `json:"ct"`     // ciphertext
	TagSizeBytes        int                   `json:"-"`      // Tag size converted to bytes
	KeySizeBytes        int                   `json:"-"`      // Key size converted to bytes
	Status              string                `json:"status"` // Response messages include a status of success/error
	Msg                 string                `json:"msg"`    // Error response messages include a "msg"
}

func ConvertSJCL

func ConvertSJCL(file string) (eBlob SJCL_DataStruct, err error, msg string)

func ReadSJCL

func ReadSJCL(fn string) (eBlob SJCL_DataStruct)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL