Documentation ¶
Overview ¶
Package cyclic generates cryptographic cyclic groups and generators with a specified bit-length.
The package is not used in a live system, just to generate an initial config.
Reference: http://goo.gl/zU4ZY
Example (Usage) ¶
package main import ( "crypto/rand" "fmt" "github.com/project-iris/iris/crypto/cyclic" ) func main() { // Generate the cyclic group group, err := cyclic.New(rand.Reader, 120) if err != nil { fmt.Println("Failed to generate cyclic group:", err) } // Output in a nice, source friendly byte format fmt.Println("Cyclic group base:") bytes := group.Base.Bytes() for byte := 0; byte < len(bytes); byte++ { fmt.Printf("0x%02x, ", bytes[byte]) if byte%8 == 7 { fmt.Println() } } fmt.Println() // Output in a nice, source friendly byte format fmt.Println("Cyclic group generator:") bytes = group.Generator.Bytes() for byte := 0; byte < len(bytes); byte++ { fmt.Printf("0x%02x, ", bytes[byte]) if byte%8 == 7 { fmt.Println() } } fmt.Println() }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.