Golang crypto/elliptic.Unmarshal() function example
package crypto/elliptic
Unmarshal converts a point, serialized by Marshal, into an x, y pair. On error, x = nil.
Golang crypto/elliptic.Unmarshal() function usage example
var marshaled []byte
marshaled = elliptic.Marshal(elliptic.P224(), x, y)
fmt.Printf("Point : %x\n", marshaled)
fmt.Println()
var unmarX, unmarY *big.Int
unmarX, unmarY = elliptic.Unmarshal(elliptic.P224(), marshaled)
fmt.Printf("Unmarshaled X : %d\n Y : %d\n", unmarX, unmarY)
fmt.Println()
Example output :
Point : 04f93bd2b06e3c0bb1......b812fe
Unmarshaled X : 262473703821.....691646499146372
Y : 2307843595856198227....859233022
Reference :
See also : Golang crypto/elliptic.GenerateKey() function example
Advertisement
Something interesting
Tutorials
+9.6k Golang : Read file with ioutil
+15.3k Golang : Delete certain files in a directory
+16.4k Golang : Send email and SMTP configuration example
+14.5k How to automatically restart your crashed Golang server
+7.2k Golang : Null and nil value
+10.6k Golang : Simple File Server
+6.2k PHP : How to handle URI or URL with non-ASCII characters such as Chinese/Japanese/Korean(CJK) ?
+4.7k Chrome : How to block socketloop.com links in Google SERP?
+12.3k Golang : Get month name from date example
+11.4k Golang : Delay or limit HTTP requests example
+8.1k Golang : Check from web if Go application is running or not
+14.4k Android Studio : Use image as AlertDialog title with custom layout example