v2 / vlib / crypto / blake2s / testdata / blake2s.awk
7 lines · 7 sloc · 404 bytes · e6a30dc4efec3e8cd3eb0b12c2f21b9d1e281849
Raw
1/\[/ { print ("const vectors = [") }
2/]/ { print ("]") }
3/"hash": "blake2s"/ { print ("\tTestVector{") }
4/"in":/ { gsub(/"|,/, "", $2); print ("\t\tinput: '" $2 "',") }
5/"key":/ { gsub(/"|,/, "", $2); print ("\t\tkey: '" $2 "',") }
6/"out":/ { gsub(/"|,/, "", $2); print ("\t\toutput: '" $2 "',") }
7/}/ { print (" },") }
8